introduction
In many traditional industries, multi-channel high-precision temperature acquisition systems are indispensable. In the production processes of power plants, petrochemical industries, steel plants, pharmaceutical plants and other enterprises, there are common occasions where temperature measurement is required. Special temperature measurement systems composed of microcontrollers and temperature sensors have been widely used due to their advantages of simple structure, reliable operation and low price. When used in power systems, when the control cabinets, cables, capacitors, and switches in the power machine room are overloaded or damaged, huge amounts of heat will be generated. If not detected and dealt with in time, accidents or fires will often occur.
System solutions
The structure of this device (Figure 1) can be roughly divided into: collection part, power supply system, and communication part. The acquisition part is completed by establishing an acquisition network through the main core chip AT89S52 microcontroller and DALLAS' latest single-line digital temperature sensor DS18B20. The temperature measurement range of DS18B20 is -55~+125℃. Multiple DS18B20 can be connected in parallel on the only three wires to achieve multi-point temperature measurement, which can save a lot of leads and logic circuits. DS18B20 is very suitable for long-distance multi-point temperature detection systems. It uploads temperature data in real time through two communication methods. These two communication methods are RS485 communication and RS422 communication. In RS485 communication, ADI's serial RS485 interface chip ADM2483 is used. It is an RS485 chip with dual power supply and completely isolated output and input, which can strengthen the reception and transmission of effective signals and increase the reliability of long-distance communication. RS422 communication implements a full-duplex communication mechanism. Optocoupler isolation is used at the other end to isolate the power supply and signal, which increases the accuracy and anti-interference of information transmission and ensures the integrity of the information.
System hardware design
Acquisition circuit
With the AT89S52 microcontroller as the core, an external watchdog X5045 and an 11.0592MHz crystal oscillator form the smallest microcontroller system. The I/O port of the AT89S52 microcontroller is used to transmit data in both directions. P3.4 is connected to the DS18B20 first-line bus to realize reading of the DS18B20. For fetching and writing operations, add a pull-up resistor to the bus. This resistor can change the resistance value according to the number of DS18B20 added to the network and the length of the collection distance. Use P3.0 and P3.1 special function I/O port definitions as communication transceivers. P2.0 applies the enable control pin of AMD2483. The JTAG standard simulation interface design is applied here, and the program is downloaded to the AT89S52 chip through the JTAG interface. Implement operational functions. The acquisition circuit is shown in Figure 2.
power supply
When running the system, the stability and reliability of the power supply are indispensable. AMS1117-5.0 has current limiting and overheating automatic shutdown protection functions, and its built-in bandgap reference can ensure the error accuracy of the output voltage. A tantalum electrolytic capacitor of at least 10mf needs to be connected to the output end to improve the transient response and stability of the output end. Mainly supplies power to the microcontroller and surrounding circuits. B0505S-W5 is a product of Jinshengyang Company specially designed for applications in distributed power systems on circuit boards that need to generate a set of power supplies isolated from the input power supply. Here, it provides isolated power supply and MAX488 communication for the internally isolated ADM2483. Isolated Power. This makes signal transmission more reliable. The power supply circuit is shown in Figure 3.
communication
Communication is divided into RS485 communication and RS422 communication. The ADM2483 used in RS485 communication is ADI's serial RS485 interface chip. It uses dual power supplies and is an RS485 chip with completely isolated output and input. It can strengthen the reception and transmission of effective signals and increase the reliability of long-distance communication. In conjunction with the 555 timer function, EA_485 is in a low-level receiving state under normal circumstances. When TXD_IN has a signal output, it enables EA_485 to become high-level and sends the data. When this data is sent, EA_485 automatically returns to the low-level receiving state. The time for sending data is determined by R5×C5, which can determine the integrity of data transmission; the RS422 communication host computer inputs commands through the A and B terminals. This is the RS422 receiver port, Y and Z receive commands, and this is the RS422 transmitter port. Optocoupler isolation is used at the other end of RS422 to isolate the power supply and signal, which increases the accuracy and anti-interference of information transmission and ensures the integrity of the information. LED and LED1 respectively indicate information receiving instructions and sending instructions. The information transmission process can be monitored intuitively. The communication circuit is shown in Figure 4.
System software design
In a multi-channel high-precision temperature measurement system, the temperature measurement unit can independently collect data and communicate with the host computer, send measured temperature data to the host computer (host), receive control instructions from the host computer, and transmit data. The instructions for communicating with the host computer use fixed-length CDT code instructions, and have CRC error correction to ensure correct data transmission. The software flow chart is shown in Figure 5.
In multi-point temperature measurement systems, single-bus digital temperature sensors (such as DS18B20) are used more and more widely because of their small size and simple system structure. Each digital temperature sensor has a unique 64-bit serial number (the lowest 8 bits are the product code, the next 48 bits are the device serial number, and the last 8 bits are the first 56 bits of the cyclic redundancy check code). Only by obtaining the serial number Only then can they be operated and identified one by one in a multi-sensor system. Since the lowest 8 digits of the sensor serial number are the product code, the "required bit value" can be given according to the corresponding value. The key is the identification of the subsequent 48-bit device serial number. The sorting idea of "complete binary tree" is adopted here (Figure 6). Specific idea: Suppose a data bit conflict occurs for the first time at the K bit. At this time, all sensors are divided into two categories, namely sensors with a 1 bit and sensors with a 0 bit. The "required bit value" is given to 1, and the sensor whose K bit is 1 is still connected to the bus. If a data bit conflict occurs in the next K+M and K+N bits, the "required bit value" is still given to 1 respectively, and a sequence number is obtained. The next process still gives 1 in the "required bit value" of the K and K+M bits, but gives 0 in the K+N bit to obtain the serial number of another sensor. The third process still gives 1 in the K bit and 0 in the K+M bit, and continues to identify on this branch. After the serial number of the sensor whose K bit is 1 is identified, when returning to the K bit, the "required bit value" is set to 0, and the sensor serial number of the branch is identified in the same way. According to this idea, the serial numbers of multiple sensors only need to be identified once.
After establishing the relationship table and programming, the system can be put into operation. When reading the temperature of each temperature measurement point, you need to use the "match" ROM command. This command requires the serial number in the relationship table to be taken out and sent to the bus. Only sensors with consistent serial numbers are mounted on the bus. , its temperature can be read.
To sum up, using simple hardware and programming methods to automatically establish a relationship table realizes automatic identification of digital temperature sensors in a single-bus multi-point temperature measurement system, which greatly facilitates system debugging and maintenance, reduces maintenance workload, and It solves the inconvenience that maintenance work in the past had to be completed by professionals instead of operating personnel.
Conclusion
This device uses a 51 series microcontroller as the main CPU, which has low cost, good communication reliability, and high real-time performance. The prototype has been trial-produced, passed relevant tests, and put into production. This product has been used in power systems to monitor the temperature of eight points around the battery and upload it to the background. It operates stably and has achieved good social and economic benefits.
Previous article:Design of multi-band spectroradiometer acquisition system based on C8051F020 microcontroller
Next article:Design of intelligent instruments to support laboratory temperature and humidity measurement
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- How to eliminate the voltage drop of the diode?
- Please guide me, what is = for? Why not just use =
- MSP430 DC Motor Control
- A small topic about power supply: How to select a power supply when designing it?
- Entering HardFault_Handler interrupt during MotionFX operation
- The SAMR21 board can also run CircuitPython
- The problem of the correspondence between air pressure and frequency
- I have been engaged in hardware development for nearly half a year, and I feel that I lack knowledge and experience. Are there any books or websites that can quickly improve my skills?
- A strange problem, the result of comparing the size of a signed 32-bit number with an unsigned 32-bit number is wrong
- Now even transformers are starting to go crazy