lm35 temperature sensor
Download
Report
Transcript lm35 temperature sensor
LM35 TEMPERATURE SENSOR
The LM35 is an integrated circuit sensor that can be used to measure
temperature with an electrical output proportional to the temperature
(in oC)
PIN OUT OF LM35
WHY LM35 ??
You can measure temperature more accurately than a
using a thermistor.
The sensor circuitry is sealed and not subject to
oxidation, etc.
The LM35 generates a higher output voltage than
thermocouples and may not require that the output
voltage be amplified.
BASIC FORMULA
Vout = analog input voltage/step size
Vref =5V
There are 1024 steps between 0 and +5 volts
.
INTERNAL CIRCUIT OF LM35
WORKING
There are two transistors in the center of the
drawing. One has ten times the emitter area of the
other.
one tenth of the current density
This causes a voltage across the resistor R1 that is
proportional to the absolute temperature
Contd…
The amplifier at the top ensures that the voltage at
the base of the left transistor (Q1) is proportional to
absolute temperature (PTAT) by comparing the
output of the two transistors
The amplifer at the right converts absolute
temperature (measured in Kelvin) into either
Fahrenheit or Celsius, depending on the part (LM34 or
LM35)
CODE
int val;
int tempPin = 1;
void setup()
{
Serial.begin(9600);
}
void loop()
{
contd
val = analogRead(tempPin);
float mv = ( val/1024.0)*5000;
float cel = mv/10;
float farh = (cel*9)/5 + 32;
Contd…
Serial.print("TEMPRATURE = ");
Serial.print(cel);
Serial.print("*C");
Serial.println();
delay(1000);
Contd..
/* uncomment this to get temperature in farenhite
Serial.print("TEMPRATURE = ");
Serial.print(farh);
Serial.print("*F");
Serial.println();
Some other temperature sensors
DHT11- moisture and humidity sensor
Thermistor 10k – body temperature