Multi-point temperature measurement system based on DS18B20

Publisher:muhaoying2017Latest update time:2016-10-29 Source: elecfansKeywords:DS18B20 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Temperature Sensor DS18B20 Introduction
  DALLAS's single-wire digital temperature sensor DS18B20 is a new "one-wire device" with the characteristics of small size and wide applicable voltage. The unique and economical characteristics of the one-wire bus allow users to easily build a sensor network and introduce a new concept for the construction of the measurement system. DS18B20 supports the "one-wire bus" interface, and the measurement temperature range is -55℃~+125℃. In the range of -10℃~+85℃, the accuracy is ±0.5℃; 9-12-bit digital value reading mode can be realized through programming; the temperature value can be converted into 9-bit and 12-bit digital quantities within 93.75ms and 750ms respectively. Each DS18B20 has a unique 64-bit long serial number, which is stored in the DS18B20 internal ROM read-only memory.
  The internal memory of the DS18B20 temperature sensor includes 1 high-speed temporary RAM and 1 non-volatile electrically erasable E2RAM, the latter of which stores high temperature and low temperature triggers TH, TL and structure registers. The temporary memory contains 8 consecutive bytes. The first 2 bytes are the measured temperature information. The first byte is the lower 8 bits of the temperature, and the second byte is the upper 8 bits of the temperature. In the upper 8 bits, the first 4 bits represent the positive (all "0") and negative (all "1") temperature; the third and fourth bytes are volatile copies of TH and TL; the fifth byte is a volatile copy of the structure register, and the contents of these three bytes are refreshed at each power-on reset; the sixth, seventh, and eighth bytes are used for internal calculations; the ninth byte is a redundant check byte. Therefore, the content in the temperature information byte can be converted into the corresponding temperature value accordingly. Table 1 lists the corresponding relationship between temperature and temperature bytes.
  The system is divided into two parts: on-site temperature data acquisition and upper monitoring PC. Figure 1 is a structural diagram of the system. It should be pointed out that the lower computer can work independently without the upper PC. The purpose of adding an upper computer is to enable monitoring and management away from the site more conveniently. The on-site temperature acquisition part uses an 8051 single-chip microcomputer as the central processor, and 10 DS18B20 sensors are connected to the P1.0 port to detect the temperature of 10 points. The non-volatile RAM is used as a buffer for system temperature acquisition and operating parameters. The upper PC communicates with the on-site single-chip microprocessor through the RS485 communication interface to comprehensively manage and control the system, and can complete data recording, printing reports and other tasks.
2.1 Interface circuit between DS18B20 and microcontroller
  The connection between DS18B20 and 8051 microcontroller is very simple. You only need to connect the DS18B20 signal line to one I/O line of the microcontroller, and one I/O line can connect multiple DS18B20 to achieve single-point or multi-point temperature measurement. DS18B20 can be powered in two ways: external power supply and parasitic power supply. The former requires an external power supply, and the positive and negative poles of the power supply are connected to the VDD and GND of DS18B20 respectively. The latter uses a parasitic power supply, connecting the VDD and GND of DS18B20 together. When a high level appears on the bus, the pull-up resistor provides power; when the bus is low, the internal capacitor provides power. Since the use of an external power supply can enhance the anti-interference ability of DS18B20, this design adopts this method. In practical applications, the distance between the sensor and the microcontroller is often tens of meters to hundreds of meters. The parasitic capacitance of the transmission line also has a certain impact on the operation of the DS18B20. Therefore, a slight change is often made at the interface to increase the chip's driving ability and reduce the impact of the transmission line capacitance effect to achieve the purpose of long-distance transmission.
2.2 Keyboard and display
  The keyboard can complete the following functions through programming: calibrate the temperature value, display the temperature value of each channel at a fixed time, display the temperature value of a certain channel separately, set the upper and lower limit alarm values ​​for each channel, etc. LED can provide users with intuitive visual information. At the work site, users can determine the current working status of the system and the sampled temperature value information through the display data of the 6-bit LED.
2.3 Alarm circuit
  When the measured temperature value exceeds the preset upper and lower limits, the alarm circuit responds and the buzzer sounds to inform the user of the temperature abnormality. Which sensor temperature value exceeds the limit can be determined by the software querying the internal alarm flag of each DS18B20, and then adjusting the temperature at the site to achieve control of temperature fluctuations.
3.1 Lower computer software
  The lower temperature measurement software of the system is written in MCS51 assembly language, which mainly completes the read and write operations of DS18B20, realizes real-time data collection, and obtains the final temperature value and sends it to the microcontroller memory. However, it should be noted that due to the single bus mode of DS18B20, the reading and writing of data occupy the same line, so each operation must be performed strictly according to the timing. Figure 2 is a flow chart of the temperature measurement subsystem. The microcontroller first sends a reset pulse, which resets all DS18B20 chips on the signal line, and then sends a ROM operation command to activate the DS18B20 with matching serial number encoding. After being activated, the DS18B20 enters the state of receiving memory access commands, and the memory access commands complete temperature conversion, reading and other tasks (the single bus storage command and control command do not work before the ROM command is sent).
