Design of Multi-point Wireless Temperature Data Acquisition System Based on LabWindows/CVI

Publisher:老卫Latest update time:2013-05-02 Source: 电子设计工程 Keywords:C8051F020  AD590 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    The measurement and control software development platform Labwindows/CVI virtual instrument has been widely used in data acquisition, processing and analysis. This paper introduces a multi-point wireless temperature acquisition system based on C8051F020 temperature acquisition card and LabWindows/CVI virtual instrument, and explains the process of realizing multi-point wireless temperature acquisition by hardware system and software system. The hardware system design includes USB to serial port, wireless transceiver module, temperature acquisition, etc.; the software system design includes user interface, serial port communication, wireless transmission, reception processing, etc.

1 Overall solution design
   
The slave collects the ambient temperature through the temperature sensor AD590 to generate a current signal. The current signal is converted by the signal conditioning circuit to complete the I/V conversion and sent to the single-chip microcomputer for A/D conversion. The single-chip microcomputer saves the converted information to AT24C16 and saves the real-time time of the clock circuit. The user only needs to simply operate the upper PC software interface, issue the corresponding control command, and transmit it to the host through the serial port. The host sends the address and control command. If it matches the address of a certain slave, it returns the corresponding command; if the address does not match, it will not be processed. After receiving the corresponding matching response command, the host sends a temperature transmission command to the slave. After receiving it, the slave sends the information stored in AT24C16 to the host. The host transmits the received information to the host PC through the serial port. The user only needs to operate on the host computer operation interface to observe the temperature changes in the corresponding area. When the slave address overlaps and the host receives an error message, the host can send a new address through the host computer to modify the slave address to ensure the stable operation of each subsystem in the area.

2 Hardware Circuit Design
2.1 Overall Hardware Design
   
The entire system mainly consists of three parts: slave acquisition, storage and transmission system, host reception and processing system and host PC operation interface. The slave part consists of AT24C16 data storage circuit, AD590 temperature acquisition and conditioning circuit, real-time clock circuit, wireless module and C8051F020 control circuit; the host part consists of wireless receiving module and serial port to USB circuit; the host PC operation interface is used to facilitate user operation. The overall circuit design block diagram of the system (including host system and slave system) is shown in Figure 1.

b.JPG


2.2 The information storage circuit of the slave circuit
   
is mainly composed of AT24C16. AT24C16 is an E2PROM with an I2C bus interface. Its storage capacity is 16 KB and the byte address space is 0 to 2 047. The data input pin of AT24C16 has the function of filtering external disturbance signals and is widely used in the storage of constants, important parameters, and coefficient parameters in intelligent control.
    The temperature acquisition part adopts AD590 single-chip integrated two-terminal temperature-sensitive current source of AD Company. It is made based on the principle of the relationship between the forward current and temperature of the PN junction. It has good interchangeability and stable performance, easy use, strong anti-interference ability, and high output impedance. The output signal of AD590 is converted into a voltage signal and sent to the single-chip microcomputer A/D for sampling after processing, as shown in Figure 2.

c.JPG[page]

    The real-time clock circuit uses Dallas' high-performance, low-power, I2C bus serial clock/calendar chip DS1302 with RAM. The I2C bus is configured on P0.0 (SDA) and P0.1 (SCL) of C8051F020 by enabling the cross switch, and a pull-up resistor of 4.7 kΩ is added to complete the initialization of DS1302 and the transmission of time data.
    The wireless module consists of PT2262 encoding circuit, PT2272 decoding circuit and 315 MHz wireless transmitter module. PT2262/2272 is a CMOS process, low-power, low-cost general encoding and decoding circuit produced by PTC. PT2262/2272 can have up to 12 bits (A0~A11) three-state address terminal pins (floating, high level, low level), and any combination can provide 531,441 address codes. The slave address code of this system is fixed and different, and the slave address code and the host address code are both controlled by the microcontroller. PT2262 can have up to 6 data pins, and the set address code and data code are serially output from pin 17. When pin 17 of PT2262 is high, the 315 MHz high-frequency transmitting circuit starts to oscillate and transmits a constant-amplitude high-frequency signal. When pin 17 is low, the 315 MHz high-frequency transmitting circuit stops oscillating. Therefore, the high-frequency transmitting circuit is completely controlled by the digital signal output from pin 17 of PT2262, thereby completing amplitude keying (ASK modulation) for the high-frequency circuit, which is equivalent to 100% amplitude modulation. In actual use, it should be noted that PT2262 transmits at least 4 groups of word codes each time it transmits. PT2272 will only drive the corresponding data output terminal to a high level and drive the VT terminal to a high level synchronously when it detects the same address code plus data code twice in a row.
