(Initial report by Hsiao-Ho Hsu, 11/28/05)

Overview on temperature :

"Temperature is the most often-measured environmental quantity. This might be expected since most physical, electronic, chemical, mechanical and biological systems are affected by temperature. Some processes work well only within a narrow range of temperatures; certain chemical reactions, biological processes, and even electronic circuits perform best within limited temperature ranges. When these processes need to be optimized, control systems that keep temperature within specified limits are often used. Temperature sensors provide inputs to those control systems."

Types of temperature sensing:

There are many methods to get the temperture and each has various applications.

For example: Thermal Imaging (Thermography, Thermology and Night Vision) could be used to camouflage for military use, key out noise background, SARS heat detects application, live detects)

National Semiconductor provides a very clear LM series application notes

Except for the temperature sensor IC, there are also Thermally Sensitive Resistance (thermistor), Resistance Temperature Detectors, Thermal Couple, infrared,
the temperature sensor come with different types

Terminal-head , Process-mount, Sensor-Plug, Surface-mount

pictures from ueonline.com

Overview on LM34 IC sensor:

LM34 and LM35 IC temperature sensors made by National Semiconductor are simple three-terminal devices. Connect one pin to +5 to +20 volts, and another to ground. The voltage at the output terminal will be proportional to the temperature to the tune of 0.01 volt (10 millivolts) per degree. For example, if the temperature is 68 degrees, the output will be 0.68 V. In the case of the LM34, the output corresponds to degrees Fahrenheit; the LM35, degrees Celsius. Because of the direct relationship between temperature and voltage, you must have a negative supply voltage or some additional components in order to measure subzero temperatures

LM34 datasheet(by National Semiconductor)

order free samples(signup with educational email to get free samples)

Typical Applications

This kind of temp IC sensor is usually used to:

1.)Protect the electronics from overheating,

ex: Semiconductor devices and LCDs (Liquid Crystal Displays) better battery performance

2.)To enhance computer system reliability,

ex: activate a cooling fan, slow down the system clock, or shut the system down completely if the processor gets too hot.

Electrical Characteristics

Vout = + 10.0 mV / F

The LM34 can be applied easily in the same way as other integrated-circuit temperature sensors. It can be glued or cemented to a surface and its temperature will be within about 0.02F of the surface temperature. This presumes that the ambient air temperature is almost the same as the surface temperature.

The LM34 does not require any external calibration or trimming to provide typical accuracies of 1⁄2F at room temperature and 11⁄2F over a full −50 to +300F temperature range. LM35 serves the same purpose in degrees Celsius.

Pin Descriptions

LM34 is a three pin device; one for supply voltage, one for ground, and one for output. Connections are as shown in the diagram at right. The three wire interface used to operate the LM34 can be run more than a hundred feet without significant signal degradation. It is a good idea to add a 0.1 uF capacitor connected at the ADC circuit. This helps improve the stability of the measurement by reducing the effects of noise picked up on the Signal line.

Microcontroller Connections

To put a capacitor between the power and the ground pin of LM34 is suggested. In my case, I put a 0.1uF capacitor. For pic, I use 16F819, there is no serial out pin description on the datasheet. However, I found RB0- RB3 works fine.

Code Sample

Here's a PicBasic Pro code sample for the 16F819 and processing datalogging

Output the real temperature value in Fahrenheit/ Celsius.

1.) use Vref pin

Adjust the potentiometer until you have a reading with your voltmeter of +2.55 volts from the potentiometer wiper to ground. Then connect the wiper to the pic, and the remaining terminals as shown above. Since the LM34 will output a voltage of 10 millivolts per F, we can set reference port as the +Vref at 2.55V, and each ADC unit will = 2.55V/255 = 0.01V = 10 mV. With chosen reference port as +Vref, and our + reference set to '2.55V', each ADC unit will = 1F. This limits the upper range, but for a household application it's more than enough range.

2.) convert in code

from the datasheet we know that Vout = + 10.0 mV / F= + 0.01 V/ F ==> F = Vout / +0.01 V

So if our read-in adcVar is set to word ranges from 1-1024; corresponding to the 5 Volts applied to the sensor in the circuit, apply formula like this will give you a real reading of degree Fahrenheit

Temp = 5 * adcVar * 100 / 1024

Here's the fill code for this version, in PicBasic Pro:

DEFINE  ADC_BITS        10             ' Set number of bits in result
DEFINE  ADC_CLOCK       3          ' Set clock source (3=rc)
DEFINE  ADC_SAMPLEUS    50          ' Set sampling time in uS

adcVar var WORD                                                                                 
temp var word
inByte Var Byte

'it was portb.0 and port.1
tx var portb.0
rx var portb.1 

n9600 con 16468

TRISA = %11111111   ' Set PORTA to all input
ADCON1 = %10000010  ' Set up ADCON1

pause 500

Main:
    ' wait for an instruction from the remote computer to read:
    serin2 rx, n9600 ,[inByte]    
    ' read the sensor through the ADC:
    ADCin 0, adcVar                                        
    ' convert the reading to a temperature value:
    temp = 5 * adcVar/ 10
    serout2 tx, n9600, ["temp ",  DEC temp ,13, 10]
Goto main





3.) use ADC convertor

a detail document from parallax.com shows you how (plus a Remote temperature sensor circuit sample)



p.s. in any case you want to amplify it, hometoys.com gives a clear description

also, National Semiconductor does have digital temperature sensors......





Not really Typical Behavior




Application Notes

If the air temperature were much higher or lower than the surface temperature, the actual temperature of the LM34 die would be at an intermediate temperature between the surface temperature and the air temperature. This is especially true for the TO-92 plastic package, where the copper leads are the principal thermal path to carry heat into the device, so its temperature might be closer to the air temperature than to the surface temperature.