Research on wireless water level detection system and pressure sensor compensation method

Publisher:caijtLatest update time:2011-04-19 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Abstract: A wireless water level detection system based on ATmega16 and FC222-CH. The system consists of a wireless communication module, a power module, an AD conversion module, and a host computer module. It realizes the functions of wireless detection of water level and operation fault alarm, and is equipped with a self-designed LabVIEW 8.5 host computer display interface, so that the whole development system has both visualization and real-time requirements.

In recent years, with the continuous improvement of my country's geological exploration level, water level detection, temperature detection, metal content detection and other technologies have become increasingly mature. However, when carrying out specific engineering applications, many factors need to be considered. This paper proposes a wireless remote detection method based on the situation that the geological exploration team is in a harsh natural environment such as an exploration mine, which is not suitable for motor vehicles to enter and staff to stay for a long time. The pressure sensor in the detection system mostly uses a single crystal silicon pressure sensor. Because this type of sensor is made using the piezoresistive effect of single crystal silicon, its piezoresistive coefficient changes with temperature, and the piezoresistive effect principle itself can cause temperature drift of the sensor output [1]. In addition, the manufacturing process of semiconductor sensitive elements will also cause the overall temperature drift of the sensor, which requires a set of effective methods to solve the defects caused by the pressure sensor itself being easily affected by temperature. Therefore, a compensation method based on Lagrange interpolation is proposed, which greatly improves the reliability of detection. The upper computer display interface is designed using LabVIEW 8.5, which has a friendly interface and is easy to operate. It can not only display the data change curve, but also store the data in real time and in time-sharing. When a fault occurs, it can also issue an audible and visual alarm in time.

1 Overall structure of water level detection system

The water level detection system adopts a modular design concept and consists of a wireless communication module, a signal acquisition module, an AD conversion module, a power supply module, etc. The system structure diagram is shown in Figure 1.


The system uses the display end controller as the host and the signal acquisition end controller as the slave. The host sends a start signal, which is transmitted to the slave through the radio station. After receiving the signal, the slave starts data acquisition, and transmits the collected data to the 12-bit precision AD574 for AD conversion through impedance transformation (voltage follower). Then, AVR16 uses the Lagrange interpolation principle to process the data, and then transmits these signals to the host computer LabVIEW through Max232 for real-time display.

2 Hardware Design of Water Level Detection System

2.1 Structure and performance characteristics of Atmega16

ATmega16 is a new AVR high-end single-chip microprocessor launched by ATMEL in 2002. Its main advantages are that the chip itself has 16 KB Flash program memory, 512 B EEPROM, 1 KB SRAM data memory, watchdog circuit and 8-channel 10-bit A/D conversion; it comes with SPI synchronous serial port and UART asynchronous serial port, and effectively supports C language and assembly language in software.

2.2 AD module

AD574A is a single-chip high-speed 12-bit successive approximation A/D converter launched by Analog Devices of the United States. It is a hybrid integrated conversion chip composed of built-in bipolar circuits. It has the characteristics of few external components, low power consumption, high precision, etc. It also has automatic zero calibration and automatic polarity conversion functions. It only needs a small number of external resistors and capacitors to form a complete A/D converter. Its main functional characteristics are: resolution of 12 bits, nonlinear error less than ±1/2 LBS or ±1 LBS, conversion rate of 25 μs, analog voltage input range of 0 V ~ 10 V and 0 V ~ 20 V or 0 V ~ ±5 V and 0 V ~ ±10 V, power supply voltage of ±15 V and 5 V, data output format of 12 bit/8 bit, chip working mode of full-speed working mode and single working mode.

2.3 Power Module


In addition, the size of the power supply is required to be as small as possible, so that the power supply part and the control and drive parts in the AVR system can be placed in the same control box. The entire circuit structure is simple and reliable, and the outputs are electrically isolated from each other. The main output power of the control power supply is required to be large, and the voltage regulation accuracy is ±5%. The output power of each drive is small, and the voltage regulation accuracy is ±10%.

2.4 Wireless Communication Module

The host uses FC222-CH to communicate with the slave. FC222-CH is a two-way data transmission and low-power modular radio designed by Shenzhen Youxunda Company using advanced single-chip microcomputer technology, wireless radio frequency technology, digital processing technology and voice processing technology. It has the advantages of adjustable frequency, adjustable bandwidth, adjustable power, multiple channels, high coding efficiency, high receiving sensitivity, and provides three data interfaces: RS-232, RS-485 and TTL. This system uses this device to meet the needs of remote control of water supply in the pump room. In this system, FC222-CH selects the RS-232 data interface.

2.5 Keyboard module and display module

The keyboard module is used to set the actual atmospheric pressure, water density, data access time interval and other system working parameters, and these working parameters are stored in the EEPROM of Atmega16. The user does not need to enter these parameters again when using it next time, so that the deep water level detection system has a memory function. The PC is used to display the water level in real time, and the water level, temperature, power supply, serial port usage and baud rate setting are displayed during normal operation. When a fault occurs, it is displayed in a modular manner, such as whether the AD module is working, whether the power module is powered, whether the communication module is normal, etc., so as to facilitate maintenance in the event of an error, and an audible and visual alarm is used when the serial port line is in poor contact to remind people to connect.

