In the design of traditional temperature measurement systems, analog technology is often used for design, which inevitably encounters problems such as lead error compensation, switching error in multi-point measurement, and error in signal conditioning circuits; and improper handling of any link may cause the performance of the entire system to decline. With the rapid development of modern science and technology, especially the development of large-scale integrated circuit design technology, miniaturization, integration, and digitization are becoming an important direction for the development of sensors. The digital temperature sensor DS18820 launched by Dallas Semiconductor in the United States has a unique single bus interface and only needs to occupy a general I/O port to complete communication with the microprocessor; it has an accuracy of ±0.5℃ within a temperature range of -10 to +85℃; the user can program a resolution of 9 to 12 bits. The above characteristics make DS18820 very suitable for building high-precision, multi-point temperature measurement systems.
1 Introduction to DS18820
1.1 Features of DS18820
DS18820 is an improved intelligent digital temperature sensor newly launched by Dallas Semiconductor Company in the United States after DS1820. Compared with traditional thermistors, it can directly read the measured temperature, and can realize 9-12-bit digital value reading mode through programming according to actual requirements; it can complete 9-bit and 12-bit digital quantities within 93.75ms and 750ms respectively; it only needs one line (single-line interface) to read information from DS18820 or write information to DS18820; the temperature conversion power comes from the data bus, and the bus itself can also supply power to the connected DS18820 without additional power supply. Using DS18820 can make the system structure simpler and more reliable. DS18820 has made great improvements over DS1820 in terms of temperature measurement accuracy, conversion time, transmission distance, resolution, etc.
1.2 Internal Structure and Working Principle
of DS18820 The internal structure of DS18820 is shown in Figure 1, which mainly includes parasitic power supply circuit, 64-bit read-only memory (ROM) and single-wire interface, memory and control logic, high-speed temporary storage memory for storing intermediate data, temperature sensor, alarm upper limit register TH, alarm lower limit register TL, configuration register and 8-bit CRC (cyclic redundancy check code) generator.
The core of DS18820 is its digital temperature sensor, whose accuracy can be configured to 9, 10, 11 and 12 bits through user programming, which correspond to 0.5℃, 0.25℃, 0.125℃ and 0.0625℃ respectively, and can meet various resolution requirements. When starting a temperature conversion, the microprocessor needs to send a Convert T instruction to DS18820. After the conversion is completed, the temperature data is stored in the temperature register of the high-speed temporary memory, occupying 2 bytes, and DS18820 returns to the idle state. When DS18820 uses external power supply, the host can initiate a read time slot after sending the temperature conversion instruction. If the DS18820 has completed the temperature conversion at this time, it will return "1", otherwise it will return "0".
2 Temperature measurement system design
The block diagram of the high-precision, multi-point temperature measurement system composed of DS18820, PIC18F8620 and related peripheral circuits launched by Microchip Company of the United States is shown in Figure 2. The system uses 6 DS18820 chips to form a small temperature sensor network, which is connected to the general I/O port RB0 of the microprocessor through a single-line connection. The resolution of DS18820 is 11-bit mode, that is, 0.125℃. The microprocessor communicates with the temperature sensor network through a single-line communication. After the microprocessor obtains the temperature information, it transmits the processed temperature information to the host computer through the USB port or RS485 interface through a specific algorithm. [page]
2.1 Automatic search algorithm of DS18820
Since multiple DS18B20s are used in the system to form a temperature sensor network, how to accurately and effectively address each temperature sensor becomes a core issue in the design of the system. Combining the actual characteristics of DS18820 and the needs of the system, the following solution is proposed: First, the internal alarm upper limit register of DS18820 (as shown in Figure 1, hereinafter referred to as "TH register") is used to store the number of the temperature sensor, and its number is pasted on the surface of the temperature sensor. Since the TH register has the function of not losing data when power is off, the unique 64-bit registration code of each DS18820 and its number are matched one by one. This process requires separate programming of DS18820. Then, the temperature sensor with the determined number is connected to the single-line network, and the registration code of each DS18820 can be searched by using the unique single-line network automatic search function of DS18820. Then, the corresponding setting number can be read from the TH register of each DS18820 by using the registration code and the corresponding ROM operation instruction, so as to realize the addressing function of each DS18820. The following focuses on the automatic search function.
Each DS18820 has a unique 64-bit registration code stored in the read-only memory (ROM), and its structure is as follows:
The lower 8 bits are the factory code of the product (DS1882 (1 is 28H), followed by the unique serial number of each device, a total of 48 bits, and the highest 8 bits are the cyclic redundancy check code of the first 56 bits. This allows the bus host to address a specific DS18820 on the bus. Only the DS18820 that strictly matches the 64-bit registration code can respond to subsequent operations. All DS18820s that do not match the 64-bit registration code will wait for the reset pulse.
The search algorithm first resets all DS18820s on the single-wire bus through the reset and online response pulse time slots. After successfully executing the operation, a 1-byte search command is sent to all DS18820s connected to the single bus. 8820 is ready to start the search operation. After the search command is issued, the actual search process begins.
First, all DS18820s on the bus simultaneously send the first bit of the registration code (the least significant bit, see the above 64-bit registration code structure inside the DS18820). According to the characteristics of the single bus, when all DS18820s respond to the host at the same time, the result is equivalent to the logical "and" of all the data bits sent. After the DS18820 sends the first bit of its registration code, the host starts the next bit operation, and then the DS181320 sends the complement of the first bit of data. Several judgments can be made on the first bit of the registration code from the data bits read twice, as listed in Table 1.
Then, the host sends back a specified bit to all devices on the bus. If the value of the current bit of the registration code of the DS18820 matches the data bit, it continues to participate in the search process; if the current bit of the DS18820 does not match it, the device switches to the waiting state and remains in the waiting state until the next reset signal arrives. The search for the remaining 63-bit registration code is still repeated in this mode of reading 2 bits and writing 1 bit. According to this search algorithm, all DS18820s except the only DS18820 will enter the waiting state. After the last round of detection, the registration code of the last DS18820 that has not entered the waiting state can be obtained. In the subsequent search process, different paths or branches are selected to find the registration codes of other devices, and the registration codes of all devices can be identified.
2.2 Software system design
The system software is written in C language. In the interrupt service program, user input and interface functions with the host computer are realized; in the main program, automatic search, number sorting, and temperature information acquisition of the temperature sensor network are realized, and the corresponding alarm function is realized according to the pre-set upper and lower limits of the temperature. In this system, the resolution of DS18820 can be set by programming according to different resolution requirements. The highest resolution is 12 bits, that is, 0.0625℃, which can meet the high-precision design requirements. At the same time, because the automatic search algorithm of the sensor network is used in the design, when the temperature sensor in the network is adjusted (such as replacement, addition, deletion, etc.), the system has strong adaptive ability.
3 Conclusion
In traditional temperature measurement systems, analog temperature sensors are often used for design, which must be converted by A/D before they can be recognized and processed by the microprocessor. This design method not only puts higher requirements on the front-end analog signal processing circuit, but also does not have digital communication and network functions. This paper combines the new features of DSl8820 and the new requirements of modern temperature measurement systems, and proposes a high-precision, multi-point temperature measurement system design based on the intelligent digital temperature sensor DSl8820. This solution has the characteristics of easy installation, high degree of digitization, high accuracy, strong adaptability, etc., and has broad application prospects in various temperature detection.
Previous article:Research on LED light source system for thick and dense PCB circuit inspection
Next article:Design and implementation of an automatic test system based on an avionics device
- Popular Resources
- Popular amplifiers
- Dual Radar: A Dual 4D Radar Multimodal Dataset for Autonomous Driving
- A review of learning-based camera and lidar simulation methods for autonomous driving systems
- Multi-port and shared memory architecture for high-performance ADAS SoCs
- Multimodal perception parameterized decision making for autonomous driving
- 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!
- 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
- EEWORLD University - How to use independent measurement ADC to design high-precision CT phase meter
- A collection of selected PCB design resources, free points download for a limited time
- MCU model confirmation and decryption
- [Zero-knowledge ESP8266 tutorial] Quick start 25 Blynk control RGB LED
- Need a 10uh inductor, ESR < 0.2Ω, saturation current > 0.8A
- Ti DSP optimization basic strategy
- Bluetooth Protocol Stack-01
- Thanks to shihuntaotie netizen for donating a large number of development boards!
- Scattered Noise Figure
- [Mil MYC-JX8MPQ Review] Running TDengine