This paper will study a temperature measurement and control system that uses CAN bus to complete data communication between measurement and control systems, has a flexible structure and is versatile. In this system, we also use a single-bus digital temperature sensor DS18B20. In order to adapt to the needs of different applications, Pt100 can also be used, and the system can be easily interconnected. The output of the sensor is converted into a standard voltage or current signal, and converted into a digital quantity through A/D conversion. The digital signal is transmitted to the microcontroller, and finally the microcontroller sends the collected data to the CAN bus controller, which is transmitted to the bus through the CAN bus transceiver to complete the data collection work.
1 Overall solution selection of temperature measurement and control system
According to the needs of the application, the main functions of this temperature measurement and control system are: detecting the signal of the thermocouple temperature sensor Pt100; using the digital temperature sensor DS18B20 to detect the temperature; the on-site LED displays the digital temperature signal, the micro printer prints the temperature change curve and the keyboard control function; the master station communicates with the lower computer through the CAN bus to realize the monitoring of the entire system. The system is mainly composed of monitoring module, temperature measurement module, field display module and CAN bus communication, and the system structure schematic diagram is shown in 1-1.
Figure 1-1 System block diagram
2 System Hardware Selection and Design
2.1 Sensor Selection - DS18B20 Sensor
DALLAS's DS18B20 is a one-line digital temperature sensor with a 3-pin IO-92 small package; the temperature measurement range is -55℃~+125℃, and it can be programmed to 9-bit~12-bit AD/conversion accuracy, and the temperature measurement resolution can reach 0.0625℃. DS18B20 can obtain power directly from the data line without external power supply. Its working power supply can be introduced at the remote end or generated by parasitic power supply; multiple DS18B20 can be connected in parallel to 3 or 2 lines, and the CPU only needs one port line to communicate with many DS18B20, occupying fewer ports of the microprocessor, which can save a lot of leads and logic circuits, making DS18B20 very suitable for long-distance multi-point temperature detection systems.
2.2 Single-chip microcomputer C8051F040
C8051F040 CAN controller composition and access method The C8051F040 single-chip microcomputer is a fully integrated mixed-signal system-on-chip (SOC) produced by Cygnal Corporation of the United States. It has a CIP-51 core that is fully compatible with the 8051 instruction set. It integrates almost all analog and digital peripherals and other functional components required to form a single-chip data sampling or control system on a single chip. It has 64KB Flash, 4352B RAM, CAN controller 2.0, 2 serial interfaces, 5 16-bit timers, 12-bit A/D converter, 8-bit A/D converter and 12-bit D/A converter, etc. It also has a JTAG interface inside, making debugging very convenient. The CAN controller integrated in C8051F040 is a Bosch CAN controller.
2.3 Field temperature sensor Pt100
PT100, also known as platinum resistance, thermal resistance, is a temperature sensor. The temperature coefficient of platinum resistance is 0.0039×/℃, the resistance value is 100Ω at 0℃, and the resistance change rate is 0.3851Ω/℃. It is encapsulated in a stainless steel shell, filled with thermal conductive materials and sealing materials. It is small in size and suitable for temperature measurement of precision instruments, constant temperature equipment, fluid pipelines, etc. It is very economical and practical. The platinum resistance temperature sensor has high accuracy, good stability, and a wide range of application temperatures. It is the most commonly used temperature detector in the medium and low temperature zone (-200℃~400℃). It is not only widely used in industrial temperature measurement, but also made into various standard thermometers.
2.4 PHILIPS PCA82C250 transceiver
Since the CAN controller inside Cygnal is only a protocol controller and cannot provide physical layer driver, an external CAN bus transceiver is required when using it. Commonly used CAN bus transceivers include PHILIPS PCA82C250 transceiver, high-speed TJ1050 transceiver, etc. The PCA82C250 transceiver is used here to improve the differential transmission and reception capabilities of the bus. It is fully compatible with the ISO11898 standard and has three different working modes, namely high speed, slope control and standby, which can be selected according to actual conditions.
2.5 6N137
6N137 optocoupler is a high-speed optocoupler for single channel. There should be a 0.1uF decoupling capacitor next to the power pin of the 6N137 optocoupler. When choosing the type of capacitor, try to choose capacitors with good high-frequency characteristics, such as ceramic capacitors or tantalum capacitors, and try to be close to the power pin of the 6N137 optocoupler; in addition, the input enable pin has a pull-up resistor inside the chip, so there is no need to connect an external pull-up resistor.
2.6 GP-16 micro printer
GP-16 is an intelligent printer. The movement uses Model-150Ⅱ 16-line micro-pin print head. The internal controller is composed of a single-chip microcomputer. It communicates with the host to receive commands and transmit data. The host controls the actions of the printer through the interface circuit and prints the data sent by the host in the form of strings, data and graphics.
3.1 Monitoring module
The main function of the monitoring module is to send remote frames to each temperature measurement module node and receive data or information from each node to realize monitoring, alarm and other functions. The hardware of this module is realized by a microcomputer and a PC-CAN communication card.
3.2 Temperature measurement module
Each DS18B20 temperature sensor has its own unique chip serial number. We can hang multiple such temperature sensors on a bus to realize multi-point temperature detection. Its wiring circuit diagram is shown in Figure 3-1. All DS18B20 communicates with the microcontroller through a single line, and its power supply is provided by the outside. The interface circuit of DS18B20 is very simple. The resistance value of the platinum resistance temperature sensor Pt100 changes with the change of temperature. In order to facilitate detection, its signal can be converted into a voltage or current signal. Here, an external constant current source is used to convert the resistance change into a voltage change signal.
Figure 3-1 DS18B20 interface circuit
In the signal adjustment circuit (see Figure 3-2), in order to improve the measurement accuracy of Pt100 and reduce the influence of line length on the detection results, Pt100 uses a four-wire method to sample the signal, and then passes through a differential amplifier circuit. This can effectively reduce zero drift and reduce the influence of voltage drop caused by long lines on the system. [page]
Figure 3-2 Signal acquisition and adjustment circuit
3.3 On-site display and printing module
The main functions of this display module are: it can display the temperature value and temperature change curve of each node on-site, and the node temperature to be displayed can be set through the keyboard. It has a separate single-chip microcomputer for processing and communicates with C8051F040 through the serial port. The circuit principle is shown in Figure 3-2. This looks more complicated in the circuit, but it is very flexible, which can reduce the burden of the lower computer main controller C8051F040, and the user can select it according to needs. A single temperature measurement module and an on-site display module can form an independent temperature measurement and control system.
3.4 On-site display and printing module
The main functions of this display module are: it can display the temperature value and temperature change curve of each node on-site, and the node temperature to be displayed can be set through the keyboard. It has a separate single-chip microcomputer for processing and communicates with C8051F040 through the serial port. This looks more complicated in the circuit, but it is very flexible, which can reduce the burden of the lower computer main controller C8051F040, and the user can select it according to needs. A single temperature measurement module and an on-site display module can form an independent temperature measurement and control system.
3.5 CAN bus communication module
The CAN bus is the physical connection between the monitoring module and each temperature measurement node. This part is mainly the design of its physical layer. The main function of the monitoring module is to monitor the entire system. It continuously sends remote frames to the lower computer through the CAN bus, and receives temperature and other information transmitted from the lower computer, and analyzes, displays, and stores this information. Users can select the items they need to know according to the prompts on the monitoring menu. The monitoring module can also record and print data, as well as give alarms and handle abnormal situations. The on-site display module can also receive the temperature values of each point and display them in the form of numerical curves, etc. Users can observe the system on site.
3.6 Power supply module
Figure 3-3 Power module circuit design
4. Software Design of Intelligent Temperature Measurement and Control Instrument
Each node on the CAN bus can be used as a master node to actively exchange data with other nodes, which completely solves the potential harm of only one master node and the rest are slave nodes on the master-slave structure network. The nodes (information frames) in the CAN network can be prioritized, which is undoubtedly extremely beneficial to the real-time control system. Since this system uses the CAN bus to form a local area network, the program design has great flexibility. According to the characteristics of the system, the program is divided into two parts: monitoring program, on-site LCD display program and temperature measurement program. Using a microcomputer as the host of the monitoring module, the monitoring program can complete relatively complete temperature monitoring and data management functions such as: the collection and display of temperature at a specific point, the collection and display of temperature of the entire system, the location of the temperature limit alarm point, etc.; the on-site LCD display program mainly completes the reception and processing of information, and displays it according to certain rules; the temperature measurement program mainly completes the functions of receiving various commands issued by the monitoring computer, sampling information, etc. Here is the temperature measurement program flowchart as shown in Figure 4-1.
Figure 4-1 Temperature measurement and control main flow chart
5 Conclusion
This paper first introduces the fieldbus, a new technology model that is highly integrated and integrated with computer technology, communication technology and control technology, analyzes the structural model, characteristics, advantages and types of the fieldbus, and then discusses the unique advantages of CAN as one of the many fieldbuses. On this basis, a temperature monitoring system based on the CAN fieldbus is developed. This paper gives a detailed description of the structure, functions and characteristics, hardware selection design and communication program design of the system. From different perspectives of the whole and the part, it explains the advancement and uniqueness of the technology used in the system:
in addition to the technical advantages of the CAN fieldbus itself, it mentions the use of single-chip microcomputers, the selection of digital sensors, the application of software programming functions and other technologies.
Previous article:Research on Networked Motion Control System Based on CAN Bus
Next article:Transmission control system of paper machine based on PROFIBUS-DP fieldbus
- Popular Resources
- Popular amplifiers
- 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
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Motor Science Series丨Understanding Motor Control Algorithms
- A beginner was trapped by the garbage code of the development board for a whole night
- SinlinxA33 development board Linux platform bus device driver
- Broadband Matching Network_Huang Xiangfu《Scanned Version》
- MSP430 MCU application of timer, PWM, comparator
- Do I need to draw the display screen myself when drawing the AD10 schematic?
- 【AT-START-F403A Review】+A/D Waveform Drawing
- GD32L233C-START evaluation 0.96 OLED display (I2C bus) display code transplantation
- The truth is simple. Why is the invariance of the speed of light so obscure and difficult to understand? Which master can explain the mystery?
- [TI recommended course] #Innovation of general-purpose op amp and comparator chips#