3 Software Design of Water Level Detection System

3.1 Main program design of the system

The software design of the water level detection system adopts a modular design concept and is implemented in C language. The various functional modules of the software are interconnected through input and output parameters, which can shorten the development cycle. Figure 3 is the main program structure diagram.


3.2 Parameter settings of digital radio

The parameter settings of the data transmission radio include the address code, version number, power level, channel selection, air baud rate, serial port baud rate, data bit, check mode, frequency inversion mode, bandwidth and other parameters. The parameter settings of the two radios are shown in Figure 4(a) and Figure 4(b).


3.3 Data processing using Lagrange interpolation method

The measurement accuracy of piezoresistive sensors is greatly affected by nonlinearity and ambient temperature. How to compensate for the errors generated by the sensor becomes a key link in the design. In terms of hardware, the general compensation method is to correct the differences in bridge resistance, leakage current of bridge arm resistance, assembly stress, etc., but due to the large number of peripheral components, it will lead to poor stability and low accuracy, and it is difficult to achieve the desired expected effect under complex working conditions. With the application of microprocessor technology in the field of sensors, it is possible to achieve automatic compensation of sensor working characteristics by designing software algorithms. This design focuses on analyzing the changes in the working characteristic curve of the single-crystal silicon piezoresistive pressure sensor, and provides a software algorithm for correcting its errors. It can ensure that the accuracy of the sensor remains almost unchanged over a wide temperature range, and can be widely transplanted to the compensation design of other piezoresistive pressure sensors.


As the pressure increases, the voltage gradually increases. After many experiments, the following effective data can be measured, see Table 1.


Since there are certain small errors in the experimental data, filtering methods should be used to remove the false and retain the true, and obtain the required approximate value. Here, the bubbling method is used to process, remove the maximum and minimum values, and then take the arithmetic mean (Note: 0.1 Mpa is the voltage value measured on the ground, corresponding to 1 standard atmospheric pressure).

U0: The first group of measured voltage values.

U1: The second group of measured voltage values.

U2: The voltage value measured by the fifth group.

x(n): voltage value after filtering, where n is 1, 2, 3, 4, and 5, corresponding to the five pressure collection points respectively.

Use the Lagrange interpolation algorithm to analyze it:


4 Host computer LabVIEW display module

LabVIEW is a program development environment similar to C and BASIC. However, the significant difference between LabVIEW and other computer languages ​​is that other computer languages ​​use text-based languages ​​to generate codes, while LabVIEW uses the graphical editing language G to write programs, and the generated programs are in the form of block diagrams.

The host computer program is written by LabVIEW software, which can process various real-time signals collected from the field. It has a friendly interface and is easy to operate. It can realize sound and light alarm for circuit break problems caused by faults, which is safe and reliable.

5 System Reliability Design

5.1 Problems encountered during testing experiments

Experimental environment:

(1) Connect the probe to a 300 m armored cable and place it in a 5 m deep iron water pipe outdoors in a suitable environment.

(2) A 12 V DC power supply was used during the radio test. The power of the radio was 5 W. The experimental distance was 1 000 m, and the antenna height of Radio 2 was kept constant at 3.4 m.

This situation will cause the following problems:

(1) Sometimes the circuit contact is unreliable, the microprocessor resets, freezes, and the casing leaks electricity.

(2) The host computer displays signals that are jittery and severely distorted.

(3) The signal quality of wireless communication is poor.

Figure 5 is the water level curve in the experiment.


5.2 Solution to the problem

Based on the above problems, the following solutions are proposed:

(1) To address the problem of unreliable circuit contact, PCB boards were used instead of copper mold test boards, and anti-interference measures were taken during the PCB manufacturing process, such as making the power and ground lines as wide as possible during wiring; separating the digital and analog ground lines; reasonably configuring decoupling capacitors; and copper-cladding the circuit board.

(2) To address the problems of microprocessor freeze and reset, adopt anti-interference measures combining software and hardware. Use photoelectric isolation technology in hardware; set flags in software; verify key exits; use instruction redundancy technology for important instructions such as communication sending instructions; set the power-on reset flag in RAM.

(3) To deal with unclean power supply and mutual interference between power supplies, switching power supplies are used to supply power separately.

(4) Since the cable length is 300 m, distributed capacitance will be formed between the conductors, and the excess cable is wound on the drum, which is equivalent to a large inductor, which will affect the stability of the circuit. Therefore, software filtering (bubble method) is used to compensate for it. The processed graph is shown in Figure 6.


The system designed this time has been running successfully for 2 months without any fault. Field experiments show that this setting method can effectively reduce measurement errors, meet the requirements of field use, and ensure the reliable operation of the system. At the same time, the reliability design scheme proposed has certain reference value for the design and application of similar products.

Reference address:Research on wireless water level detection system and pressure sensor compensation method

Previous article:Metal film resistor temperature detection circuit diagram
Next article:Research and Application of OPC Interface in PID Optimization Tuning System

Latest Industrial Control 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号