Liquid level detection device and method

By using MCU and liquid level probe to alternate output voltages in the liquid level detection device, combined with real-time compensation of temperature sensors, the problems of circuit complexity and high cost in the existing liquid level detection technology are solved, and flexibility, accuracy and stability are achieved liquid level detection.

CN119164462APending Publication Date: 2024-12-20TBB POWER XIAMEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411292360.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing liquid level detection technology has problems such as complex topology of measurement circuits, high cost of detection devices, and inflexible measurement methods, and is especially susceptible to temperature, pressure and electromagnetic interference.

Method used

Using a liquid level detection device including an MCU, a plurality of liquid level probes of different heights and a common probe, the high and low voltages are output alternately through the common pin and the liquid level pin of the MCU to collect the voltage of the second pin to detect the liquid level. Height and real-time temperature compensation is performed in combination with temperature sensors, simplifying circuit topology and reducing costs.

Benefits of technology

It realizes extremely simplified liquid level detection, simple circuit topology and low hardware cost, reduces the impact on temperature, pressure and electromagnetic interference, improves detection accuracy and stability, and extends the service life of the probe.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119164462A_ABST
    Figure CN119164462A_ABST
Patent Text Reader

Abstract

The invention discloses a liquid level detection device and method. The device comprises an MCU, a plurality of liquid level probes with different heights and a common probe. The MCU comprises a public pin and a plurality of pairs of liquid level pins, each pair of liquid level pins comprises a first pin and a second pin, and the second pin is an AD pin; the MCU is connected with the public probe through the public pin and connected with the liquid level probe through the liquid level pin, and one liquid level probe is connected with the first pin and the second pin of the pair of liquid level pins respectively; the MCU alternately outputs high and low voltages to the liquid level probe through the public pin and the first pin, and detects whether the liquid level reaches the height corresponding to the liquid level probe or not by collecting the voltage of the second pin. The measuring device is simple in circuit topology and low in cost; when the device is used for liquid level measurement, different liquids can be detected by setting a threshold value; the device is not easily influenced by temperature, pressure, electromagnetic interference and the like; and mutual influence among different gears can be prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of liquid level measurement, and in particular to a liquid level detection device and method. Background Art

[0002] In daily life, there are many devices for storing liquids (such as water tanks in RVs, water tanks for water heaters / water purifiers, and boiler lights for industrial applications). It is necessary to detect the liquid level height of the device and timely understand the liquid level height information in order to perform corresponding control and alarm operations. Therefore, a reliable liquid level detection device must be used to detect the liquid level height in real time. The commonly used detection methods or devices and their defects are summarized as follows: magnetostriction method, which is costly and the float is easy to get stuck; radar, which is easily disturbed by high-frequency signals, microwave signals, temperature, pressure, etc., and has high maintenance costs; ultrasonic and infrared are easily disturbed by external temperature, pressure, etc., and have high costs; pressure type, which is easily affected by temperature and has high costs; capacitance type, which is easily restricted by the type of liquid, must be calibrated in detail for different types of liquids, is complicated to use, and is greatly affected by temperature interference; direct current detection method, the electrodes are electroplated and electrolyzed, and the electrodes are easily corroded and damaged, which eventually leads to the failure of the detection circuit. At present, there are methods that use alternating current detection, but there are generally defects such as complex measurement circuit topology, high cost of detection devices, and inflexible measurement methods. Summary of the invention

[0003] The purpose of the present invention is to solve the problems of complex measurement circuit topology, high cost of detection device, inflexible measurement method and the like in the prior art of liquid level measurement.

[0004] The technical solution adopted by the present invention to solve the technical problem is as follows: a liquid level detection device is provided, including an MCU, a plurality of liquid level probes of different heights and a common probe; the MCU includes a common pin and a plurality of pairs of liquid level pins, each pair of liquid level pins includes a first pin and a second pin, wherein the second pin is an AD pin; the MCU is connected to the common probe through the common pin, and is connected to the liquid level probe through the liquid level pin, and a liquid level probe is connected to the first pin and the second pin of a pair of liquid level pins respectively;

