Design of a new multi-point temperature measurement system (multi-point temperature measurement system based on DS18B20)
This paper introduces the basic characteristics of DS18B20 and the multi-point temperature measurement system designed based on DS18B20. The system hardware connection and software flow are given.
Keywords: temperature sensor; DS18B20; temperature measurement system
DALLAS single-wire digital temperature sensor DS18B20 is a new "one-wire device" with 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 internal ROM read-only memory of the DS18B20.
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 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 capability 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 on-site temperature to achieve control of temperature fluctuations.
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.
?
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.
Previous article:Study on a new method for measuring micro-water based on electromagnetic resonance technology
Next article:Detailed explanation of circuit board selection, soldering and debugging techniques
- Popular Resources
- Popular amplifiers
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- 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
- Low frequency square wave frequency, duty cycle, peak-to-peak measurement function of msp430G2553
- High EMC Immunity RS-485 Interface Reference Design for Absolute Encoders
- PWM control and driver usage guide and application circuits - SPWM, PFC and IGBT control and driver section
- Buying myoelectric armband
- ESAM external certification for CPU card design
- Test the high and low local oscillator of DVB-S2 sensitivity
- Learn about MPS isolation solutions and answer questions to win prizes!
- [IoT Harmful Gas Detection Smart Device] Material Unpacking
- EEWORLD University Hall----Analog Integrated Circuit Design (Li Zhangquan, Shanghai Jiaotong University)
- Application of high-torque micro-displacement platform based on piezoelectric stack in performance testing of power amplifier