3.2 Upper computer software
  The upper computer software of the system is written in VC++6.0. The main functions include: real-time communication with the lower single-chip microcomputer; simulation and display of the temperature curve of each acquisition point; saving the temperature data of each temperature measurement point; statistics of the average temperature value of each acquisition point; printing of temperature statistics reports of each point, etc.

 
  This system has the following characteristics:
  a. Simple structure, low cost and easy maintenance.
  b. Directly encode the temperature data, and use only a single cable to transmit the temperature data, which is convenient for communication, long transmission distance and strong anti-interference.
  c. Flexible, convenient and easy to expand. It can expand multiple lower-level temperature acquisition subsystems, network them with the upper-level PC through RS485 to form a multi-point temperature acquisition network. It can also selectively increase or decrease temperature sensors in each subsystem.
  d. Stable operation and high temperature measurement accuracy. Experiments show that when 24 DS18B20 temperature sensors are connected to a 200m-long one-bit bus, the system can correctly collect temperature with a resolution of 0.5℃.
  e. Suitable for on-site temperature measurement in harsh environments, such as: environmental control, equipment or process control, temperature measurement consumer electronic products, etc. It has a very attractive application prospect in a large-scale temperature multi-point monitoring system.
Keywords:DS18B20 Reference address:Multi-point temperature measurement system based on DS18B20

Previous article:Digital Real-time Processing of Thermocouple Cold-End Temperature
Next article:GPS OEM board + MCU + LCD display

Recommended ReadingLatest update time:2024-11-16 14:43

ZDS2022 Oscilloscope 100 Practical Videos 76: DS18B20 Protocol Decoding
Hello everyone, DS18B20 is a digital temperature sensor. The digital transmission protocol followed by its interface is the so-called DS18B20 protocol. It is a single bus protocol with strong anti-interference ability and high precision, which is suitable for field temperature measurement in harsh environments. The ZD
[Test Measurement]
Classic digital temperature sensor DS18B20 test
    In the previous lesson, we learned the basic theoretical knowledge of the new digital temperature sensor DS18B20, and had a comprehensive understanding of the characteristics and applications of DS18B20. In this lesson, we will combine the S51 enhanced experimental board and ISP programmer to learn the application
[Microcontroller]
Classic digital temperature sensor DS18B20 test
DS18b20 Single-Wire Digital Temperature Sensor
Digital temperature and humidity sensors are sensors that can convert temperature and humidity physical quantities into digital quantities that can be directly read by computers, PLCs, smart meters and other data acquisition devices through temperature and humidity sensitive components and corresponding cir
[Analog Electronics]
Basic parameters of DALLAS DS18B20
  The single-wire digital temperature sensors DS18B20 and DS1822 produced by DALLAS have an appearance as shown in Figure 5.8. They support the "one-wire bus" interface and have a measurement temperature range of -55°C to +125°C. In the range of -10 to +85°C, the accuracy is ±0.5°C. The accuracy of DS1822 is poor at ±2
[Microcontroller]
#51 MCU #DS18B20 hardware principle and communication working sequence
DS18B20 Hardware Principle - Temperature Memory The temperature measurement range of DS18B20 is -55~+125°C. As shown in the figure above, the DS18B20 temperature memory has two bytes in total. LSB is the low byte, MSB is the high byte. Msb is the high bit, Lsb is the low bit. The S in the figure represents the sign
[Microcontroller]
#51 MCU #DS18B20 hardware principle and communication working sequence
Temperature measurement method using AT89C51 and DS18B20
  Temperature measurement and control are widely used in the use of lasers, fiber gratings, and other industrial and agricultural production and scientific research. The traditional method of temperature detection is to use analog temperature sensors such as thermocouples, thermal resistors, and semiconductor PN junct
[Microcontroller]
Temperature measurement method using AT89C51 and DS18B20
The wireless transmission system of temperature measurement network in warehouse area based on DS18B20 and nRF2401
Introduction The temperature of the warehouse area is directly related to the safety and performance of the inventory materials. At present, the transmission of temperature data in the warehouse area is mostly wired, which has the disadvantages of difficult wiring, high material cost, inconvenient maintenance and re
[Microcontroller]
The wireless transmission system of temperature measurement network in warehouse area based on DS18B20 and nRF2401
DS18B20 Temperature Measurement Experiment Based on 51 Single Chip Microcomputer
Experimental tasks A DS18B20 is used to form a temperature measurement system. The temperature measurement accuracy reaches 0.1 degrees. The temperature range is between -20 degrees and +50 degrees, and it is displayed with a 4-digit digital tube. DPY-1 experimental board connection Use a flat cable t
[Microcontroller]
DS18B20 Temperature Measurement Experiment Based on 51 Single Chip Microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号