Share this

Automatic temperature controller with clock

2026-04-06 03:30:46 · · #1

Abstract: To achieve the temperature detection and control required in real life, this paper designs a temperature controller with clock function based on the AT89C51 microcontroller, presenting the hardware structure framework and software design scheme of the controller. Furthermore, this paper uses the single-bus digital temperature transmitter DSI8B20 for temperature measurement. The circuit features simple structure, high accuracy, and low cost, making it widely applicable in intelligent instruments.

Keywords: Instrumentation; AT89C51; Temperature control; Clock

1. Temperature sensing chip DS18B20 and its applications

1.1 Introduction to the DS18B20 Chip

The DS18B20 is a single-bus digital intelligent integrated temperature sensor launched by Dallas Semiconductor. Compared with other temperature sensors, the DS18B20 has the following characteristics [I-2] :

(1) Unique single-line interface method.

(2) The DS18B20 supports multi-point networking. Multiple DS18B20s can be connected in parallel on a single signal line to achieve multi-point temperature measurement.

(3) The DS18B20 does not require any external components during use.

(4) Temperature measurement range: -55℃ to +125℃, with a fixed temperature measurement resolution of 0.625℃.

(5) Measurement results are transmitted serially in 9-12 bit digital format.

1.2 Typical Interface Design of DS18B20 and Microcontroller

There are two ways to connect the DS18B20 to the microcontroller: one is the external power supply method. Figure 1 shows the connection diagram between the DS18B20 and the microcontroller. The DQ terminal is connected to P2.2. The microcontroller only needs one I/O port line, P2.2, to read or write data to the DS18B20. It communicates with the microcontroller in a serial communication manner. The other is the parasitic power supply method. For the specific connection method, please refer to reference [3] .

1.3 Software Design of DS18820

When communicating with the DS18B20, the 1-Wire bus protocol should be followed. Otherwise, the DS18B20 will not respond. The following three steps are required for the microcontroller to access the DS18B20 [4] .

(1) Initialization

(2) Send ROM command.

(3) Send DS18B20 function command.

2. Implementation of Digital Temperature Clock Controller

2.1 Hardware Implementation of Digital Temperature Clock Controller Figure 1 Connection Diagram of DS18820 and Microcontroller

This system mainly consists of an AT89C51 microcontroller as the main control chip, a DS18B20 temperature detection chip, a keyboard input, and an LCD display. The system block diagram is shown in Figure 2.

The AT89C51 is a low-voltage, high-performance CMOS 8-bit microcontroller manufactured by Atmel Corporation. Its hardware resources are sufficient for implementing this controller, and the entire system can be optimized and upgraded through software updates. In this controller, the microcontroller acquires data from a temperature sensor via port P2.2. After software initialization and data acquisition, the real-time temperature is displayed on an LCD screen. Simultaneously, the main program incorporates an electronic clock function, displayed at the bottom of the screen. If an interrupt occurs, the microcontroller can record the time and temperature and write them to memory.

2.2 Software Implementation of Digital Temperature Clock Controller Figure 3 is a simple system program flowchart.

As shown in Figure 3, after the system is powered on and reset, it first enters the initialization state, where the timer data for the clock and the control bit data for temperature acquisition are initialized. Then, the system starts timing, and the program enters a cyclic scanning and display process. At this time, the LCD displays the real-time temperature and the clock simultaneously.

3. Conclusion

The DS18B20 is a one-wire temperature sensor, requiring only one I/O line to connect to the microcontroller. The three-wire serial interface LCD module displaying temperature and time occupies a maximum of three I/O lines from the microcontroller. Adding the I/O lines needed for the clock adjustment buttons, approximately ten I/O lines are typically required, making the hardware configuration quite simple. From a software perspective, the single-bus chip requires slightly more work and must operate according to strict timing sequences. Furthermore, the software is written in C51, making it easy to port and embed into the instrument's own software, thus providing better software support. The aforementioned temperature clock circuit can be installed as a standalone module in the instrument for displaying temperature and time. However, for instruments that need to extract historical data of certain parameters, this circuit must be integrated into the entire instrument and programmed uniformly.

The proposed design solves common problems in current intelligent instruments and meters, and boasts advantages such as good portability, low cost, simple circuitry, and convenient upgrades. System debugging has shown that the controller operates correctly, demonstrating its excellent stability.

References:

[1] Sha Zhanyou. Development trend of intelligent temperature sensors [J]. Electronic Technology Application, 2002(5): 6-7.

[2]Dallas Semiconductor. DS18B20 Pro-grammable Resolution 1-Wire Digital ThemotrDaahe[J]. 2004.

[3] Yu Yongxue, Ge Jian. DS18B20 digital temperature sensor and its application in 1-Wire bus [J]. Electronic Products World, 2003(24): 80-82.

[4] Zhang Ping. Development of a temperature measuring instrument based on digital thermometer DS18B20 (J). Automation Instrumentation, 2007, 28 (6): 64-66.

For details, please click: Automatic Temperature Controller with Clock

Read next

CATDOLL 138CM Airi(TPE Body with Hard Silicone Head)

Height: 138cm Weight: 26kg Shoulder Width: 30cm Bust/Waist/Hip: 65/61/76cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL 128CM Cici Silicone Doll

CATDOLL 128CM Cici Silicone Doll

Articles
2026-02-22
CATDOLL 130CM Sasha

CATDOLL 130CM Sasha

Articles
2026-02-22
CATDOLL 126CM Mimi

CATDOLL 126CM Mimi

Articles
2026-02-22