Multi-point temperature measurement system composed of DS18820

Publisher:火箭少年Latest update time:2012-04-17 Source: 单片机及嵌入式系统应用 Keywords:DS18820 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction
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.

Keywords:DS18820 Reference address:Multi-point temperature measurement system composed of DS18820

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

Latest Test Measurement Articles
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号