Celsius Scale Thermometer using AT89C51 and LM35
This project demonstrates the design, development and operation of the Celsius scale Thermometer using LM35 Temperature Sensor and AT89C51 Microcontroller. The circuit contains the analog temperature sensor LM35, which has the advantage of providing an output directly proportional to the Celsius Temperature, without having the need to be calibrated.
The 8-bit Analog to Digital Converter ADC0804, which employs the successive approximation conversion approach, is also included in the project. The microcontroller is in charge of the ADC0804, which processes its output and displays the temperature reading on an LCD display. This page discusses the microcontroller programme, circuit design, and circuit operation in depth.
- Construction and Output Video
- Principle behind the Circuit
- Circuit Diagram of Celsius Scale Thermometer
- Components Required
- Celsius Scale Thermometer Circuit Design
- Microcontroller Circuit Design
- Interfacing ADC and LM35
- Interfacing LCD
- Working of Celsius Scale Thermometer Circuit
- Algorithm Steps to Write Circuit code for Celsius Scale Thermometer
- Applications of Celsius Scale Thermometer Circuit
- Limitations of the Circuit
Construction and Output Video
Principle behind the Circuit
The circuit operates on the analog-to-digital conversion principle. An analogue temperature sensor (LM35) measures the temperature, and the analogue value is transformed to a digital value using an ADC (ADC0804). The digital signal is then processed by an AT89C51 microprocessor, which displays the temperature value in Celsius on the display screen (162 LCD).
Circuit Diagram of Celsius Scale Thermometer
Components Required
- 8051 Microcontroller (AT89C51)
- 8051 Development Board
- 8051 Programmer
- 16 x 2 LCD Display
- 10KΩ Potentiometer
- ADC0804 – ADC IC
- 10KΩ Resistor (1/4 Watt)
- 150pF Capacitor (Ceramic Disc Type) – Code: 151
- LM35 – Temperature Sensor
- Connecting Wires
- Power Supply
- Keil µVision IDE
- Willar Software
- You may need the following components if you do not have an 8051 Development board
- 11.0592 MHz Quartz Crystal
- 2 x 33pF Capacitor
- 2 x 10KΩ Resistor (1/4 Watt)
- 10µF Capacitor (Polarized)
- Push Button
Celsius Scale Thermometer Circuit Design
Designing the circuit mostly involves designing the microcontroller circuit, interfacing the ADC, LM35 and LCD to the microcontroller AT89C51.
Microcontroller Circuit Design
Oscillator Circuit: To maintain stability, the oscillator circuit includes a crystal oscillator with an oscillation frequency of 11.0592 MHz and two ceramic capacitors, each of 33pF.
Reset Circuit: A push button, a 10K resistor, and a 10F electrolytic capacitor are used in the reset circuit to achieve a reset pulse width of 100ms and a reset voltage of 1.2V.
EA Pin: Because we aren’t using any external memory, we use a 10K resistor to pull EA Pin high.
Interfacing ADC and LM35
The input part of the circuit is made up of the LM35 Temperature Sensor IC and the ADC0804 ADC IC. The LM35 has three pins: GND, VOUT, and VS. The VOUT of the LM35 is linked to the ADC0804 IC’s Analog In Pin VIN (+). (Pin 6).
The ADC0804’s pin 20 (VCC) is connected to the +5V supply. GND is linked to ADC0804 pins 1, 2, 7, 8, and 10 (CS’, RD’, VIN (-), AGND, and GND). Between the clock pins CLKR and CLKIN (Pins 19 and 4) of the ADC0804, a 10K resistor is attached. Between CLKIN (Pin 4) and GND is a 150pF Ceramic Capacitor. Pins 3 and 5, also known as WR’ and INTR’, are linked.
The ADC0804’s eight data out ports DB0 – DB7 (Pins 11 to 18) are connected to the 8051 Microcontroller’s PORT2 pins.
Interfacing LCD
The RS, RW and EN pins are connected to port pins P3.6, GND and P3.7 respectively. The data pins are connected to PORT1 of the microcontroller.
Working of Celsius Scale Thermometer Circuit
The ambient temperature is measured via an LM35 temperature sensor, which produces a 10mV per degree Celsius output voltage that is proportionate to the temperature. The Analog to Digital Converter (ADC0804), an 8-bit ADC that works on the idea of successive approximation conversion, receives this analogue voltage.
The Analog to Digital Converter ADC0804 is set up to continually scan analogue input signals while also producing digital output at its Digital Out Pins. The INTR’ pin and the WR’ pin must be connected in order for the ADC0804 to constantly read the Analog Input data. The CS’ and RD’ pins must also be pulled low to keep the digital data available at the ADC0804’s Digital Out pins.
The Analog to Digital Converter, continuously takes the analog signal from LM35 and converts it in to digital values. The digital output of the ADC0804 is in the form of 8 – bit binary data and these are also continuously available.
8051 Microcontroller takes this digital data and performs a simple mathematical calculation. This calculation will convert the received digital data from the ADC0804 to Temperature in Degree Celsius
Now, the microcontroller will send this data to the LCD and display it. Since the ADC is continuously reading the Analog Data from the LM35 Temperature Sensor and sending it to the Microcontroller through the Digital Pins, the temperature will be updated at all times and the same is displayed on the LCD.
Algorithm Steps to Write Circuit code for Celsius Scale Thermometer
- Read the data from ADC0804.
- A small calculation is performed on this received data.
- Initialize the LCD by sending proper commands.
- Send data to the LCD containing the temperature reading
Applications of Celsius Scale Thermometer Circuit
- It can be used at mobile places like cars to keep a track of the temperature.
- It can be used to control the switching of loads like motors, heaters based upon the temperature.
- It can also be used at homes to get the temperature reading.
Limitations of the Circuit
- It requires additional analog to digital conversion.
- This circuit can only measure values in Celsius.