introduction
The functions and specifications of traditional temperature measuring instruments are fixed and cannot be changed by users according to their needs. The concept of virtual instrument proposed by NI completely breaks the mode that traditional instruments are defined by manufacturers and cannot be changed by users, and has brought about a great change in measurement and control instruments. LabVIEW is a virtual instrument platform developed by NI, and the current development using LabVIEW is usually based on the expensive data acquisition board supported by LabVIEW. To solve this problem, this system uses low-power microcontroller P89LV51RD2 and low-power temperature sensor TMPll2 to form a temperature acquisition node, and realizes remote communication between the microcontroller system and the host computer through a wireless communication module, which not only replaces the expensive data acquisition card and greatly reduces the system cost, but also realizes wireless transmission of data. At the same time, the low power consumption characteristics of the temperature acquisition node reduce the power requirements when ZigBee is networked, making it easier to network and realize multi-point temperature measurement.
1 System composition and working principle
Figure 1 shows the system block diagram. The temperature measurement and control system is mainly composed of a computer, a single-chip microcomputer, a temperature measurement circuit, a temperature control circuit, and a wireless communication circuit. The TMPll2 temperature sensor collects temperature, transmits the temperature digital quantity to the P89LV51RD2, and then displays the temperature on site through the digital tube LED circuit. At the same time, the P89LV51RD2 sends the temperature data to the remote computer through the wireless communication module SZ05. The LabVIEW control platform running on the PC displays the temperature in real time, and performs data processing, temperature alarm, and data storage. In addition, the control platform samples the input signal, uses the PID controller in LabVIEW for PID control, sends the control quantity to the single-chip microcomputer through the wireless module, and the single-chip microcomputer outputs the control quantity to achieve temperature control.
2 System Hardware Design
2.1 Temperature measurement and display circuit
This system uses the high-precision, low-power digital temperature sensor TMPll2 launched by TI in June 2009 to achieve temperature measurement. The sensor has the following features:
◆Temperature measurement range is -40~125℃;
◆The accuracy is 0.5℃ in the temperature range of 0~65℃, and 1℃ in the range of -40~125℃;
◆12-bit resolution, the reading accuracy of the measured value reaches 0.0625℃;
◆The maximum quiescent current in normal operation mode is 10μA, and 1μA in shutdown mode;
◆Power supply range is 1.4~3.6V;
◆SMBus/two-wire serial interface, up to 4 sensors can be connected to the bus.
Considering power consumption, accuracy, interface and other aspects, P89LV51RD2 and TMPll2 are used to form a temperature measurement node. Although the P89LV51RD2 microcontroller does not have a dedicated I2C bus interface, the I2C bus can be simulated by software to realize the communication between the microcontroller and TMPll2. The I/O ports P1.0 and P1.1 of the microcontroller are used to simulate the SDA and SCL signals of the I2C bus respectively, so it is only necessary to connect the P1.0 and P1.1 pins of the microcontroller to the SDA and SCL pins of TMPll2 respectively (note that they need to be pulled up). After the P89LV51RD2 reads the temperature data through the I2C bus, the temperature value is displayed by 5 digital tubes, including hundreds (or sign bits), tens, ones and 2 decimal places. [page]
2.2 Temperature Control Circuit
The temperature control circuit is shown in Figure 2. It is mainly composed of NPN transistor Q1, TLP521-1 photocoupler U1 and high-power NMOS tube Q2. The host computer program control system compares the detected temperature value with the system set value, performs calculations according to the PID control algorithm, and outputs a PWM signal with adjustable duty cycle from the P1.2 port of the single-chip microcomputer. After being driven by transistor Q1, it controls the on and off of the photocoupler U1, and then controls the on and off time of the NMOS tube Q2 (IRF840A), thereby controlling the heating time of the heating object-high-power resistor R, so that it reaches the set temperature value. For the convenience of the experiment, R is a high-power wire-wound resistor with a rated power of 10W and a rated resistance of 10Ω, and is powered by a +12V DC power supply. Since the current flowing through the heating resistor R is large, the +12V DC power supply for R must be separated from the +12V DC power supply for other analog devices.
2.3 Wireless Communication Circuit
The wireless communication circuit is implemented using the SZO5 series ZigBee wireless data communication module of Shanghai Shunzhou Network Technology Co., Ltd. The module provides three interface standards: RS232, RS485 and TTL, and the transmission distance can reach 100 to 2,000 meters. In order to improve development efficiency, the RS232 interface of the module is used to realize serial wireless communication between the microcontroller and the computer, making software programming simple. If the system has no requirements for distance, only one serial port line is needed to realize the communication between the microcontroller and the computer without changing the software design. It has strong versatility and is suitable for various applications.
3 System Software Design
3.1 Host computer software design
The host computer software uses LabVIEW graphical programming language to complete the design of the control platform. LabVIEW provides a very simple and intuitive graphical programming environment. Designers can easily build a measurement system and construct a friendly and beautiful operation interface without writing cumbersome computer program codes, which greatly simplifies program design and improves development efficiency.
Figure 3 shows the temperature monitoring interface of the host computer LabVIEW control platform (the interface when temperature acquisition and display are in progress). The system adopts modular design concept, and is mainly composed of modules such as data acquisition and display, data processing and alarm, data storage and PID control. Users can realize functions such as temperature acquisition, display, processing, alarm, storage and control by operating the mouse on the interface.
[page]
(1) Data acquisition and display module
The data acquisition and display module mainly receives the temperature data sent by the single-chip microcomputer through the computer serial port and the wireless communication module, and displays it in real time. In order to ensure the smooth communication between the computer and the single-chip microcomputer, the serial port should be initialized first, such as setting the serial port number COM1, baud rate 9600, 8 data bits, 1 stop bit, no parity check and flow control. When the program is running, click the "Start Collection" button, the system will receive the temperature data sent by the single-chip microcomputer, and display the current collected temperature value through the temperature instrument control. In addition, the data acquisition module receives a set of discrete temperature signal values, which are displayed point by point and connected through the waveform chart display control, and the temperature trend curve can be drawn. Drag the slider at the bottom right of the curve chart to view the historical temperature curve.
(2) Data processing and alarm module
Data processing mainly realizes the histogram statistics of the collected temperature data. Click the "Create Histogram" button on the system interface, and the system will execute the corresponding program to count the temperature data and display the temperature histogram in the waveform control to facilitate the user to perform statistical analysis.
The temperature alarm module mainly realizes high temperature alarm and low temperature alarm. The user sets the upper and lower temperature limits in the system interface. When the actual temperature is greater than the upper temperature limit or less than the lower temperature limit, the system gives a high temperature alarm (red light on) or low temperature alarm (yellow light on) through the indicator light to remind the user that the temperature exceeds the limit to ensure the safety of personnel and equipment.
(3) Data storage module
The data storage module mainly saves the collected temperature data to an Excel spreadsheet, so that users can retrieve the historical temperature data for later analysis. First, use the "array size" VI to obtain the size of the collected temperature array and determine whether it is divisible by 10. If it is, execute the "true" branch program of the "conditional structure", write the collection time and 10 temperature data into the spreadsheet file, wrap the line, and then perform conditional judgment. In this way, the temperature data is recorded in 10 rows in the spreadsheet file, and the date and time of collecting this group of data are recorded at the beginning of each row.
In addition, the temperature curve can be stored in JPEG format using the "Method Node" and "Write to JPEG File" VI. When the user clicks the "Save Temperature Curve" button, the system pops up a save dialog box, prompting the user to save the temperature curve as a JPEG image.
(4) PID control module
LabVIEW provides a powerful PID controller, which allows users to avoid the tedious writing of PID algorithms and improve development efficiency. When performing PID control, first input the temperature signal to the PID controller, and input the temperature setting value and PID gain, including the proportional coefficient Kc, the integral time constant Ti, and the differential time constant Td. Click the "PID Control" button, and the program controls the temperature according to the PID algorithm to make the temperature close to the set value.
3.2 Lower computer software design
The P89LV51RD2 microcontroller program is designed in C language. P89LV51RD2 provides three 16-bit timers/counters and one full-duplex serial communication port to meet the software design requirements of this system. Figure 4 shows the microcontroller control program flow.
[page]
When the system is initialized, set the 8-bit serial port mode 1, and the timer T2 of the single-chip microcomputer works in the baud rate generator mode to generate the baud rate required for serial communication. Then set the timer T0 of the single-chip microcomputer to work in the timer mode to generate the specified control cycle. In the interrupt program of TO, the collected temperature data is first sent to the host computer through the wireless module for real-time display. Then the host computer uses the PID controller in LabVIEW to determine the size of the system output control quantity and send it back to the single-chip microcomputer. The single-chip microcomputer outputs a PWM signal according to the control quantity to drive the control circuit to control the temperature of the object under test.
Conclusion
The temperature measurement and control system designed in this paper uses a low-power single-chip microcomputer system as the acquisition module, replacing the expensive data acquisition board. It is low-cost and uses the software platform developed by LabVIEW for temperature processing and control. Compared with traditional instruments, it has the characteristics of friendly interface, easy operation and strong scalability. Experiments show that this system can be used as part of the teaching experiment system and embedded in the virtual instrument experiment platform for students to learn LabVIEW programming and the communication between virtual instruments and single-chip microcomputers. In addition, multiple nodes can be networked to form a distributed wireless network to achieve multi-point temperature measurement and control, which has good application prospects.
Previous article:A Remote Control Experiment System Based on LabVIEW
Next article:Application of Virtual Instruments in Digital Array Antenna Testing
Recommended ReadingLatest update time:2024-11-16 16:20
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- Medical device requirements for chip temperature
- Send Chip Coins: #What to do when you encounter problems with Guoxin#, technical support is rubbed on the ground?
- 【RPi PICO】MicroPython firmware with encryption support
- I want to use a 3.3v microcontroller to share power to control a relay, but the microcontroller stops working after grounding.
- Welfare is coming! The recommended chip list for the TI Cup is freshly released!
- Based on RT-Thread open source works show - rice field environmental information monitoring system
- A brief introduction and configuration of 28335 external interrupt
- Analyze the relationship between J-link hardware, firmware, and drivers
- [ST NUCLEO-G071RB Review]_05_System clock configuration and Tetris game implemented on the serial port
- stm32F429 uses analog IIC to drive AD5933 to measure human body impedance (small impedance). After writing to the register, all the results read are FF.