2.3 Host Part Circuit
   
Serial communication is a type of communication suitable for two machines. Through the communication interface, the sending and receiving ports of the two machines complete data exchange according to the predetermined serial port address, transmission rate (baud rate), data format, verification method, and transmission direction. Among them, RS 232 serial communication port is a common bus form in computers and is widely used in the process of measurement, testing and instrument control. However, few laptops have serial ports now, and most PCs provide USB interfaces, so the system adopts a USB-to-serial port method based on PL2303HX chip. PL2303HX is a USB-to-RS 232 interface conversion chip launched by Prolific. It can solve the connection between RS 232 full-duplex asynchronous serial communication and USB functional interface, support complete RS 232 interface, programmable baud rate, and provide power for external serial port, with low power consumption and low cost.

3 Software Design
   
The software design part is divided into two parts: single-chip microcomputer program design and LabWindows/CVI program design. The overall flow chart of the system is shown in Figure 3.

d.JPG


3.1 MCU Program
   
MCU programs are divided into host system programs and slave system programs.
    The host program mainly includes wireless transmission and reception of data and serial communication. The slave program mainly includes temperature and time acquisition, reading/writing of AT24C16 chip and wireless transmission and reception.
    The communication protocol between MCU and host PC is as follows:
    Serial port settings: RS 232C or TTL level, 115 200 b/s, 8 data bits, 1 stop bit, no parity bit; MCU UART receives control instructions from host PC and also transmits temperature data collected from each slave to host PC. The data sent by MCU is agreed as follows:
    Format: 0x55 Temperature Hour Minute Second; Among them: 0x55 is the data header; Temperature is the temperature data actually collected by the slave; Hour Minute Second is the hour, minute and second information of the temperature data collected by the slave, and the variable type is character type.
    The data format sent by the host PC to the host MCU is as follows:
    Format: 0xAA ChannelAddress;
    where: 0xAA is the data header, ChannelAddress is the slave address that the host PC requires to upload temperature data,
    and the variable type is character type. If the host computer needs to change the address information of the slave, the command format is as follows:
    Format: 0xBB ChannelAddressA ChannelAddressB; where: 0xBB is the data header; ChannelAddressA is the original slave address that the host PC requires to upload temperature data; ChannelAddressB is the new slave address that the host PC requires to upload temperature data, and the variable type is character type.
3.2 LabWindows/CVI host PC interface program
    LabWindows/CVI has many standard function libraries. When designing serial communication, the serial communication control function and I/O function provided by the RS 232 function library are used. The user selects the button of the corresponding area on the interface and presses the temperature acquisition button. At this time, the host PC sends a temperature acquisition instruction for the area, and the slave computer transmits the temperature data stored in the area. The host computer saves the received temperature data into an array and then draws a dynamic temperature curve through the drawing function. The host PC software operation interface can display the temperature data of different slaves on the same interface, which is convenient for users to compare temperature data. The actual display effect is shown in Figure 4.

a.JPG



4 Conclusion
   
This system has well achieved the established requirements in both hardware and software. It can modify the slave address code, dynamically display the temperature, accurately collect the temperature in different areas, and the operation interface is convenient for managers to use. The experimental results show that replacing cable transmission with wireless transceiver can reduce power consumption, save costs, and is simple and flexible to install, with high sensitivity, high reliability and strong portability. In an open environment, the wireless transmission distance exceeds 150 m; in the case of obstruction, the wireless signal can bypass multi-story buildings. Relay stations can be added to increase the transmission distance. The number of data encoding groups can be expanded arbitrarily.

Keywords:C8051F020  AD590 Reference address:Design of Multi-point Wireless Temperature Data Acquisition System Based on LabWindows/CVI

Previous article:Design of mobile phone charger for electric vehicle based on 51 single chip microcomputer
Next article:Design of real-time temperature monitoring system based on single-chip microcomputer and computer serial port

Latest Microcontroller 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号