Design of water level sensor air tightness detector based on STM32
In the process of water level sensor inspection, it is necessary to detect the air tightness, so a water level sensor air tightness detector based on STM32 is designed. The detector adopts the direct pressure gas leak detection method, takes STM32F030R8 as the control core, controls the air pump for inflation, the pressure sensor detects the air pressure and outputs the differential signal through the bridge, the high-precision pressure measurement module measures the output of the bridge signal, and realizes the steps of pressurization, voltage regulation, load retention, judgment and output of the air tightness detection through program control. The judgment result is displayed by LCD and output by relay. Through many experiments and tests, the air-tight leak detection system can detect the leakage of the water level sensor, and the experimental data is more accurate, stable and good repeatability.
0 Introduction
The bubble method is often used in the early detection of air tightness, that is, the workpiece to be measured is put into the water, the cavity of the workpiece to be measured is filled with a certain pressure of gas, and the air tightness is judged by observing whether there are bubbles emerging from the water. The bubble method relies on the naked eye to judge the detection object, the detection is not accurate enough, and the leakage of the detection workpiece can not be quantitatively analyzed, and can only be applied in the occasions with low requirements for air tightness. With the progress of The Times, the direct pressure detection method of air tightness has been widely used, that is, to fill a certain pressure of gas into the chamber of the workpiece to be measured, and determine the degree of leakage of the workpiece by detecting the change of the internal pressure of the workpiece to be measured within a certain time. This method has high detection efficiency and low cost, and can realize qualitative and quantitative analysis.
The water level sensor is widely used in washing machine and other industries. There is an air chamber in the outer bucket of the washing machine. When the water level changes, the pressure in the air chamber will change. So that the composition of the LC oscillation circuit frequency changes, the washing machine control motherboard by detecting the frequency of the oscillation circuit, so as to obtain the water level of the high and low] o if there is leakage of the water level sensor, it will lead to the washing machine control motherboard to measure the water level is not accurate, so in the water level sensor factory detection, air tightness detection is an important detection item. Therefore, this paper designs an air tightness detector of water level sensor based on STM32, adopts direct pressure method for detection, displays and outputs the measurement results, and meets the demand of water level sensor for air tightness detection.
1 System working principle
To complete the air tightness detection of the water level sensor, it is necessary to coordinate the three parts: gas path, hardware and software. STM32 inflates the gas chamber by controlling the micro air pump. The hardware is integrated with a detection module and a processor module to detect and convert the pressure of the water level sensor. On the basis of hardware, the air tightness detection is realized through software programming.
The designed water level sensor air-tight leak detection system uses the principle of direct pressure method. Direct pressure leakage detection is to fill a certain pressure of gas into the chamber of the water level sensor, detect the change of air pressure in a certain time, and calculate the leakage amount. The theoretical basis of the direct pressure method is the ideal gas equation of state, as shown in equation (1), which is used to describe the pressure P of an ideal gas, the volume V, the amount of matter ", the molar gas constant 7 , the relationship between temperature T.
Assume that the volume of the closed part of the gas path is V, and the pressure inside the water level sensor is Patm after gas is filled. If there is a leakage of the water level sensor, the pressure inside will change to P "after time t, and accordingly, the gas with a volume of Vatm will be leaked into the atmosphere with pressure P込. According to the law of conservation of mass, the sum of the amount of material spilled into the atmosphere and the remaining mass in the detection process is equal to the initial mass of the gas, as shown in equation (2) :
Formula (2) shows that whether the product leaks and the degree of leakage can be judged according to the change of air pressure within a certain time.
2 System Composition
The system gas path schematic diagram of the water level sensor air tightness detector is shown in Figure 1. The workpiece to be measured is pressurized by the DC air pump, and the flow rate can be controlled by adjusting the knob of the throttle valve before the gas output of the air source, and then the stable and non-backflow gas is obtained by a check valve to inflate the parts to be measured. When the pressure reaches the set value, stop the inflation. After the buffer time, the pressure tends to be stable, the measured pressure value is used as the initial pressure measurement value, the load holding time is completed, and the pressure is measured again for the measured workpiece, and the difference between the two is compared with the allowable leakage, so as to determine whether there is leakage. The detection process is controlled by STM32.
The hardware circuit of the water level sensor air tightness detector is shown in Figure 2, which is divided into three parts: gas path system, data acquisition system and microprocessor system. The gas supply system is made of DC air pump to prepare the gas source. The gas fills and detects the measured object through the gas path. The pressure sensor detects the pressure inside the workpiece to be measured in real time, and converts the collected pressure information into A weak electrical signal. The signal conditioning module adjusts the weak electrical signal, and converts it into the binary code form that can be recognized by the microprocessor through A/D converter under the control of MCU. MCU and STM32 adopt serial communication,STM32 obtains the real-time value of the air pressure, and responds to the keyboard from the human-computer interaction module. After the detection, the detected information is displayed on the LCD screen, and the detection result is output through the relay.
3 System software design
The flow chart of the designed water level sensor air tightness system is shown in Figure 3, which is realized by STM32 through the program.
A total of 5 keys are used for the air tightness of the designed water level sensor, which are respectively defined as UP, DOWN, OK, SET and START, which can be used to set parameters and start the experiment. The program flow chart is shown in Figure 4.
4 Experiment
The physical diagram of the hardware designed in this project is shown in Figure 5. When placed according to Figure 5, the core part of the controller adopts 5V power supply. Left-right +, DC air pump power supply part uses 3 V power supply, left-right +, DC air pump interface left-right +, other interfaces also include detection result OK relay output interface, detection result NO relay output interface, sensor gas path measurement interface, keyboard interface, LCD interface.
The test pressure of the water level sensor is set to 10 kPa, the buffer time to 10 s, the load holding time to 20 s, and the leakage allowance to 100 Pa. The calibrated pressure is slightly larger than that of the pressure gauge, but the focus of the air tightness detection is the pressure difference before and after the load holding. 10 water level sensors with qualified air tightness and 10 with unqualified air tightness are tested. The test results show that the air tightness tester of the water level sensor can accurately judge whether it is qualified, which indicates the feasibility of the device.
5 Conclusion
The detector is used to detect the air tightness of the water level sensor, which is mainly composed of STM32, DC air pump, air pressure sensor, A/D converter, liquid crystal display screen, button, relay and so on. The experimental results show that the test data of the designed water level sensor air tightness detector is accurate, stable and has good repeatability. It can accurately judge whether the air tightness of the water level sensor is qualified and meet the demand of the water level sensor air tightness detection.
reference
[1] Hua Jiefeng, LV Zhengnan, Tang Heng. Application and Analysis of Direct Pressure Method in Gas tightness Testing [J]. China Inspection and Testing,2021,29 (5) : 35-37.
[2] Liu Weiyi. Study on Tightness Test of Gas Positive Displacement Flowmeter by direct Pressure Method [J]. Metrology and Testing Technology, 2019,47(6) : 14-15. (in Chinese)
[3] Hu Gang, Wang Yanfeng. Resonant water level sensor [J]. Sensor Technology, 2002,21(5):22-23.
[4] Xiong Yuansheng, Wu Weixiong. Design of automatic Test System for High efficiency Water level Sensor [J]. Industrial Instrumentation and Automation Equipment,2019 (2) : 33-35.