mcp23017 and analog tmp/photo cell sensors
Moderators: adafruit_support_bill, adafruit

mcp23017 and analog tmp/photo cell sensors

by prussia on Mon Feb 04, 2013 2:50 pm

Hi,
It's possible I screwed up on the purchase of the mcp23017 but I wanted to use it to connect the TMP36 analog sensor and a photocell to it.

I followed these instructions for the TMP36 and connected it to GPA1 input.
I don't want to use the pullup or pull down functions of the mcp23017 for this one unless I need to. So I have no idea on how to code the pi (or wire) an input that would work.

As for the photocell these instructions suggest you need a voltage divider with a pullup resistor. I didn't have one so just used a 10k resister in the voltage divider as per these arduino instructions. Itis connected to GPA2

In any case any hints as to how to write some code to get basic input with no pullup-resistors from the pins would be nice. I've done a search on the forums and it seems most of the uses are to have switches trigger some event which makes me believe my sensors would not work with this chipset.

I apologize for my ignorance if the info is easily accessible and i missed it.
prussia
 
Posts: 15
Joined: Mon Jan 21, 2013 7:07 pm

Re: mcp23017 and analog tmp/photo cell sensors

by adafruit on Wed Feb 06, 2013 11:54 pm

MCP23017 does not have analog inputs
User avatar
adafruit
 
Posts: 11682
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: mcp23017 and analog tmp/photo cell sensors

by prussia on Thu Feb 07, 2013 12:50 pm

Hi,
Thanks for the response. Your work is fantastic. I'm a biologist finally delving into the pi and it has been very re-warding thanks to your work. I already hooked up the mcp23008 to the sensors so I should change my post..

I'm having trouble with the math though for the tmp36. I seem to be ~10oF off for some reason
prussia
 
Posts: 15
Joined: Mon Jan 21, 2013 7:07 pm