the LM335 is a 3-pin analog device which can measure temperature (converts temperature to analog voltage). This sensor requires an ADC to convert the analog data into digital data.
This topic shows how to build a thermometer using PIC12F1822 microcontroller and LM335 analog temperature sensor.
The LM335 sensor has the following features (from LM335 datasheet):
- Directly Calibrated to the Kelvin Temperature Scale
- 1°C Initial Accuracy Available
- Operates from 400 μA to 5 mA
- Less than 1-Ω Dynamic Impedance
- Easily Calibrated
- Wide Operating Temperature Range
- 200°C Overrange
- Low Cost
The LM135 has a breakdown voltage directly proportional to absolute temperature at 10 mV/°K. For example if the LM335 output voltage is equal to 3.03 (3030 mV) that means the temperature is: 303 Kelvin = 30 °Celsius.
The PIC12F1822 is an 8-bit microcontroller which has 4 analog channels with 10-bit resolution. The good thing with this microcontroller is the fixed voltage reference. With the fixed voltage reference we get approximately an exact result. Normally negative and positive references of the ADC module are VSS and VDD, but VDD is not exactly equal to 5.00V and here we should use the fixed voltage reference as a positive reference of the ADC module.
The PIC12F1822 has 3 fixed voltage references: 1.024V, 2.048V and 4.096V. For example if we set the fixed voltage reference to 4.096V and the ADC module is configured so that the negative and the positive references are VSS and FVR (Fixed Voltage Reference) respectively, in this case the equivalent 10-bit digital value of 4.096 is 1023 and 3.00V is 3.00 * 1023/4.096 = 749 , and so on.
In this project I used 4.096 because the LM335 output is between 2.23V (temperature = -50°C) and 3.98V (temperature = +125°C).
The temperature values (Kelvin and degree Celsius) are displayed on 1602 LCD display. This LCD is interfaced with the microcontroller using 74HC595 (74HC164 …..) shift register as what was done in this post:
Interfacing PIC12F1822 microcontroller with LCD display
Hardware Required:
- PIC12F1822 microcontroller
- LM335 Temperature sensor – datasheet
- 1602 LCD Screen
- 74HC595 shift register
- 10K ohm variable resistor
- 2.2K ohm resistor
- +5V Power supply source
- Breadboard
- Jumper wires
Read more: PIC12F1822 + 1602 LCD + LM335 Temperature Sensor
The post PIC12F1822 + 1602 LCD + LM335 Temperature Sensor appeared first on PIC Microcontroller.