Design of digital thermometer based on AT89C51&DS18820

Publisher:hxcp18Latest update time:2011-05-17 Keywords:AT89C51  DSl8820 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the rapid development of modern information technology and the gradual realization of traditional industrial transformation, temperature detection and display systems that can work independently are applied in many fields. Traditional temperature detection uses thermistors as temperature sensitive elements. Thermistors have low cost, but require subsequent signal processing circuits, and their reliability is relatively poor, the temperature measurement accuracy is low, and the detection system also has certain errors. Compared with traditional thermometers, the digital thermometer designed here has the characteristics of convenient reading, wide temperature measurement range, accurate temperature measurement, digital display, and wide application range. AT89C51 single-chip microcomputer is selected as the main control device, and DSl8820 is used as the temperature sensor to transmit data through the 4-bit common anode LED digital tube serial port to realize temperature display. The measured temperature value is directly read through DSl8820 for data conversion. The physical and chemical properties of the device are stable, the linearity is good, and the maximum linear deviation is less than 0.1℃ at 0℃~100℃. The device can directly transmit digital signals to the single-chip microcomputer, which is convenient for single-chip microcomputer processing and control. In addition, the thermometer can also directly use the temperature measuring device to measure the temperature, thereby simplifying the data transmission and processing process.

2 System Hardware Design

According to the system functional requirements, the system principle structure block diagram shown in Figure 1 is constructed.

Design of digital thermometer based on AT89C51&DS18820

2.1 Selection of MCU

AT89C51 is the core device of the temperature test system design. This device is the basic product of the MCS-51 series of single-chip microcomputers produced by INTEL. It adopts reliable CMOS process manufacturing technology, has high-performance 8-bit single-chip microcomputers, and belongs to the standard MCS-51 CMOS product. It not only combines the high-speed and high-density technology of HMOS and the low-power consumption characteristics of CHMOS, but also inherits and expands the architecture and instruction system of the MCS-48 single-chip microcomputer.

2.2 Connection between temperature sensor and microcontroller

The temperature sensor's single bus (1-Wire) is connected to the microcontroller's P2.0, which is the microcontroller's high-order address line A8. The P2 port is an 8-bit bidirectional I/O with an internal pull-up resistor, and its output buffer stage can drive (absorb or output current) 4 TTL logic gate circuits. Writing "1" to this port can pull its port to a high level through the internal pull-up resistor, and it can be used as an input port at this time. This is because there is an internal pull-up resistor, and a current will be output when a pin is pulled low by an external signal. When accessing the external program memory or the external data memory with a 16-bit address. If the MOVX DPTR instruction is executed, it means that the P2 port sends out the high 8-bit address data. When accessing the external data memory with an 8-bit address, the MOVX RI instruction can be executed, and the content of the P2 port is the content of the R2 register in the special function register (SFR) area, which does not change during the entire access period. During Flash programming and program verification, the P2 port also receives high-order addresses and other control signals. Figure 2 shows the internal structure of the DS18820. Figure 3 shows the interface circuit between DS18820 and MCU. [page]

Design of digital thermometer based on AT89C51&DS18820

2.3 Reset signal and external reset circuit

The P1.6 port of the microcontroller is the input terminal of the dog feeding signal in the MAX813 watchdog circuit, that is, the microcontroller sets the dog feeding signal once every time it executes a program, and clears the watchdog device. If the program is abnormal, the microcontroller pin RST will appear high for more than two machine cycles to reset it. The reset signal is valid at a high level, and its effective time should last for 24 oscillation pulse cycles, that is, more than two machine cycles. If a crystal oscillator with a frequency of 12 MHz is used, the reset signal should last for more than 2μs to complete the reset operation.

2.4 Single chip microcomputer and alarm circuit

The alarm circuit in the system is composed of a light-emitting diode and a current-limiting resistor, and is connected to the P1.2 port of the microcontroller. The function and connection method of the P1 port are the same as those of the P2 port, except that during Flash programming and program verification, P1 receives the lower 8-bit address data.

2.5 Power supply circuit

Since the system requires a stable 5 V power supply, a power supply that can meet the voltage, current and stability requirements must be used in the design. The power supply uses a three-terminal integrated voltage regulator LM7805. It has only three pins: input, output and common. It has overcurrent protection, overheat protection and adjustment tube safety protection circuits. Since it requires few external components, it is easy to use and reliable, so it can be used as a voltage-stabilized power supply. Figure 4 is a power supply circuit connection diagram.

Design of digital thermometer based on AT89C51&DS18820

2.6 Display Circuit

The mature technology 74HCl64 is used to realize serial-to-parallel conversion. LED display is divided into static display and dynamic display. Static display is used here, and the system realizes static display through the serial port of the single-chip microcomputer. The serial port is in mode zero state, that is, it works in shift register mode, and the baud rate is 1/12 of the oscillation frequency. When the device executes any command with SBUF as the destination register, data begins to be sent from the RXD terminal. When the write signal is valid, the send control terminal SEND is valid after one machine cycle, that is, RXD is allowed to send data, and shift pulses are allowed to be output from the TXD terminal. Figure 5 is the connection diagram of the display circuit. [page]

分页 分页

Design of digital thermometer based on AT89C51&DS18820

2.7 Watchdog Circuit

In the system, P1.6 is used as the "feeding" signal of the watchdog; the RESET of MAX813 is connected to the reset signal RST of the microcontroller. Since the microcontroller will give the watchdog device a reset signal every time it executes a program, it can also be reset manually. When the button is pressed, SW-SPST will generate a low level of more than 200 ms at the MAX813 pin. In fact, the watchdog device is not reset within 1.6 s, so the function of outputting a reset signal on pin 7 is the same. The connection diagram is shown in Figure 6.

