Liquid level detection system and method
By using the controller and RC series circuit in the liquid level detection system for data acquisition and filtering, the existing water level detection device has been solved, and the effect of accurately measuring water levels and reducing equipment costs is achieved.
Patent Information
- Application Number
- CN202111033858.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-03
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-09-03
AI Technical Summary
Existing water level detection devices require multiple capacitance components and probes, resulting in high cost and low reliability.
A liquid level detection system was designed, using the I/O interface, data filtering module, calibration module and AD conversion module in the controller, and the RC series circuit was formed through the set resistor and probe to carry out data acquisition and filtering, combined with Calculate the water level by calibration coefficient.
While ensuring the accuracy of liquid level detection, the system structure is simplified, the equipment cost is reduced, and the system reliability is improved.
Smart Images

Figure CN113588036B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level detection, and in particular to a liquid level detection system and method. Background Art
[0002] In daily production and life, water level detection is often required, so various types of water level detection devices have emerged. For example, the patent with application number 201110066368.4 discloses a water level detection circuit, device and method; however, it requires at least two probes and multiple capacitor elements, and the circuit uses more components, which makes the circuit cost high. At the same time, due to the increase in the components used, its reliability is also reduced. Therefore, it is necessary to provide a solution to reduce the equipment cost while accurately measuring the water level. Summary of the invention
[0003] The object of the present invention is to provide a liquid level detection system and method, so as to achieve the technical effect of reducing equipment costs while accurately measuring water levels.
[0004] In a first aspect, the present invention provides a liquid level detection system, comprising a controller, the controller comprising an I / O interface, a data filtering module, a calibration module and an AD conversion module; a resistor connected to the I / O interface; a first probe connected to the resistor and the AD conversion module; a second probe arranged opposite to the first probe; the first probe and the second probe are both arranged in a container whose water level is to be measured, and the second probe is grounded; the controller is used to output a preset detection waveform through the I / O interface and detect the sampling value obtained by the AD conversion module; the data filtering module is used to filter the sampling value; and the calibration module is used to calculate the current water level of the container through a set calibration coefficient.
[0005] Furthermore, the controller also includes a data compensation module; after the calibration module calculates the current water level of the container through a set calibration coefficient, the data compensation module performs data compensation processing on the current water level to obtain a corrected water level.
[0006] Furthermore, the liquid level detection system also includes a water pump connected to the controller; and a water pipe connected between the water pump and the container; the controller is also used to control the switch of the water pump through the corrected water level, thereby controlling the water level in the container.
[0007] Furthermore, the liquid level detection system also includes an ultraviolet disinfection lamp connected to the controller; the ultraviolet disinfection lamp is used to sterilize and disinfect the interior of the container.
[0008] Furthermore, the liquid level detection system also includes a display connected to the controller, and the display is used to display the water level in the container and the operating status information of the water pump.
[0009] Furthermore, the liquid level detection system also includes a wireless communication module connected to the controller.
[0010] Furthermore, the liquid level detection system also includes a remote monitoring terminal communicatively connected to the wireless communication module.
[0011] In a second aspect, an embodiment of the present invention provides a liquid level detection method, which is applied to the above-mentioned liquid level detection system, comprising:
[0012] S1. Obtain a preset detection waveform;
[0013] S2. Generating a corresponding detection signal according to the detection waveform and transmitting it to the first probe and obtaining feedback data of the first probe;
[0014] S3. Perform AD conversion on the feedback data to obtain the corresponding sampling value;
[0015] S4. After filtering the sampled value, the current water level of the container is calculated using a set calibration coefficient.
[0016] Furthermore, the method further includes: S5. performing data anti-shake compensation processing on the current water level to obtain a corrected water level.
[0017] Furthermore, the method also includes an analysis process of the calibration coefficient:
[0018] Obtain the sampled values and true values of water levels in several groups of containers;
[0019] Performing curve fitting based on the sampled value and the true value, and analyzing whether the goodness of fit meets the preset requirements;
[0020] If the goodness of fit meets the preset requirements, the calibration coefficients after fitting are recorded.
[0021] The beneficial effects that can be achieved by the present invention are as follows: the liquid level detection system provided by the present invention acquires data through an RC series circuit composed of a resistor, a first probe and a second probe and an AD conversion module of a controller to obtain corresponding sampling values; then, after filtering the acquired sampling values through a data filtering module, the current water level of the container is calculated through a calibration coefficient of a calibration module. Fewer components are used in the above process, and the water level can be detected by combining various calculation modules in the controller, which simplifies the system structure and reduces the cost while ensuring the accuracy of liquid level detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A schematic diagram of a topological structure of a liquid level detection system provided by an embodiment of the present invention;
[0024] Figure 2 A flow chart of a liquid level detection method provided in an embodiment of the present invention.
[0025] Icons: 10-liquid level detection system; 100-controller; 110-AD conversion module; 120-data filtering module; 130-calibration module; 140-data compensation module; 200-first probe; 300-second probe; 400-water pump; 500-ultraviolet disinfection lamp; 600-display; 700-wireless communication module; 800-remote monitoring terminal. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0027] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0028] Please see Figure 1 , Figure 1 A schematic diagram of the topological structure of a liquid level detection system provided in an embodiment of the present invention.
[0029] In one embodiment, an embodiment of the present invention provides a liquid level detection system 10, which includes a controller 100, the controller 100 includes an I / O interface, a data filtering module 120, a calibration module 130 and an AD conversion module 110; a resistor R connected to the I / O interface; a first probe 200 connected to the resistor R and the AD conversion module 110; a second probe 300 arranged opposite to the first probe 200; the first probe 200 and the second probe 300 are both arranged in a container to be measured water level, and the second probe 300 is grounded; the controller 100 is used to output a preset detection waveform through the I / O interface and detect the sampled value obtained by the AD conversion module 110; the data filtering module 120 is used to filter the sampled value; the calibration module 130 is used to calculate the current water level of the container by a set calibration coefficient. Exemplarily, the controller 100 can use a single-chip microcomputer (such as an STM32 single-chip microcomputer); the first probe 200 and the second probe 300 can use U-shaped probes.
[0030] In the above implementation process, the controller 100 can input a preset detection waveform to the first probe 200 through the I / O interface, and at the same time detect the sampling value of the first probe 200 obtained by the AD conversion module 110, and then filter the sampling value through the data filtering module 120, and calculate the current water level of the container through the calibration coefficient in the calibration module 130.
[0031] In one embodiment, the controller 100 further includes a data compensation module 140; after the calibration module 130 calculates the current water level of the container through the set calibration coefficient, the data compensation module 140 performs data compensation processing on the current water level to obtain a corrected water level. The accuracy of water level detection can be further improved by setting the data compensation module 140. Exemplarily, the data compensation module 140 can use various types of jitter compensation algorithms that are currently widely used to correct the current water level.
[0032] In one embodiment, the liquid level detection system 10 also includes a water pump 400 connected to the controller 100; and a water pipe connected between the water pump 400 and the container; the controller 100 is also used to control the switch of the water pump 400 by correcting the water level, thereby controlling the water level in the container.
[0033] In the above implementation process, the water pump 400 is provided to meet the needs of some scenarios where water needs to be replenished in the container, and at the same time, the water level can be detected in real time.
[0034] In one embodiment, the liquid level detection system 10 further includes an ultraviolet disinfection lamp 500 connected to the controller 100; the ultraviolet disinfection lamp 500 is used to sterilize and disinfect the interior of the container.
[0035] In the above implementation process, the liquid level detection system 10 is also provided with an ultraviolet disinfection lamp 500, through which the inside of the container can be sterilized and disinfected, making the water in the container cleaner.
[0036] In one embodiment, the liquid level detection system 10 further includes a display 600 connected to the controller 100 , and the display 600 is used to display the water level in the container and the operating status information of the water pump 400 .
[0037] In the above implementation process, in order to facilitate the user to view the water level in the container in real time, the controller 100 can also be connected to a display 600, through which the water level in the container can be displayed in real time. At the same time, the controller 100 can also obtain the operating status information of the water pump 400 and display it on the display 600.
[0038] In one embodiment, the liquid level detection system 10 further includes a wireless communication module 700 connected to the controller 100. Exemplarily, the wireless communication module 700 may be a WiFi module, a Bluetooth module, a 4G communication module, a 5G communication module, or the like.
[0039] Through the above implementation, the controller 100 can send the system operation data to the remote device through the wireless communication module 700, so as to facilitate the remote monitoring of the liquid level detection system 10.
[0040] Exemplarily, the liquid level detection system 10 further includes a remote monitoring terminal 800 that is communicatively connected to the wireless communication module 700. The remote monitoring terminal 800 can be used to monitor multiple liquid level detection systems 10, which is more convenient to use.
[0041] Specifically, the remote monitoring terminal 800 can be a computer terminal or a mobile terminal (such as a user's mobile phone, tablet computer, etc.), and the user can make a choice according to actual usage requirements.
[0042] Please see Figure 2 , Figure 2 A flow chart of a liquid level detection method provided in an embodiment of the present invention.
[0043] In one implementation, an embodiment of the present invention further provides a liquid level detection method for the above-mentioned liquid level detection system, the specific contents of which are as follows.
[0044] S1. Obtain the preset detection waveform.
[0045] Specifically, the user can manually set the detection waveform to be used and set the corresponding frequency. The controller generates the corresponding waveform by obtaining the information configured by the user.
[0046] S2. Generate a corresponding detection signal according to the detection waveform and transmit it to the first probe to obtain feedback data of the first probe.
[0047] S3. Perform AD conversion on the feedback data to obtain corresponding sampling values.
[0048] Specifically, the controller can collect feedback data through the AD conversion module, collect the effective value in each cycle, collect a certain number of original values in one collection cycle, and perform data filtering on them to obtain a filtered value of an effective collected AD value = the original value. Each command will trigger the collection of a certain number of effective AD values.
[0049] S4. After filtering the sampled value, the current water level of the container is calculated using a set calibration coefficient.
[0050] After the sampled value is obtained, it can be filtered and then the current water level of the container can be calculated by the set calibration coefficient.
[0051] Specifically, in the filtering process, the sampling frequency is T, the original value is x, and the effective value is y. In one cycle, n groups of analog quantities are collected (here Fn=T is required), where 'F' represents the frequency of the detection waveform, and the number of cycles collected is m, that is, m groups of observation data (x iraw ,x ierr ), raw is the original value within the cycle, err is the deviation value within the cycle, and the calculation equation of the sampling effective value is:
[0052]
[0053] The solution is to obtain the sampling effective value y, where the effective value is the sampling value after secondary filtering. The effective value is calibrated to obtain the current water level.
[0054] In one implementation, the method further includes: S5. performing data anti-shake compensation processing on the current water level to obtain a corrected water level.
[0055] Specifically, during the anti-shake compensation process, various types of jitter compensation algorithms currently in wide use may be used to correct the current water level. The specific compensation algorithm may be selected according to actual needs.
[0056] In one embodiment, the above method also includes: an analysis process of the calibration coefficient: obtaining several groups of sampled values and true values of the water level in the container; performing curve fitting based on the sampled values and the true values, and analyzing whether the goodness of fit meets the preset requirements; if the goodness of fit meets the preset requirements, recording the calibration coefficient after fitting.
[0057] Specifically, the following formula can be used to analyze whether the goodness of fit meets the preset requirements:
[0058]
[0059] In the above formula, R 2 represents the goodness of fit; m represents the number of cycles collected; s i represents the i-th sampling value; r i Represents the true value corresponding to the i-th sampling value; Represents the mean of all sample values; Represents the mean of all true values.
[0060] In summary, the embodiment of the present invention provides a liquid level detection system and method, including a controller, the controller including an I / O interface, a data filtering module, a calibration module and an AD conversion module; a resistor connected to the I / O interface; a first probe connected to the resistor and the AD conversion module; a second probe arranged opposite to the first probe; the first probe and the second probe are both arranged in a container of a water level to be measured, and the second probe is grounded; the controller is used to output a preset detection waveform through the I / O interface and detect the sampled value obtained by the AD conversion module; the data filtering module is used to filter the sampled value; the calibration module is used to calculate the current water level of the container through a set calibration coefficient. In the above manner, the system structure is simplified and the cost is reduced while ensuring the accuracy of liquid level detection.
[0061] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A liquid level detection system, characterized in that: The invention comprises a controller, wherein the controller comprises an I / O interface, a data filtering module, a calibration module and an AD conversion module; a resistor connected to the I / O interface; a first probe connected to the resistor and the AD conversion module; a second probe arranged opposite to the first probe; the first probe and the second probe are both arranged in a container of a water level to be measured, and the second probe is grounded; the controller is used to output a preset detection waveform through the I / O interface and detect the sampling value obtained by the AD conversion module; the data filtering module is used to filter the sampling value; the calibration module is used to calculate the current water level of the container through a set calibration coefficient; The controller further includes a data compensation module; after the calibration module calculates the current water level of the container through the set calibration coefficient, the data compensation module performs data compensation processing on the current water level to obtain a corrected water level; specifically: performing data anti-shake compensation processing on the current water level to obtain a corrected water level; The analysis process of the calibration coefficient is as follows: Obtain the sampled values and true values of water levels in several groups of containers; Performing curve fitting based on the sampled value and the true value, and analyzing whether the goodness of fit meets the preset requirements; If the goodness of fit meets the preset requirements, the calibration coefficients after fitting are recorded.
2. The liquid level detection system according to claim 1, characterized in that: The liquid level detection system also includes a water pump connected to the controller; and a water pipe connected between the water pump and the container; the controller is also used to control the switch of the water pump through the correction water level, thereby controlling the water level in the container.
3. The liquid level detection system according to claim 1, characterized in that: The liquid level detection system also includes an ultraviolet disinfection lamp connected to the controller; the ultraviolet disinfection lamp is used to sterilize and disinfect the interior of the container.
4. The liquid level detection system according to claim 2, characterized in that: The liquid level detection system further comprises a display connected to the controller, wherein the display is used to display the water level in the container and the operating status information of the water pump.
5. The liquid level detection system according to claim 1, characterized in that: The liquid level detection system also includes a wireless communication module connected to the controller.
6. The liquid level detection system according to claim 5, characterized in that: The liquid level detection system also includes a remote monitoring terminal that is communicatively connected to the wireless communication module.
7. A liquid level detection method, applied to the liquid level detection system according to any one of claims 1 to 6, characterized in that: include: S1. Obtain a preset detection waveform; S2. Generating a corresponding detection signal according to the detection waveform and transmitting it to the first probe and obtaining feedback data of the first probe; S3. Perform AD conversion on the feedback data to obtain the corresponding sampling value; S4. After filtering the sampled values, the current water level of the container is calculated by the set calibration coefficient; the analysis process of the calibration coefficient is as follows: obtaining a number of sampled values and true values of the water level in the container; performing curve fitting according to the sampled values and the true values, and analyzing whether the goodness of fit meets the preset requirements; if the goodness of fit meets the preset requirements, recording the calibration coefficient after fitting; S5. Perform data anti-shake compensation processing based on the current water level to obtain a corrected water level.
Citation Information
Patent Citations
Water level detecting circuit, device and method
CN102155969A
Liquid level detection system
CN215811134U