[0005] The MCU outputs high and low voltages alternately to the liquid level probe through the common pin and the first pin, and detects whether the liquid level reaches the height corresponding to the liquid level probe by collecting the voltage of the second pin.

[0006] Preferably, a common resistor is connected in series between the common probe and the common pin.

[0007] Preferably, a first resistor is connected in series between each liquid level probe and the corresponding first pin; a second resistor is connected in series between each liquid level probe and the corresponding second pin; and each second pin is grounded via a capacitor;

[0008] Preferably, the MCU also includes a temperature pin connected to a temperature sensor.

[0009] Preferably, a temperature resistor is connected in series between the temperature pin and the temperature sensor.

[0010] The present invention also provides a liquid level detection method, based on any one of the liquid level detection devices described above, comprising the following steps:

[0011] The liquid level detection device is placed in a container whose liquid level is to be detected; wherein each liquid level probe is at a different height in the container, and the common probe is located at the bottom of the container;

[0012] The MCU selects the liquid level probes in a cyclic manner from high to low. Each time a liquid level probe is selected, AD sampling is performed on the voltage of the liquid level pin to which the liquid level probe is connected to obtain a detection voltage value, and the real-time liquid level height is determined according to the detection voltage value.

[0013] The real-time liquid level height is determined based on the detection voltage value, specifically: if the detection voltage value reaches the set threshold, it is determined that the liquid level in the container has reached the height gear corresponding to the liquid level probe; if the detection voltage value does not reach the set threshold, it is determined that the liquid level in the container has reached the height gear corresponding to the liquid level probe.

[0014] Preferably, the AD sampling of the voltage of the second pin connected to the liquid level probe is specifically as follows: VCC and 0V are alternately output for the same time to the common pin and the first pin connected to the liquid level probe; the first pin connected to the liquid level probe other than the liquid level probe is set to a high impedance state; and the AD sampling of the voltage of the second pin connected to the liquid level probe is performed.

[0015] Preferably, the threshold value is set according to different liquid types and different liquid concentrations.

[0016] Preferably, the set threshold is used for real-time temperature compensation according to different liquid temperatures.

[0017] Preferably, the temperature compensation is specifically as follows: during the detection process, the MCU continuously detects the liquid temperature through a temperature sensor connected to a temperature pin, and performs real-time temperature compensation on a set threshold according to the influence of the liquid temperature on the liquid to be tested; the temperature sensor is placed at the bottom of the container.

[0018] The present invention has the following beneficial effects:

[0019] (1) The present invention adopts a very simplified AC method for liquid level detection, with a simple circuit topology, low hardware cost, and is not easily affected by temperature, pressure, electromagnetic interference, etc.;

[0020] (2) The threshold value for determining the liquid level of the present invention can be set according to the type and concentration of the liquid. Due to the different characteristics of the liquid, the conductivity may be different at different temperatures, which may cause the sampled AD value to change. Therefore, the temperature of the liquid is detected and the threshold value is compensated in real time according to the influence of the liquid temperature on the liquid to be tested.

[0021] (3) In the process of collecting AD values ​​of the present invention, VCC and 0V appear alternately on the probe for the same time, so that the oxidation reaction and reduction reaction on the probe reach the same time, which can greatly slow down the corrosion of the probe, thereby extending the service life of the device;

[0022] (4) During the detection process of the present invention, the pin corresponding to a certain gear position enters the output state only when the liquid level of the gear position is detected (for example, when detecting the water level of probe 1, PC0 and PA0 are output alternately, and the pins of other gear positions are set to a high impedance state). This can avoid the influence of the pin detection of the gear position when the pins of other gear positions are in the output state at the same time, thereby improving the accuracy and stability of the detection.

[0023] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a schematic diagram of a device according to an embodiment of the present invention;

[0025] Figure 2 A method step diagram of an embodiment of the present invention;

[0026] Figure 3 MCU detection flow chart of an embodiment of the present invention;

