Interfacing of Temperature Sensor (LM-35)

Updated on 2017/08/06 15:13

Syllabus

  • Interfacing of 8051 microcontroller with: Temperature sensors

Sensor Basics

Sensor is any device capable of sensing physical parameters (like temperature, pressure, proximity, etc) and then convert into electrical signals so that it can be used for processing.
So, robots have Camera, piezoelectric sensors, acoustic sensors, accelerometer, etc.

Now let’s move on to some of the fundamentals of sensors. We can measure Light, motion, temperature, magnetic fields, gravity, humidity, vibration, pressure, electrical fields, sound, and other physical aspects of the external environment can be measured using them. Of course there are different sensors for each purpose like IR sensors, proximity sensors, temperature sensors, tilt sensors, accelerometers, ultrasonic sensors, RADAR, SONAR, etc.

Every sensor in this world has three terminals:

  • Vcc – to power up the sensor
  • GND – to provide a fixed negative reference
  • Output – analog output of the sensor (in some sensors, there may be more than one output terminals)

The following block diagram demonstrates it.

sensor.png

The sensor senses the physical parameters and gives a corresponding output. In most cases the output is analog.

LM35 Temperature Sensor

About LM35

LM35 is a precision centigrade temperature sensor.

  • It has three terminals – Vcc, Ground and Output – as shown in the adjoining diagram.
  • It has a sensitivity of 10mV/°C. This means that for every degree rise in temperature, the output voltage increases by 10mV.
  • In general, it gives a voltage of 0V at 0°C. Hence, say for an output of 450mV, the temperature is 45°C.

LM35.png

Interfacing Diagram

Temperature-sensor-Interfacing-with-8051.png

Assembly Language Program for Interfacing

ORG 00h
ALE BIT P2.6
OE BIT P2.5
SOC BIT P2.6
EOC BIT P2.7
ADDR_A BIT P2.0
ADDR_B BIT P2.1
ADDR_C BIT P2.2
MYDATA EQU P1
MOV MYDATA,#0FFH
SETB EOC
CLR ALE
CLR SOC
CLR OE
BACK:
CLR ADDR_C
CLR ADDR_B
CLR ADDR_A
ACALL DELAY
SETB ALE
ACALL DELAY
SETB SOC
ACALL DELAY
CLR ALE
CLR SOC
HERE:JB EOC,HERE
HERE1:JNB EOC,HERE1
SETB OE
ACALL DELAY
MOV A,MYDATA
CLR OE
ACALL CONVERSION
ACALL DISPLAY
SJMP BACK

References

  • Created and developed by Prof.S.M.Wagh,SKNCOE
  • Interfacing diagram by Jayesh Gopal, Wikinote volunteer, SKNCOE
  • WikiNote Foundation
Tags:
Created by Sujit Wagh on 2017/08/03 16:38