Sensors - Tranducers Circuits

Celsius Scale Thermometer using AT89C51 and LM35

This project exemplifies the creation, development, and operation of a Celsius-scale thermometer employing an LM35 Temperature Sensor and an AT89C51 Microcontroller. The core of the circuit incorporates the LM35 analog temperature sensor, offering the significant advantage of delivering an output directly proportional to Celsius temperature, eliminating the need for calibration.

Additionally, the project incorporates the 8-bit Analog to Digital Converter (ADC0804), which employs the successive approximation conversion method. The microcontroller is responsible for managing the ADC0804 and processing its output, subsequently presenting the temperature reading on an LCD display. This page provides an in-depth discussion of the microcontroller program, circuit design, and circuit operation.


  • 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 functions based on the concept of analog-to-digital conversion. An analog temperature sensor, specifically the LM35, measures the temperature, and this analog value is converted into a digital signal using an ADC (ADC0804). Subsequently, the digital signal is processed by an AT89C51 microcontroller, which then presents the temperature reading in Celsius on the LCD display (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 ensure stable operation, the oscillator circuit is equipped with an 11.0592 MHz crystal oscillator and two 33pF ceramic capacitors.

Reset Circuit: To achieve a reset pulse width of 100ms and a reset voltage of 1.2V, the reset circuit employs a push button, a 10K resistor, and a 10F electrolytic capacitor.

EA Pin: Given that external memory isn’t utilized, a 10K resistor is employed to pull the EA Pin high.

Interfacing ADC and LM35

The input segment of the circuit comprises the LM35 Temperature Sensor IC and the ADC0804 ADC IC. The LM35 consists of three pins: GND, VOUT, and VS. The VOUT from the LM35 is connected to the ADC0804 IC’s Analog Input Pin VIN (+) at Pin 6.

Pin 20 (VCC) of the ADC0804 is tied to the +5V power supply. The GND pin is linked to various ADC0804 pins: 1, 2, 7, 8, and 10 (CS’, RD’, VIN (-), AGND, and GND). A 10K resistor is positioned between the clock pins CLKR and CLKIN (Pins 19 and 4) of the ADC0804. Additionally, a 150pF Ceramic Capacitor is situated between CLKIN (Pin 4) and GND. Pins 3 and 5, identified as WR’ and INTR’, are interconnected.

The eight data output ports, labeled DB0 – DB7 (Pins 11 to 18) of the ADC0804, are connected to the PORT2 pins of the 8051 Microcontroller.

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 gauged using an LM35 temperature sensor, which generates an output voltage of 10mV per degree Celsius, in direct proportion to the temperature. This analog voltage is then fed into the Analog to Digital Converter (ADC0804), an 8-bit ADC that operates on the principle of successive approximation conversion.

The ADC0804 is configured to continuously scan the analog input signals and concurrently produce digital output through its Digital Out Pins. To enable continuous reading of the Analog Input data, the INTR’ and WR’ pins need to be connected. Additionally, the CS’ and RD’ pins should be held low to maintain the availability of digital data at the ADC0804’s Digital Out pins.

The Analog to Digital Converter continuously takes the analog signal from the LM35 and translates it into digital values. The output from the ADC0804 is in the form of 8-bit binary data, which is continuously accessible.

The 8051 Microcontroller processes this digital data through a straightforward mathematical calculation, converting the received digital information from the ADC0804 into a temperature reading in degrees Celsius.

Subsequently, the microcontroller transmits this data to the LCD for display. Given that the ADC consistently reads the Analog Data from the LM35 Temperature Sensor and transmits it to the Microcontroller through the Digital Pins, the temperature reading remains continually updated and is displayed on the LCD.

Celsius Scale Thermometer

Algorithm Steps to Write Circuit code for Celsius Scale Thermometer

  1. Read the data from ADC0804.
  2. A small calculation is performed on this received data.
  3. Initialize the LCD by sending proper commands.
  4. Send data to the LCD containing the temperature reading

Applications of Celsius Scale Thermometer Circuit

  1. It can be used at mobile places like cars to keep a track of the temperature.
  2. It can be used to control the switching of loads like motors, heaters based upon the temperature.
  3. It can also be used at homes to get the temperature reading.

Limitations of the Circuit

  1. It requires additional analog to digital conversion.
  2. This circuit can only measure values in Celsius.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button