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.
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]
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.
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]
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.
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.
Part of the program code for reading DS18B20 data is:
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.
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
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- 74LS160 digital circuit digital electronic clock circuit design
- 【Showing goods】The first wave
- What is the Q value of a filter?
- If you had to give up your 750,000 yuan annual salary at Tencent or return to your hometown to become a civil servant, what would you choose?
- EEWORLD University Hall----Live Replay: TI AMIC110 Multi-protocol Communication Chip Industrial Application Optimization Solution
- 【Gravity:AS7341 Evaluation】+ Frequency Value Detection
- The homemade sensor test board (bone vibration) is finished and ready for production
- RK3288 baseboard + core board design process
- CCS import routine
- Help designing power adapter