[0027] Figure 4 4 is a detection logic timing diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0028] See also Figure 1As shown, it is a schematic diagram of the device of an embodiment of the present invention, including an MCU, a common probe, N liquid level probes n and a temperature sensor; n∈[1,N], N can be increased or decreased according to actual measurement needs, and can be infinite in theory. The MCU is connected to the power supply through the VCC pin and grounded through the GND pin. A capacitor C1000 is connected in series between the VCC pin and the GND pin. The common pin PC0 of the MCU is connected to the common probe through a resistor R1002, and the temperature pin PD0 of the MCU is connected to the temperature sensor through a resistor R1003; the N liquid level probes n include liquid level probes 1 to liquid level probes N with different heights; each liquid level probe n is connected to the first pin PAn of the MCU through a resistor R2n, and is connected to the second pin PBn of the MCU through a resistor R1n. The second pin PBn is also grounded through a capacitor C1n. R1n and C1n filter the liquid level voltage to improve the stability of voltage sampling.

[0029] Specifically, MCU is a general-purpose microcontroller (single-chip microcomputer, DSP, etc.), regardless of manufacturer and model, as long as it has AD function and IO port function.

[0030] Specifically, the second pin PBn and the temperature pin PD0 are AD pins. The use of AD pins can flexibly set the detection threshold. If high and low levels are used for judgment, there can only be one fixed level, and the intermediate voltage cannot be detected. For example, the high-level judgment voltage threshold of a certain MCU is >0.7*VCC, and the low-level judgment voltage threshold is <0.3*VCC. Only >0.7*VCC is judged as a high level, and <0.3*VCC is judged as a low level. When the resistance of the liquid is different, resulting in the detection voltage being between 0.3*VCC and 0.7*VCC, the MCU cannot correctly judge whether it is a high level or a low level, resulting in an error in the liquid level judgment. AD can collect all voltages between 0 and VCC, and can flexibly set the liquid level threshold through communication / liquid crystal and other means. Thereby improving the accuracy of liquid level detection.

[0031] See also Figure 2 and Figure 3 As shown, it is a method step diagram and MCU detection flow chart of an embodiment of the present invention, which includes the following steps:

[0032] S201, placing the liquid level detection device in a container whose liquid level is to be detected; wherein each liquid level probe is at a different height in the container, and the common probe is located at the bottom of the container;

[0033] S202, the MCU selects the liquid level probes in a cyclic manner from high to low, and selects a liquid level probe each time, performs AD sampling on the voltage of the liquid level pin connected to the liquid level probe to obtain a detection voltage value, and determines the liquid level height according to the detection voltage value;

[0034] Specifically, S202 is as follows: if the detection voltage value reaches the set threshold, it is determined that the liquid level in the container has reached the height gear corresponding to the liquid level probe; if the detection voltage value does not reach the set threshold, the next liquid level probe is continuously selected for AD sampling until the sampled detection voltage value reaches the set threshold, and it is determined that the liquid level in the container has reached the height gear corresponding to the liquid level probe; if the voltages of all second pins have completed AD sampling and all detection voltage values ​​have not reached the set threshold, it is determined that the liquid level in the container has not reached the lowest liquid level height that can be measured by the liquid level detection device.

[0035] Specifically, the AD sampling of the voltage of the second pin connected to the liquid level probe comprises the following steps:

[0036] Step 1: In the first detection cycle T1, PC0 and PA0 output VCC and 0V alternately for the same time, and other pins such as PA1~PAn are set to high impedance. AD sampling is performed on the voltage on the PB0 pin, and sliding filtering is performed to eliminate interference.

[0037] Step 2: In the second detection cycle T2, PC0 and PA1 output VCC and 0V alternately for the same time, and the first pin except PA1 is set to high impedance. AD sampling is performed on the voltage on the PB1 pin, and sliding filtering is performed to eliminate interference.

[0038] …

[0039] Step N: Similarly, in the Nth detection cycle TN, PC0 and PAN alternately output VCC and 0V for the same time, and the first pin except PAN is set to high impedance. AD sampling is performed on the voltage on the PBN pin, and sliding filtering is performed to eliminate interference.

[0040] Repeat steps 1 to n, and continuously sample the AD value to detect the change of liquid level in real time. For the specific detection logic sequence, see Figure 4 ; When the sampled liquid gear AD value exceeds the set threshold, it is determined that there is liquid in this gear.

