Overview Of LM35
The LM35 is an analog temperature sensor with only three pins, positive supply voltage, ground and analog temperature output voltage. It could convert the temperature between -55 to 150 degree Celsius.
LM35DZ in TO-92 Package |
Supply voltage ranges from 4 to 30 V. It’s temperature accuracy is about 0.25 degree Celsius. DOUT is the analog temperature output. The equivalence temperature is 10 mV per degree Celsius.
Typical connection diagram |
PIC Programming And Interfacing
I use the ADC module of PIC16F819 to read the analog temperature value, fed into RA0.
In the positive temperature condition, LM35 creates a positive output voltage. Similarly, it creates a negative voltage output value in the below-zero temperature condition. The main problem is to make PIC16F819 able to read negative voltage value.
PIC16F819 has two voltage reference pins,
- VREF+ at RA3
- VREF- at RA2
But by default the voltage reference is internally connected to +5 V and GND. Anyway, I use external voltage references for the ADC. VREF+ connects to +2.5 V and VREF- connects to -2.5 V. The total reference voltage still stays at 5 V.
PIC16F819 has an internal RC oscillator, clocks up to 8 MHz. I decided to use this internal clock due to extra components placement and circuit designing add-on.
A character LCD displays connects to PORTB, displays the temperature data. It works in 4-bit mode.
Schematic Diagram |
To create a -2.5/+2.5 V negative voltage pair, I use two 2.5 V zener diode pair as shown in the schematic diagram.
This program consumes 78 % of program memory, and 16 % of device’s RAM. |
A simulation screen shot |
No comments:
Post a Comment