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. The AT89C51 microcontroller is selected as the main control device, and the 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 by 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 microcontroller, which is convenient for microcontroller 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 Scheme
According to the system functional requirements, the system principle structure block diagram shown in Figure 1 is constructed.
2.1 Selection of microcontroller
AT89C51 is the core device of the temperature test system design. This device is the basic product of the MCS-51 series of microcontrollers produced by INTEL. It adopts reliable CMOS process manufacturing technology and has high-performance 8-bit microcontrollers. It 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 characteristics of CHMOS, but also inherits and expands the architecture and instruction system of MCS-48 microcontrollers.
2.2 Connection between temperature sensor and microcontroller
The single bus (1-Wire) of the temperature sensor is connected to P2.0 of the microcontroller. P2.0 is the high-order address line A8 of the microcontroller. The P2 port is an 8-bit bidirectional I/O with an internal pull-up resistor. 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. At this time, it can be used as an input port. This is because there is an internal pull-up resistor. When a pin is pulled low by an external signal, a current will be output. When accessing external program memory or external data memory with 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 8-bit address, the MOVX RI instruction can be executed. 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 DS18820. Figure 3 shows the interface circuit between DS18820 and the microcontroller.
2.3 Reset signal and external reset
circuit The P1.6 port of the microcontroller is the input end of the dog feeding signal in the MAX813 watchdog circuit, that is, the microcontroller sets a dog feeding signal every time it executes a program to clear 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 validity 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 duration should exceed 2μs to complete the reset operation.
2.4 Microcontroller 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 during design. The power supply uses the three-terminal integrated voltage regulator LM7805. It has only three pins: input, output and common. It has overcurrent protection, overheat protection and regulator 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 the power supply circuit connection diagram.
2.6 Display circuit The
mature 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 microcontroller. 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 starts 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 the shift pulse is allowed to be output from the TXD terminal. Figure 5 is the connection diagram of the display circuit.
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 test
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
This temperature test 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 accurate temperature measurement is required.
Previous article:Hardware Design of Hybrid Suspension Control System Based on DSP
Next article:Design of digital thermometer based on AT89C51&DS18820
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 2022 Digi-Key Innovation Design Competition + ESP32-S2-KALUGA1 Unboxing
- Defensive C Programming in Embedded Development
- MSP CapTIvate MCU Development Kit Evaluation Model
- Please tell me, what is the difference between NB-IOT module and NB-IOT chip, what additional features and functions does the former have over the latter?
- 【Home treasure】 esp32s2 freertos communication between tasks Event Groups
- View Circuit-ADC and System (2)
- Hi3559A Flying Camera Solution
- I would like some advice on troubleshooting the mnemonic reading device in the analog circuits book?
- A brief explanation of FPGA static timing analysis
- [TI star products limited time sale] + Buy, buy, buy!