Design of digital thermometer based on AT89C51&DS18820

3 Software Design

The main data elements of DS18820 are: 64-bit laser ROM, temperature sensitive elements and non-volatile temperature alarm triggers TH and TL. DSBl820 can obtain power from a single bus. When the signal line is at a high level, the energy is stored in the internal capacitor; when the single signal line is at a low level, the power supply is disconnected until the signal line becomes high and the parasitic (capacitive) power supply is reconnected. In addition, an external 5 V power supply can be connected to power the DS18820. The power supply mode of DS18820 is flexible, and the use of an external power supply can also increase the stability and reliability of the system. Figure 7 is a flowchart for reading data.

Design of digital thermometer based on AT89C51&DS18820

Part of the program code for reading DS18B20 data is:

Design of digital thermometer based on AT89C51&DS18820

4 Data Testing

Put the temperature sensor in contact with the ice-water mixture, stir it thoroughly to reach thermal equilibrium, and then adjust the system so that the display reading is 0.00 (calibrated to 0℃); use the barometer to read the local atmospheric pressure at that time, and calculate the actual pressure at that time based on the atmospheric pressure and the local gravity acceleration; find out the boiling point temperature based on the relationship between boiling point and pressure. Put the temperature sensor into boiling water, and readjust it after the display reading stabilizes. The work is completed when the display reading is equal to the local boiling point temperature at that time. The range of the thermometer is 50℃~150℃, and the reading accuracy is 0.1℃. The actual use is generally 0℃~100℃. The precision mercury thermometers of 0℃~50℃ and 50℃~100℃ are used as inspection standards to test the designed thermometer, and the results show that it can meet the accuracy requirements.

5 Conclusion

The temperature testing system not only has the characteristics of simple structure, small size, low price, high accuracy, fast response speed, digital display and not easy to damage, but also has stable performance and a wide range of applications. Therefore, it is particularly suitable for places where more accurate temperature measurement is required.

Keywords:AT89C51  DSl8820 Reference address:Design of digital thermometer based on AT89C51&DS18820

Previous article:Design and implementation of AT89C51ED2 in automobile driving record system
Next article:Intelligent Mine Environment Quality Monitoring System Based on AT89C51

Recommended ReadingLatest update time:2024-11-17 01:31

AT89C51 MCU timer terminal mode and query settings
T1 is timing mode, timing 65.536ms, the LED corresponding to P2.0 flashes once, T0 is counting mode, the counting pulse is input from P3.4 pin with a button, one press, one count, so the initial count value is 0FFFFh, no press, an overflow occurs, the LED corresponding to P2.5 flashes, and the digital tube adds 1 t
[Microcontroller]
AT89C51 MCU timer terminal mode and query settings
A very good serial port program
//PC reads MCU instruction structure: (interrupt mode, ASCII code representation) //Frame: Frame header flag | Frame type | Device address | Start address | Length n | Checksum | Frame end flag // Value: 'n' 'y' | 'r' | 0x01 | x | x | x | 0x13 0x10 //Number of bytes: 2 | 1 | 1 | 1 | 1 | 1 | 2 //Sum: //////////////////
[Microcontroller]
Design of digital thermometer based on AT89C51&DS18820
1 Introduction With the rapid development of modern information technology and the gradual realization of traditional industrial transformation, temperature detection and display systems that can work independently are applied in many fields. Traditional temperature detection uses thermistors as temperat
[Microcontroller]
Design of digital thermometer based on AT89C51&DS18820
A simple intelligent robot based on AT89C51 single chip microcomputer
  1 Design concept and overall plan    1.1 Design ideas of simple intelligent robots   The robot can walk along the guide line in any area, automatically bypass obstacles, and walk along the light source under the guidance of a light source. At the same time, it can detect metal pieces buried underground, emit sou
[Microcontroller]
A simple intelligent robot based on AT89C51 single chip microcomputer
Design and application of a multi-point temperature measurement and temperature control system
With the improvement of living standards, people's demand for home has changed from area demand to comfort demand. Floor heating uses radiation heating, which is in line with the physiological demand curve of the human body. If the control system is properly selected, it can not only improve the comfort of the room,
[Test Measurement]
Design and application of a multi-point temperature measurement and temperature control system
Design of single chip microcomputer voice alarm system
  1 Hardware circuit design (picture)     System working process:     The single-chip microcomputer AT89C51 collects various information of the equipment, which can be pressure, flow, temperature and humidity, voltage, current, etc. according to different equipment and sensors, and then compares it with the
[Microcontroller]
Design of single chip microcomputer voice alarm system
Schematic diagram of music perpetual calendar circuit with wireless remote control function
 This paper proposes a perpetual calendar design based on the AT89C51 single-chip microcomputer. This solution uses the AT89C51 single-chip microcomputer as the core, and forms a hardware system with clock chip DS1302, buttons, LED display and other modules. In the hardware system, there are independent buttons and LED
[Microcontroller]
Schematic diagram of music perpetual calendar circuit with wireless remote control function
Infrared remote control multifunctional electronic clock design scheme
  This solution uses the AT89C51 microcontroller as the core. The software part adopts C language modular design. It has the functions of displaying the year, month, day, hour, minute, second and temperature, as well as alarm clock and hourly time. It can also be used through the infrared remote control common for hom
[Microcontroller]
Infrared remote control multifunctional electronic clock design scheme
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号