1. Interfacing of LM 35 using 8051 T.Srikrishna, M.Sc, M.Tech, GVP
INTERFACING OF LM35 TEMPERATURE SENCOR WITH 8051
The main principle of this circuit is to take the analog temperature values, convert
them into digital values and display the digital temperature value oN LCD or 7-
Segment Display using 8051 MC.
• A temperature sensor ( LM35) is interfaced to the 8051 via an ADC
(ADC0804)
• The LM 35 IC generates a 10mV variation to its output voltage for every
degree Celsius change in temperature. (Scale factor 10mv/ 10 C )
• The Output of the temperature sensor is analog in nature so we need an A/D
converter for converting the analog input to its equivalent binary output.
• The ADC0804 converts the measured temperature output voltages from the
LM35 into digital signals then handled by the 8051
• The ADC 0804 is the analog to digital converter.
2. Interfacing of LM 35 using 8051 T.Srikrishna, M.Sc, M.Tech, GVP
• After the INTR has become low, send a H-to-L pulse to the RD pin to get the
data out of the ADC0804 IC chip
• Here ADC 0804 is connected to port1 of 8051.
• RD, WR and INTR of ADC is connected to P2.5, P2.6 and P2.7 respectively.
• Analog input is applied to Vin of ADC.
• Here WR is for the start of conversion and INTR is for the end of conversion.
3. Interfacing of LM 35 using 8051 T.Srikrishna, M.Sc, M.Tech, GVP
RD BIT P 2.5
WR BIT P 2.6
INTR BIT P 2.7
MOV P1, #0FFh
SETB P 2.7
(EOC is high. The ADC sends a low signal when conversion is finished. So the line
needs to be high so that MC can detect the change)
Back CLR P 2.6; WR=0
SET P 2.6; WR=1 (L-H, to start conversion)
Keep monitoring the INTR pin. If INTR is low, the conversion is finished. If INTR is
high, keep polling until it goes low.
WAIT: JB P2.7, WAIT (wait for end conversion)
CLR P2.5 (conversion is finished. Enable RD)
MOV A, P1 (read the data from port1)
ACALL CONVERSION (Hex-ASCII Conversion)
ACALL DATA_DISPLAY (display the data)
SETB P 2.5 (Disable Read)
SJMP Back