Temperature is one of the most basic physical quantities in science and technology. In industrial production, temperature is often one of the most important parameters to characterize the state of objects and processes. In the medical field, body temperature is also the medical parameter we pay most attention to.
With the development of modern science and technology, temperature measurement is increasingly used in various fields, and temperature measurement technology has also attracted great attention. Multifunctional temperature measuring instrument is a typical example, which uses single-chip microcomputer technology to develop in the direction of digitalization and intelligence. Here we introduce a multifunctional temperature measuring instrument, which can measure both ambient temperature and human body temperature, achieve fast response, digital display of temperature value, and has the purpose of high temperature alarm.
1 Hardware Circuit Design
1.1 Temperature sensor
The temperature sensor DS18B20 produced by DALLAS is used as the temperature acquisition device. The internal structure of DS18B20 mainly consists of 64-bit ROM, temperature sensitive element, internal memory and configuration register, as shown in Figure 1.
(1) 64-bit ROM. Its content is a 64-bit serial number, which can be regarded as the address sequence code of the DS18B20. Its function is to make each DS18B20 different, so that multiple DS18B20s can be connected to one bus.
(2) Temperature sensitive element. It measures the temperature and stores the measured results in two 8-bit temperature registers.
(3) Internal memory. The internal memory includes a high-speed temporary storage RAM and a non-volatile electrically erasable E2 PROM, which stores high temperature and low temperature triggers TH, TL and configuration registers.
Figure 1 Internal structure of DS18B20
DS18B20 has the following features:
(1) Unique single-wire interface mode, only one line is needed when connecting to the microcontroller; (2) The temperature measurement range is -55~+125℃, and the accuracy is ±0.5℃ in the range of -10~+85℃; (3) 9~12-bit digital reading mode can be realized through programming; (4) The user can set the non-volatile alarm upper and lower limits; (5) The peripheral circuit is simple and does not require peripheral components when in use. It can be powered by the data bus with a voltage range of 3.0~5.5V and does not require a backup power supply; (6) DS18B20 has TO92, SOIC and CSP packages. The appearance and pin arrangement of DS18B20 selected in this measuring instrument are shown in Figure 2, where VDD is the external power supply input terminal, GND is the common ground, and DQ is the digital signal output terminal.
Figure 2 DS18B20 appearance and pin arrangement [page]
Based on the above characteristics, the use of DS18B2 makes hardware consumption less, system design more flexible and convenient, cheaper and smaller in size.
1.2 Hardware circuit design
The system hardware circuit is shown in Figure 3.
Figure 3 System hardware circuit diagram
It includes four parts: signal acquisition, system control, digital display, and high temperature alarm. The temperature signal collected by the sensor DS18B20 is sent to the P3.2 port of the single-chip microcomputer from the DQ end of the sensor through internal processing. After calculation and processing by the single-chip microcomputer, the P0 port and the P1 port are used as the segment control signal and the bit control signal of the 4-bit common anode digital tube respectively, and the digital display of the measured temperature value is completed together. The highest bit is the sign display. If the negative sign "-" is displayed, it means that the current temperature is negative temperature, otherwise it is positive temperature; the buzzer is controlled by the P2.0 port. When the measured temperature exceeds the "preset alarm temperature", a prompt sound alarm is issued; the P2.1~P2.3 ports control the yellow, green, and red light-emitting diodes to represent the three temperature states of low temperature, normal, and high temperature respectively. The quartz crystal JT and capacitors C2 and C3 together form a crystal oscillator circuit; the capacitor C1, resistor R13 and SB together form a reset circuit; resistor R13 is a pull-down resistor and SB is a manual reset button.
2 Software Design
In order to facilitate the calling of subroutines and the maintenance of the system, the program follows the principles of standardization and modularization, and mainly completes the design of modules including reading DS18B20 temperature data, data sorting and conversion, temperature display, alarm, etc. Since the program tasks are relatively few and the structure is relatively simple, this system consists of a main program and multiple subroutines, and adopts a sequential structure main program flow.
2.1 Key points of software design
Since DS18B20 uses a single-wire bus protocol, that is, bidirectional data transmission on one data line, and the microcontroller hardware does not support the single-bus protocol, a software method must be used to simulate the single-bus protocol sequence to complete the access to the DS18B20 chip.
Since DS18B20 reads and writes data on an I/O line, it has strict timing requirements for the data bits to be read and written. It has a strict communication protocol to ensure the correctness and integrity of each bit of data transmission. The protocol defines the timing of several signals: initialization timing, read timing, and write timing. All timings use the microcontroller as the master device and the DS18B20 as the slave device. Each command and data transmission starts with the host actively starting the write timing. If DS18B20 is required to send back data, the host needs to start the read timing to complete data reception after the write command.
2.2 Software Design
The innovation is to introduce the concept of "video memory" in the temperature display module, and use "video memory" to directly map it to the display subroutine, which is convenient for program transplantation and the future establishment of a multi-point temperature detection network, or embedding in other monitoring systems.
The program snippet is as follows:
[page]
2.3 Main program flow chart
The main program flow is shown in Figure 4.
Figure 4 Main program flow chart
3 Physical operation and testing
Test method: Use a mercury thermometer and a temperature measuring instrument to measure the same air environment, water, and human body at the same time, record each measurement data in detail, and compare the data. The test results are shown in Table 1, and the results show that the error is only ± 0.2 ℃.
Table 1 Physical operation test comparison table
4 Conclusion
The temperature measuring instrument designed and manufactured using the temperature sensor DS18B20 and the single-chip computer 8051 can measure and display the temperature at a relatively low cost. The components used in this measuring instrument are inexpensive and easy to obtain, and have the advantages of simple hardware structure, fast response, and intuitive display. In addition, the single bus structure of the component DS18B20 has strong scalability. It can also form a multi-point temperature detection network. This solution designs a temperature monitoring system with broad application prospects.
Previous article:Design of portable physiological parameter monitor based on C8051F330
Next article:Analysis of FAQs on Analyzer Purchase
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- Problems with STM32F767 driving Bluetooth module
- Infineon Position2Go Development Kit Review @4. Development
- Understand these! The subtle differences between RS-232, RS-422, and RS-485
- MSP430F5529LP's P1.4 port outputs a single PWM wave
- Lead and Lag Oscillators
- EEWORLD University Hall----Live playback: IoT display solution using DLP? micro-projection technology
- Recommended development directory for CH579M
- USB OTG connection method
- Have you been affected by the price increase? Share the best pin-compatible alternative solution under the wave of price increase#, a certain brand?
- Request: DC-DC small package chip similar to LM2596