Project 5 – Analog Sensor: Temperature using LM35

Project 5 – Analog Sensor: Temperature using LM35

PROJECT 5

ANALOG SENSOR: TEMPERATURE USING LM35

Back to Project 4                                                                                                         Go to Project 6

Nowadays, there are many type of temperature sensor is come with different output form and also the temperature range such as thermocouple, thermistor, infrared, RTD. In here, we pick LM35 as our temperature sensor due to it have a linear output and also suitable for normal use like weather temperature measuring.

———————————————————————————————————————————————————-

COMPONENT NEEDED

———————————————————————————————————————————————————-

16 x 2 LCD Display

 

LM35 TEMPRETURE SENSOR

 

BREADBOARD

 

———————————————————————————————————————————————————-

CONNECTION

———————————————————————————————————————————————————-
The connection for the LM35 are very easy. Just connect one end to VDD (RED wire)(4V to 20V) and the other end to GND(BLACK wire) while the middle pin (YELLOW wire) is connected to RA0. By referring to the PIC16F887, there are total 14 analog pins that we can choose. In here we use RA0 as out ADC input pin.

———————————————————————————————————————————————————-

ADDITIONAL INFORMATION

———————————————————————————————————————————————————-
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1⁄4˚C at room temperature and ±3⁄4˚C over a full −55 to +150˚C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear output, and precise inherent calibration makeinterfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply, it has very low self-heating, less than 0.1˚C in still air. The LM35 is rated to operate over a −55˚ to +150˚C temperature range.

Features
~ Calibrated directly in ° Celsius (Centigrade)
~ Linear + 10.0 mV/°C scale factor
~ 0.5°C accuracy guaranteeable (at +25°C)
~ Rated for full −55° to +150°C range
~ Suitable for remote applications
~ Low cost due to wafer-level trimming
~ Operates from 4 to 30 volts
~ Less than 60 μA current drain
~ Low self-heating, 0.08°C in still air
~ Nonlinearity only ±1⁄4°C typical
~ Low impedance output, 0.1 W for 1 mA load.

———————————————————————————————————————————————————-

CODE OVERVIEW

———————————————————————————————————————————————————-

celsuis=adc_value/2;
LM35 have already designed to give an exact value of temperature in Celsius. By referring to the graph, the ADC output are only need to divide by 2 to get the result in Celsius.

kelvin = ((celsius*100)+27315)/100;
Kelvin formula are (Celsius + 273.15). But for microcontroller, it will not read the result after the DOT. E.g. : if result is kelvin = 300.15, the mcrocontroller will only read 300 only and will ignore .15. In order to get the result after the DOT, we times the result in 100 so that we can get the result after the DOT.

fehrenheit = ((celsius*18)/10)+32;
Fahrenheit formula are ([celsuis*1.8]+32). In the coding, the formula have been times will 10 times to get the exact result.

reaumur = (celsuis*8)/10;
Reaumur formula are (celsius*0.8). Same as the previous technic, in order to let microcontroller to get the more accurate result, we times it with 10 to get the result after the DOT.

Back to Project 4                                                                                                          Go to Project 6

———————————————————————————————————————————————————-

ATTACHMENT

1.P5 User Manual.pdf
2.Project_5_code.zip

BUY