Working of Digital Temperature Controller Circuit

A Digital temperature controller circuit is a precise temperature controller in medical, industrial and home applications. This system is better than analogue/thermostat system, which has poor accuracy. For example, it can use for temperature control of an incubator where maintaining a precise temperature is very important.

Digital Temperature Control System
Digital Temperature Control System

Digital Temperature Controller Block Diagram Description

This proposed Digital temperature controller system provides the temperature information on a display and, when the temperature exceeds the set point, then the load (i.e. Heater) switches OFF. In this project, a lamp is provided as a load for demonstration purpose. The Block Diagram of Digital Temperature Control System is given below.

Block Diagram of Digital Temperature Controller
Block Diagram of Digital Temperature Controller

The proposed Digital temperature controller system uses a Microcontroller of 8051 family, which is the heart of the application. The display unit consists of four- seven segment display, Temperature sensor and are interfaced to the Microcontroller.

The digital temperature sensor interfaced to the Microcontroller for sensing the temperature conditions. This system also provides four push button switches for adjusting the temperature settings.

Then the Microcontroller continuously polls the temperature information through a digital temperature sensor and displays over the 7 segment display unit and automatically switches OFF the lamp, when the corresponding temperature exceeds the set point.

Hardware Requirements

  • Transformer (230 – 12 v ac)
  • Voltage regulator (LM 7805)
  • Rectifier
  • Filter
  • Microcontroller (at89s52/at89c51)
  • DS1621 Temperature sensor
  • Push buttons
  • 7 segment display
  • BC547
  • Resistors
  • Capacitors
  • 1N4007
  • Relay

Microcontroller (AT89S52)

The Atmel AT89S52 is an 8051 based powerful Microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.

The AT89S52 provides the following standard features:

  • 8K bytes of Flash
  • 256 bytes of RAM
  • 32 I/O lines
  • Watchdog timer
  • Two data pointers
  • Three 16-bit timer/counters
  • A six-vector two-level interrupt architecture
  • A full duplex serial port
  • On-chip oscillator, and clock circuitry

The pin diagram is given below.

8051 Microcontroller
8051 Microcontroller

Temperature Sensor- DS1621

A sensor is a device which receives and responds to a signal or stimulus. A sensor can convert the received signal into electrical form only.

The Temperature Sensor- DS 1621 provides the following standard features:

  • Measurements require no external components
  • Measures temperatures from -55°C to +125°C in 0.5°C increments (67°F to 257°F in 0.9°F increments)
  • Temperature is read as a 9-bit value (2-byte transfer)
  • Wide power supply range (2.7V to 5.5V)
  • Converts temperature to digital word in less than 1 second
  • Thermostatic settings are user definable and Nonvolatile
  • Data is read from/written via a 2-wire serial interface (open drain I/O lines)
  • Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermal sensitive system
  • It is an 8-pin DIP or SO package

Pin Description

DS1621 Pin Description
DS1621 Pin Description
  • SDA – 2-Wire Serial Data Input/ Output
  • SCL – 2-Wire Serial Clock
  • GND – Ground
  • TOUT – Thermostat Output Signal
  • A0 – Chip Address Input
  • A1 – Chip Address Input
  • A2 – Chip Address Input
  • VDD – Power Supply Voltage

A functional diagram of the DS1621 is shown in the below figure.

DS1621 Functional Block Diagram
DS1621 Functional Block Diagram

The DS1621 provides 9-bit temperature readings, which indicate the temperature of the device. The thermostat output signal (TOUT) is active when the temperature of the device exceeds a user defined temperature (TH).

The output remains active until the temperature drops below a user defined temperature TL, allowing for any hysteresis necessary. User defined temperature settings are stored in nonvolatile memory so parts may be programmed prior to insertion in a system.

The temperature settings and temperature readings are all communicated to/from the DS1621 from the Microcontroller over a simple 2-wire (I2C) serial interface.

Measuring Temperature

The DS1621 measures the temperature using a band gap based temperature sensor. A delta-sigma analogue to digital converter (ADC) converts the measured temperature into a digital value that is calibrated in °C or °F.

The temperature reading is provided in a 9-bit, two’s complement reading by issuing the READ TEMPERATURE command. The data is transmitted through the 2-wire serial interface- MSB first (I2C Serial Communication interface).

Basic Seven Segment Display

This version is a common anode version. That means that the positive leg of each LED is connected to a common point which is pin 3, Vcc in this case. Each Light Emitting Diode has a negative leg that is connected to one of the pins of the device.

7-Segment LED Display
7-Segment LED Display

To make it work you need to connect pin 3 to 5 volts. Then to make each segment light up, connect the ground pin for that led to ground through a resistor. It can also be used through any Microcontroller port pin in sinking mode for ex. PORT 0 in 8051 series Microcontroller.


We used the ‘C’ language to write the application code and compiled using KEIL micro vision (IDE) compiler. After the completion of the software writing, that code will be converted to hexadecimal code in order to drive the Microcontroller. The generated hex code is burnt into the Microcontroller using a suitable programmer.

Schematic Diagram Connections Of Digital Temperature Controller

The power supply of 5v is required to operate the system, connected to the 40 pin of Microcontroller & GND is connected to its 20pin. Pin 1.0 to 1.3 of port 1 is connected to the push buttons. Pins 3.5 to 3.7 of the Microcontroller are connected to 1, 2, 3 pins of temp sensor DS1621 respectively.

Digital Temperature Controller Schematic Diagram
Digital Temperature Controller Schematic Diagram

Pin 0.0 to 0.6 of port 0 of Microcontroller is connected to 7 segment display. Pin 2.0 to 2.3 of port 2 of Microcontroller are connected to transistors BC547 of Port 2 of Microcontroller is connected to transistor’s BC547. Pin 2.4 is connected to another transistor BC547 which drives the relay.


The project uses a digital temperature sensor DS1621 which is interfaced to the Microcontroller. The surface of this 8 pin IC senses the ambient temperature to deliver digital data serially at pin no 1, which is displayed from the Microcontroller by 4 units of 7-segment common anode display all parallel connected to port ‘0’.

Four push button switches are being interfaced to Microcontroller with pull-up resistors to help to program the set temperature as desired. The output from Microcontroller at pin 25 drives a transistor which in turn drives a relay which switches ON or OFF the heater for maintaining the temperature.

The project, however, uses a lamp in place of the heater for demonstration purposes. The lamp will be normally ON to get switched OFF once the set temperature is reached.

Applications of Digital Temperature Controller

The following are some examples of applications for which particular attention must be given.

  • Outdoor use uses involving potential chemical contamination or electrical interference
  • Nuclear energy control systems, combustion systems, railroad systems, aviation systems
  • Medical equipment, amusement machines, vehicles, safety equipment, and installations subject to separate industry or government regulations
  • Systems, machines, and equipment that could present a risk to life or property

Thus, this is all about Digital temperature controller using a microcontroller. We hope that you have got a better understanding of this concept.

Furthermore any queries regarding this concept or microcontroller based projects, please give your feedback by commenting in the comment section below. Here is a question for you, what is the function of 7-segment display?

Add Comment