Simple Digital Thermometer
Posted: Sun May 20, 2012 10:09 am
Simple Digital Thermometer
Introduction
My earlier temperature projects have all used the LM35 device.
This is a 3 pin device in either a TO-92 or TO-202 style package.
The device comes in a few different accuracies, but all operate with the same basic 10 mV/°C output.
The main problem with the LM35 is it only reads positive temperatures
(without external signal conditioning circuitry.)
This project uses the LM335 type device.
It comes in the same TO-92 package, but it has an output of 10mV/K
This allows it to read negative temperatures.
The device selected here reads from -40°C to 100°C (233.15K to 373.15K)
K = Kelvin
This is the absolute thermodynamic temperature scale, where 0K = absolute zero = -273.15°C
It is not referred to as degrees Kelvin, as in degrees Celsius, but just Kelvin.
Therefore
0°C = 273.15 K
100°C = 373.15 K
The output from the device is converted to temperature as follows
Remember to use the floating point calculations in Flowcode and not the standard mathematical operators.
First Convert The ADC voltage to Kelvin (Read ADC as float)
Temp = fmul ( ADC_Voltage, 100)
Now convert to °C from Kelvin
Temp2 = fsub( Temp , 273.15)
Example ADC Voltage = 2.1115 V
Temp = 2.9818 * 100
Temp = 298.18
Temp2 = Temp - 273.15
Temp2 = 298.18 - 273.15
Temp2 = 25.03
Temp2 is then converted to a string to be displayed on the LCD
Equipment :
EB-006 Programmer with PIC 16F877A
EB-005 LCD Display
EB-016 Prototype Board
LM335Z Temperature Sensor - Connected to ADC5 (Port E Bit 0)
10k-ohm Preset Pot (Multi Turn preferred)
1k8 Resistor
The 10k-ohm pot is used to calibrated the sensor. It is adjusted until the display shows the ambient temperature in the room measured as close to the LM335 as possible.
Once set is should not need to be adjusted again.
Introduction
My earlier temperature projects have all used the LM35 device.
This is a 3 pin device in either a TO-92 or TO-202 style package.
The device comes in a few different accuracies, but all operate with the same basic 10 mV/°C output.
The main problem with the LM35 is it only reads positive temperatures
(without external signal conditioning circuitry.)
This project uses the LM335 type device.
It comes in the same TO-92 package, but it has an output of 10mV/K
This allows it to read negative temperatures.
The device selected here reads from -40°C to 100°C (233.15K to 373.15K)
K = Kelvin
This is the absolute thermodynamic temperature scale, where 0K = absolute zero = -273.15°C
It is not referred to as degrees Kelvin, as in degrees Celsius, but just Kelvin.
Therefore
0°C = 273.15 K
100°C = 373.15 K
The output from the device is converted to temperature as follows
Remember to use the floating point calculations in Flowcode and not the standard mathematical operators.
First Convert The ADC voltage to Kelvin (Read ADC as float)
Temp = fmul ( ADC_Voltage, 100)
Now convert to °C from Kelvin
Temp2 = fsub( Temp , 273.15)
Example ADC Voltage = 2.1115 V
Temp = 2.9818 * 100
Temp = 298.18
Temp2 = Temp - 273.15
Temp2 = 298.18 - 273.15
Temp2 = 25.03
Temp2 is then converted to a string to be displayed on the LCD
Equipment :
EB-006 Programmer with PIC 16F877A
EB-005 LCD Display
EB-016 Prototype Board
LM335Z Temperature Sensor - Connected to ADC5 (Port E Bit 0)
10k-ohm Preset Pot (Multi Turn preferred)
1k8 Resistor
The 10k-ohm pot is used to calibrated the sensor. It is adjusted until the display shows the ambient temperature in the room measured as close to the LM335 as possible.
Once set is should not need to be adjusted again.