Design of a wireless temperature measurement and control system based on LabVIEW

Publisher:Meiren520Latest update time:2010-05-07 Source: 东南大学Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

System block diagram

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.

Temperature control circuit

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.

Temperature monitoring 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.

MCU 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.

Keywords:LabVIEW Reference address:Design of a wireless temperature measurement and control system based on LabVIEW

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

Temperature measurement and control system composition and temperature signal generation and processing
When we developed the nitrogen oxide chemiluminescence analyzer, the entire system required temperature measurement and control in three places: the reaction chamber, the molybdenum conversion chamber, and the photon counter PMT. The temperature in the reaction chamber has a certain impact on the chemical reaction (ni
[Test Measurement]
Temperature measurement and control system composition and temperature signal generation and processing
Optimizing Signal Processing Performance in Multicore Processor Environments with LabVIEW
Programming Challenges in Multi-core Processor Environment More than 40 years after the advent of Moore's Law, people have seen the semiconductor chip manufacturing process level improve at a dizzying speed. The highest frequency of Intel microprocessors has even exceeded 4G. Although the increase in frequency has
[Test Measurement]
Optimizing Signal Processing Performance in Multicore Processor Environments with LabVIEW
LabVIEW Remote Measurement and Control Based on DataSocket Technology
DataSocket technology is based on TCP/IP protocol and highly encapsulates it. It can realize real-time data exchange and sharing between the server and multiple users during the test and measurement process, and users do not need to care about the details of the underlying program. This article analyzes the internal co
[Test Measurement]
LabVIEW Serial Port Debugging Notes
Use the Simplified Chinese version of LabVIEW 2011, and then you need to install the VISA driver (you can download the driver and LabVIEW software on eMule, but the LabVIEW on eMule is the English version. If you need the Simplified Chinese version, you can download it here http://ftp.ni.com/evaluation/labview/ekit/oth
[Test Measurement]
Designing a Hands-On Curriculum for a Wireless Communications Lab Using NI USRP and LabVIEW
The traditional teaching method of RF and communication courses is usually theoretical learning and derivation of mathematical formulas. Students focus on derivation of formulas and software simulation . More and more lecturers have realized that if an experimental device can be provided, students can
[Test Measurement]
Intelligent UHV tester system based on UV detection method
Abstract: A design scheme of intelligent UHV tester system based on DSP and LabVIEW is proposed. DSP is used as the core of the on-site intelligent UHV tester system, LabVIEW is used as the development platform for the host computer management system software, and the field bus CAN is used to transmit the data colle
[Power Management]
Intelligent UHV tester system based on UV detection method
DAP unit safety production simulation system based on LabVIEW
 The actual operation and experiment of diammonium phosphate (DAP) production are quite dangerous. This paper combines the hazard analysis and operability (HAZOP) method with virtual instrument design to develop a DAP safety production unit simulation system based on LabVIEW. Through the monitoring and alarm of the ove
[Test Measurement]
DAP unit safety production simulation system based on LabVIEW
CNC machine tool network measurement and control system based on LabVIEW--key technology of network communication (Part 2)
  4.2.3 Shared variable method   Shared variables are another big step forward for LabVIEW to simplify network programming. Through shared variables, users can easily share data between different computers without programming. Users can easily exchange data without having to understand any underlying complex network
[Test Measurement]
CNC machine tool network measurement and control system based on LabVIEW--key technology of network communication (Part 2)
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号