dukebound85
New Member
Hi, I am working on a project and I am trying to use the lm335 temperature sensor to display the ambient temp on an lcd. I have the lcd working but the value I have for tempurature is 8128 with no calibration at room temp. Note that when I attach ground to the analog input on my pic, it reads 0 as it is suppose to. This is not the tempurature but just the value the pic is reading from the sensor I think. I am using a pic 16f88 that has a/d conversion(10bit if i remeber correctly) in it already. As of right now, I have the Porta.0 as the analog input into the pic. So to get to my question, I have researced everywhere, but can not seem to figure out how to calibrate the sensor and it is causing me much grief.
On my circuit I have 5v running through a 2.2k resistor that goes into the input pin(pin2) on the sensor. Pin 1 of the sensor is to ground and pin3, the adj pin is running from the sensor to my analog input pin(pinA.0) on my pic. I know the sensor is working for the output voltage at 25 degC is about 2.99v which falls within the range specified on the data sheet. Also When I hook up the multimeter to check the voltage of the pin3 on the sensor, the voltage goes up as it gets warmer and down when colder. The problem is is that my pic is not updating the temperature in a predictable manner on the lcd. The lm335 has a sensitivity of 10mv/K and this is where I am concerned.
I think I may need to uses a difference op amp or the problem may lie in my code. If anyone would like to clarify this for me, it would be greatly appreciated. I do not think that these sesors should be to hard to figure out but for me, it has been aggravating lol.
Attached is my code in picbasic pro, hopefully somebody could point me in the right direction as to calibrate the sensor or how to get it to work.
Once again thanks for any insight on this.
Jonathan
On my circuit I have 5v running through a 2.2k resistor that goes into the input pin(pin2) on the sensor. Pin 1 of the sensor is to ground and pin3, the adj pin is running from the sensor to my analog input pin(pinA.0) on my pic. I know the sensor is working for the output voltage at 25 degC is about 2.99v which falls within the range specified on the data sheet. Also When I hook up the multimeter to check the voltage of the pin3 on the sensor, the voltage goes up as it gets warmer and down when colder. The problem is is that my pic is not updating the temperature in a predictable manner on the lcd. The lm335 has a sensitivity of 10mv/K and this is where I am concerned.
I think I may need to uses a difference op amp or the problem may lie in my code. If anyone would like to clarify this for me, it would be greatly appreciated. I do not think that these sesors should be to hard to figure out but for me, it has been aggravating lol.
Attached is my code in picbasic pro, hopefully somebody could point me in the right direction as to calibrate the sensor or how to get it to work.
Once again thanks for any insight on this.
Jonathan