Temperature monitoring is an important link in industrial production. Especially in industrial sites with harsh and complex environments, temperature monitoring plays an irreplaceable role. However, because the output of the temperature sensor used in many current temperature monitoring systems is a changing analog voltage, it cannot be directly interfaced with the computer acquisition system. It needs to be collected, processed and transformed before it can be sent to the computer-based monitoring system. This makes it inconvenient for multi-point distributed temperature measurement. With the development of computer, communication, network control and other technologies, industrial measurement and control systems have become a very important part of many industrial enterprises. Coupled with the increasing maturity of fieldbus technology and the emergence of digital temperature sensors, fieldbus technology and digital temperature sensors are more used in industrial monitoring systems, making the functions of industrial monitoring systems more powerful and the scope of monitoring wider. At the same time, improving the accuracy of temperature measurement is also one of the important goals.
Therefore, the system designed in this article uses digital temperature sensor DS18B20 and AT89C2051 microcontroller to collect and store temperature data, and transmit it through the RS485 bus. The upper computer performs parameter estimation based on the least squares method of the error regression model for each measured error compensation amount. The mathematical equations of the linear error compensation model are used to compensate for the data measured at normal temperature. Under the measurement range of -55e to +125e and the measurement accuracy of 0.2, the transmission distance can reach 500m, and the improvement of the transmission distance is given according to engineering practice. and key technologies for measurement accuracy.
1.System design
The system consists of PC and AT89C2051 microcontroller system, forming a small distributed measurement and control system. Among them, the task of the single-chip computer system is to complete the collection and storage of industrial site temperature values, and to connect to the PC through the RS485 bus. The main task of the PC is to undertake centralized measurement, control and management. Since the RS485 bus is used for communication, and the PC only has an RS232 interface, it needs to be connected through an RS232/RS485 adapter. The system structure is shown in Figure 1.
Figure 1 System structure diagram
Temperature measurement points composed of the system's microcontrollers can be added. Each microcontroller has its own unique address. The master-slave communication method is adopted during communication. The host computer determines which microcontroller to communicate with. Figure 2 shows the communication interface between DS18B20 and Hardware design circuit. Figure 3 is the data acquisition and sending program flow chart of DS18B20.
Figure 2 Sensor data acquisition circuit
Figure 3 Data collection and transmission flow chart
The upper computer mainly consists of five functional modules: monitoring window, temperature point query (lower computer), temperature report generation, help and exit system. The functional modules are shown in Figure 4.
Figure 4 PC system software module
2. Collection data processing
In the temperature measurement test, the 0.1 grade standard thermometer is used as a reference and is conducted in a normal temperature and pressure environment. The measurement environments adopted are room temperature, body temperature, ice-water mixture, hot water and boiling water.
After obtaining measurement data through actual measurement, calculation, analysis, and processing of the measured data are often important means to improve measurement accuracy. First calculate the average of each set of measurement data. like:
In processing the measurement results, it is necessary to find the best functional relationship between the variables x and y, y = f (x), based on the data. The most commonly used criterion to solve this problem is the least squares principle. For equal-accuracy, independent measurements, the basic principle is that the sum of squares of the deviations of each data point from the fitted straight line is minimum. Assume that the best-fitting straight line equation for this set of experimental data is: y = A+ Bx, where A is the intercept of the straight line and B is its slope.
According to the principle of least squares and the usual method of finding extreme values, removing the partial derivatives with respect to A and B and setting them to 0, we can derive two equations, which have unique solutions for the two unknowns A and B. By solving this system of equations we get:
Calculate the measured data according to equations (1) and (2). For example, the A and B values are 1.078 and 0.97 respectively, and the straight line equation of the straight line fitting is y=1.078+ 0.97x. The distribution of its data points in the straight line fitting graph is shown in Figure 5.
Figure 5 Distribution of measurement data points around the fitted straight line
According to the corrected straight line equation, such as y=1.078+0.97x, linear correction is performed on the measured values of the measuring points, so that the correction table can be obtained. Due to space limitations, only the result data before and after the correction of room temperature are given, as shown in the table 1 shown.
The corrected average temperature is 26.041e, and the average value measured by the reference thermometer is 25.94e. The measurement error of the two is reduced to 0.100e, which is 0.39e smaller than the error before correction.
It can be clearly seen from the correction results that the measurement accuracy has been greatly improved. Using the method introduced above, the author successfully applied it to the urban construction archives management information system of Huai'an City and the automatic temperature and humidity control system of the ammunition depot of the 15th Branch of the Chinese People's Liberation Army, and achieved very good accuracy and control effects.
3. Key technologies for precision control in multi-point long-distance transmission
Although the temperature measurement system composed of DS18B20 sensor has the advantages of simple system structure, high temperature measurement accuracy, convenient connection, and occupying few interface lines, the following issues should also be paid attention to in practical applications:
(1) Small hardware overhead requires relatively complex software to compensate. Since serial data transmission is used between DS18B20 and the microcontroller, when reading and writing programming for DS18B20, the reading and writing timing must be strictly guaranteed, otherwise the test results will not be read. When using high-level languages such as PL/M and C for system programming, it is best to use assembly language for the DS18B20 operating part.
(2) None of the relevant information on DS18B20 mentions the issue of the number of DS18B20s on the bus. In practical applications, if there are more than 8 DS18B20s on the bus, it is necessary to add a microcontroller bus driver.
(3) The bus cable connected to DS18B20 has a length limit. When the transmission length of ordinary signal cable exceeds 50m, errors will occur in the temperature measurement data read. When the bus cable is changed to a shielded twisted pair, the communication distance can reach 500m. Therefore, when designing a long-distance temperature measurement system using DS18B20, multi-strand shielded twisted pair cables should be selected. Experiments have proven that when the distance is greater than 500m and less than 100m, the measurement accuracy can be guaranteed to be at level 0.2.
(4) When the distance exceeds 500m, the transmission rate and anti-interference measures must be fully considered. In actual engineering use, a 120 ohm resistor needs to be connected in parallel at the far end (when the interference is strong, a 120 ohm resistor also needs to be connected in parallel at the near end) in order to absorb interference such as echo. In addition, reducing the signal transmission rate is a very effective measure. In practice, the transmission distance can reach 1000m using 9600 baud rate.
in conclusion
The RS485 bus multi-point distributed temperature measurement system composed of DS18B20 is discussed in detail. The system strictly follows the calibration specifications of measurement products , analyzes and processes multi-point long-distance measurement data, and corrects errors, with an accuracy of 0.2. Experiments have proven that this system design can realize network monitoring of multi-point temperatures in industrial sites, and has the characteristics of low cost, multiple functions, high reliability and high accuracy.
Previous article:Design of power transformer anti-theft system based on stc89c52 microcontroller and gsm module
Next article:Design of intelligent system based on STC89C58RD+ microcontroller and SC1128
Recommended ReadingLatest update time:2024-11-23 12:39
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- Data acquisition system source code
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Application skills/Development of microcomputer digital trigger
- Circuit diagram of motor control development board based on dsPIC30F4011
- Linux-3.14.52 Compiler Reference Manual v2.0
- ESP32 firmware is divided into two versions: ESP-IDF v3.x/4.x
- Jackie Chan and Jet Li co-star in a movie
- How to measure positive and negative 1.5V signals using a single power supply system?
- Complete list of motor model parameters, no longer worried about not understanding the motor model
- TM6820 User Manual.rar
- protel 99se ask
- Car Radio Audio Signal Processors