[0041] Specifically, the detection process continuously collects the temperature of the liquid through PD0. Due to the different characteristics of the liquid, the conductivity may be different at different temperatures, resulting in changes in the sampled AD value. Therefore, the temperature of the liquid can be used to compensate for the gear setting threshold.

[0042] In this detection method, VCC and 0V will appear alternately at the same time on each probe, and the oxidation reaction and reduction reaction on each probe will reach the same time, which can greatly slow down the corrosion of the probe, thereby extending the service life of the probe. At the same time, when the liquid level of a certain gear is detected, the pin corresponding to the gear will enter the output state (for example, when detecting the water level of probe 1, PC0 and PA0 are output alternately, and the pins of other gears are set to high impedance). This can avoid the impact of the pin detection of the gear when the pins of other gears are in the output state at the same time, thereby improving the accuracy and stability of the detection.

[0043] It can be seen that the circuit topology of the present invention is simple and low in cost; different liquids can be detected by setting thresholds; it is not easily affected by temperature, pressure, electromagnetic interference, etc.; and mutual influence between different gears can be prevented.

[0044] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A liquid level detection device, It is characterized in that The invention comprises an MCU, a plurality of liquid level probes of different heights and a common probe; the MCU comprises a common pin and a plurality of pairs of liquid level pins, each pair of liquid level pins comprises a first pin and a second pin, wherein the second pin is an AD pin; the MCU is connected to the common probe via the common pin, and to the liquid level probe via the liquid level pin, and a liquid level probe is connected to the first pin and the second pin of a pair of liquid level pins respectively; The MCU outputs high and low voltages alternately to the liquid level probe through the common pin and the first pin, and detects whether the liquid level reaches the height corresponding to the liquid level probe by collecting the voltage of the second pin.

2. The liquid level detection device according to claim 1, It is characterized in that A common resistor is also connected in series between the common probe and the common pin.

3. The liquid level detection device according to claim 1, It is characterized in that A first resistor is connected in series between each liquid level probe and the corresponding first pin; a second resistor is connected in series between each liquid level probe and the corresponding second pin; and each second pin is grounded via a capacitor.

4. The liquid level detection device according to claim 1, It is characterized in that The MCU also includes a temperature pin connected to a temperature sensor.

5. The liquid level detection device according to claim 4, It is characterized in that A temperature resistor is also connected in series between the temperature pin and the temperature sensor.

6. A liquid level detection method, based on the liquid level detection device according to any one of claims 1 to 5, It is characterized in that The following steps are involved: The liquid level detection device is placed in a container whose liquid level is to be detected; wherein each liquid level probe is at a different height in the container, and the common probe is located at the bottom of the container; The MCU selects the liquid level probes in a cyclic manner from high to low. Each time a liquid level probe is selected, AD sampling is performed on the voltage of the liquid level pin to which the liquid level probe is connected to obtain a detection voltage value, and the real-time liquid level height is determined according to the detection voltage value. The real-time liquid level height is determined based on the detection voltage value, specifically: if the detection voltage value reaches the set threshold, it is determined that the liquid level in the container has reached the height gear corresponding to the liquid level probe; if the detection voltage value does not reach the set threshold, it is determined that the liquid level in the container has reached the height gear corresponding to the liquid level probe.

7. The liquid level detection method according to claim 6, It is characterized in that The AD sampling of the voltage of the second pin connected to the liquid level probe is specifically as follows: VCC and 0V are alternately output for the same time to the common pin and the first pin connected to the liquid level probe; the first pin connected to the liquid level probe other than the liquid level probe is set to a high impedance state; and the AD sampling of the voltage of the second pin connected to the liquid level probe is performed.

8. The liquid level detection method according to claim 6, It is characterized in that The threshold value is set according to different liquid types and different liquid concentrations.

9. The liquid level detection method according to claim 6, It is characterized in that The set threshold value performs real-time temperature compensation according to different liquid temperatures.

10. The liquid level detection method according to claim 9, It is characterized in that The temperature compensation is specifically as follows: during the detection process, the MCU continuously detects the liquid temperature through a temperature sensor connected to a temperature pin, and performs real-time temperature compensation on a set threshold according to the influence of the liquid temperature on the liquid to be detected; the temperature sensor is placed at the bottom of the container.