Capacitive continuous liquid level measuring device and method
By combining the main control module, sensing capacitor, discharge reset module and regulated charging input module, liquid level measurement is achieved using RC charging time parameters. This solves the problems of low accuracy, high cost and limited range in existing liquid level measurement technologies, and realizes high-precision, low-cost and strong anti-interference liquid level detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN KANGLIXIN ELECTRONIC CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-04-10
AI Technical Summary
Existing liquid level measurement technologies suffer from low accuracy, high cost, limited range, and insufficient reliability, especially float-type and capacitive liquid level gauges, which have deficiencies in reliability and measurement accuracy.
The capacitive liquid level measuring device consists of a main control module, a sensing capacitor, a discharge reset module, a regulated charging input module, and a voltage comparison unit. It achieves liquid level measurement through RC charging time parameters, accurately captures the time point when the sensing capacitor reaches the preset potential during charging using the voltage comparison unit, and obtains the liquid level data by combining linear conversion.
It improves the accuracy and stability of liquid level measurement, reduces costs, expands the measurement range, simplifies circuit design, enhances anti-interference capabilities, and realizes low-cost, simple-structure continuous liquid level detection.
Smart Images

Figure CN121829707A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of liquid level measurement, and in particular to a capacitive continuous liquid level measurement device and method. Background Technology
[0002] Currently, liquid level detection is widely used in industrial production and daily life. Existing liquid level detection methods mainly include float-type, ultrasonic, and capacitive types. Float-type liquid level gauges have a simple structure, but rely on mechanical contacts, making them susceptible to wear, jamming, and environmental corrosion, resulting in low reliability and difficulty in achieving digital output, thus limiting measurement accuracy. While ultrasonic liquid level gauges offer advantages such as non-contact measurement and long lifespan, their measurement accuracy is significantly affected by environmental interference, and their range is limited by structural characteristics, making it difficult to meet the needs of high-precision or large-range liquid level monitoring. Existing capacitive liquid level measurement schemes mainly fall into two categories: one uses an oscillating circuit to utilize changes in capacitance to cause changes in oscillation frequency, and then obtains liquid level information through frequency counting. This scheme has complex circuitry, poor anti-interference capabilities, and limited measurement accuracy. The other uses a dedicated capacitance measurement chip to achieve liquid level measurement, but suffers from high cost and limitations in range and scalability due to chip specifications. Summary of the Invention
[0003] To address the problems of low accuracy, high cost, limited range, and insufficient reliability in existing liquid level measurement methods, this application provides a capacitive continuous liquid level measurement device and method.
[0004] A capacitive continuous liquid level measuring device, the capacitive continuous liquid level measuring device comprising: Main control module; The sensing capacitor, placed in the liquid level measurement space, can generate corresponding electrical signal changes as the liquid level height changes; A discharge reset module, wherein the enable signal input terminal of the discharge reset module is connected to the control signal drive terminal of the main control module, and the power input terminal of the discharge reset module is connected to the positive node of the sensing capacitor, so as to discharge the sensing capacitor to the initial potential. A regulated charging input module, wherein the power output terminal of the regulated charging input module is connected to the positive terminal of the sensing capacitor to output a regulated power supply to power the sensing capacitor; A voltage comparison unit is connected between the jump signal input terminal of the main control module and the positive terminal of the sensing capacitor. When the sensing capacitor is charged to a preset potential, the voltage comparison unit generates a corresponding jump signal and sends it to the main control module, thereby enabling the main control module to calculate the time parameter from the initial potential to the preset potential, and perform linear conversion using the time parameter to generate the liquid level data of the current liquid level in the liquid level measurement space.
[0005] By adopting the above technical solution and using an integrated measurement architecture consisting of a main control module, sensing capacitor, discharge reset module, voltage regulated charging input module, and voltage comparison unit, the capacitance change caused by liquid level change is stably converted into a repeatable RC charging time parameter. This avoids the frequency drift problem of traditional oscillation method and is not limited by the range of dedicated capacitance measurement chip. Therefore, it significantly improves the accuracy, stability, and range expansion capability of liquid level measurement, and realizes a continuous liquid level detection method with lower cost and simpler structure.
[0006] Preferably, the voltage comparison unit includes a comparator U2, resistors R1, R2, and R5. The non-inverting input of the comparator U2 is connected to the first end of the resistor R5, the second end of the resistor R5 is connected to the positive terminal of the sensing capacitor, the inverting input of the comparator U2 is grounded, the output of the comparator U2 is connected to the first end of the resistor R2, the second end of the resistor R2 is connected to the switching signal input of the main control module, and the resistor R1 is connected between the common node between the second end of the resistor R2 and the switching signal input of the main control module and ground.
[0007] By adopting the above technical solution and introducing a voltage comparison unit composed of a comparator and a voltage divider network, the moment when the sensing capacitor reaches the threshold point during charging can be accurately captured with high input impedance and low disturbance, thereby enabling the time measurement process to have higher triggering accuracy and repeatability. At the same time, the RC matching structure between the output side and the main control module effectively suppresses noise triggering and glitches, improving the reliability of determining the threshold arrival time.
[0008] Preferably, the voltage comparison unit further includes a resistor R4 and a parallel filter network composed of a resistor R3 and a capacitor C1. The first end of the resistor R4 is connected to the regulated power supply, the second end of the resistor R4 is connected to the first end of the parallel filter network, the second end of the parallel filter network is grounded, and the common node between the second end of the resistor R4 and the first end of the parallel filter network is connected to the inverting input terminal of the comparator U2.
[0009] By adopting the above technical solution, and configuring a parallel filter network consisting of resistors and capacitors at the inverting input of the comparator, and driving it through a current-limiting resistor from a regulated power supply, the comparator has higher noise immunity and voltage stability when determining the threshold voltage. This structure can filter out transient spikes and ripple fluctuations during the charging process, ensuring the retention and consistency of the threshold potential judgment point, thereby further improving the accuracy of time measurement and the anti-interference performance of the system.
[0010] Preferably, the discharge reset module includes a MOSFET Q1, a resistor R7, and a resistor R8. The first end of the resistor R8 is connected to the positive terminal of the sensing capacitor, the second end of the resistor R8 is connected to the first conducting terminal of the MOSFET Q1, the second end of the MOSFET Q1 is grounded, the controlled terminal of the MOSFET Q1 is connected to the control signal driving terminal of the main control module, and the resistor R7 is connected between the common node between the controlled terminal of the MOSFET Q1 and the control signal driving terminal of the main control module and ground.
[0011] By adopting the above technical solution, and introducing a discharge reset module consisting of a MOS transistor and a current-limiting resistor at the positive terminal of the sensing capacitor, the capacitor is reliably discharged to a determined initial potential before the start of each charging process, thereby avoiding measurement deviations caused by residual charge and ensuring that all charging processes can start from the same electrical starting point. This not only improves the linear consistency of repeated measurements, but also significantly improves the stability and long-term reliability of liquid level estimation.
[0012] Preferably, the voltage-regulated charging input module includes a resistor R6, a voltage regulator chip U1, a capacitor C3, and a capacitor C4. The power input terminal of the voltage regulator chip U1 is connected to a 5V power supply, the power output terminal of the voltage regulator chip U1 is connected to the first terminal of the resistor R6, the second terminal of the resistor R6 is connected to the positive terminal of the sensing capacitor, and the capacitors C3 and C4 are respectively connected between the common points between the power output terminal of the voltage regulator chip U1 and the first terminal of the resistor R6 and ground.
[0013] By adopting the above technical solution, and using a voltage-stabilized charging module composed of a voltage regulator chip, a current-limiting resistor, and a filter capacitor, a stable power supply with low ripple and low noise is provided for the RC charging process. This ensures that the charging curve of the sensing capacitor maintains good monotonicity and consistency, and prevents charging time deviation caused by power fluctuations. As a result, the accuracy of RC time measurement is guaranteed, and the liquid level calculation results are more accurate, stable, and predictable.
[0014] A measurement method for a capacitive continuous liquid level measuring device, applied in a capacitive continuous liquid level measuring device, the measurement method comprising: The discharge reset module is turned on to discharge and reset the sensing capacitor to its initial potential. If the sensing capacitor is detected to be at its initial potential, the discharge reset module is turned off, and the sensing capacitor is charged through the regulated charging input module so that the sensing capacitor starts charging from its initial potential under the action of a fixed resistor and a fixed voltage, and the charging timer starts. Determine whether the sensing capacitor has reached the preset potential. If it has, stop the charging timer and record the time parameter from the initial potential to the preset potential. A set of calibration parameters is determined for the liquid level measurement space when it is empty and full. Based on the linear conversion rule, the liquid level data of the current liquid level of the liquid level measurement space is calculated according to the set of calibration parameters and the time parameter.
[0015] By adopting the above technical solution, and by performing the measurement according to the continuous process of discharge reset—stable charging—threshold determination—time counting—linear conversion, the capacitance change can be stably and accurately captured in time form. And by performing linear conversion through the calibration parameters of empty liquid level and full liquid level, the system has the advantage of rapid deployment without knowing the dielectric constant of the liquid. At the same time, it achieves the overall effect of low cost, wide range, and continuous real-time liquid level measurement.
[0016] Preferably, the step of determining whether the sensing capacitance has reached the preset potential includes: Obtain the charging voltage at the non-inverting input terminal of the voltage comparator unit; Determine whether the charging voltage reaches the threshold voltage of the inverting input terminal in the voltage comparison unit for the first time; If the threshold voltage is reached for the first time, a voltage verification process is executed to generate the corresponding verification result. If the verification result indicates that the verification is normal, a jump signal is output. When the main control module receives the jump signal, it determines that the sensing capacitor has reached the preset potential.
[0017] By adopting the above technical solution, a dual judgment mechanism of first threshold arrival point capture + verification process is introduced before judging the arrival of the threshold potential, so that the threshold trigger no longer depends on the single sampling result, effectively avoiding false triggering caused by electromagnetic interference, ripple fluctuation or transient spikes; this mechanism ensures that only real, physically meaningful threshold arrival events can be used for timing termination, improving the reliability, anti-interference ability and long-term stability of liquid level estimation.
[0018] Preferably, the step of performing the voltage verification process to generate the corresponding verification result includes: The charging voltage was collected at multiple sampling time points before and after the first arrival at the threshold voltage; Calculate the voltage difference between the charging voltages at two adjacent sampling time points, and calculate the corresponding voltage change slope based on each voltage difference; Determine whether the slope of the voltage change reaches a preset slope. If it reaches the preset slope, generate a verification result to indicate that the verification is normal. If it does not reach the preset slope, generate a verification result to indicate that the verification is abnormal.
[0019] By adopting the above technical solution, multiple voltage sampling points are collected near the first threshold voltage, the slope of the charging voltage change over time is calculated, and it is compared with a set threshold. This enables the system to identify the real RC charging trend and abnormal noise triggering, thereby distinguishing between valid and invalid triggering, realizing the authenticity verification of threshold judgment events, significantly reducing the false judgment rate, and further improving the accuracy and reliability of liquid level measurement results.
[0020] Preferably, the dynamic adjustment step of the threshold voltage includes: Before the charging voltage reaches the threshold voltage, temperature data is acquired over multiple consecutive cycles, and the corresponding temperature drift rate is calculated based on the temperature data. The corresponding equivalent time constant offset is determined based on the temperature drift rate. The corresponding threshold point is calculated based on the equivalent time constant offset.
[0021] By adopting the above technical solution, temperature data for multiple cycles is collected in real time before the threshold is reached. The temperature drift rate is analyzed and the offset of the RC time constant is estimated accordingly. This allows the threshold potential to be dynamically corrected in advance according to changes in ambient temperature, thereby compensating for the systematic offset caused by temperature to the resistor, sensing capacitor, and comparator reference point. This predictive threshold compensation significantly improves the stability and measurement consistency of the system under wide temperature conditions, making the liquid level measurement unaffected by seasonal or ambient temperature changes.
[0022] Preferably, the step of calculating the corresponding temperature drift rate based on the temperature data includes: Differential calculations are performed on temperature data collected in multiple consecutive measurement cycles to obtain the temperature change between adjacent measurement cycles. The temperature change is compared with the time interval between adjacent measurement cycles to generate a temperature drift rate that characterizes the temperature change trend.
[0023] By adopting the above technical solution, the temperature drift rate is calculated by differentially analyzing the temperature data from multiple consecutive measurement cycles and combining the cycle intervals. This enables the system to accurately grasp the dynamic trend of temperature changes, rather than relying solely on a single point temperature value. This trend-based judgment method can more realistically reflect the rate of change of ambient temperature, thereby providing a more accurate input for subsequent time constant offset estimation, improving the accuracy of dynamic threshold compensation and the overall robustness of the liquid level measurement system.
[0024] In summary, this application includes at least one of the following beneficial technical effects: This application introduces an integrated liquid level measurement architecture, enabling direct, stable, and high-resolution time-quantified measurement of capacitance changes caused by liquid level variations. Instead of relying on traditional capacitance measurement chips or oscillation frequency methods, it employs an RC charging model consisting of a fixed resistor and a sensing capacitor. A controllable regulated power supply charges the sensing capacitor, and a discharge reset module forces the sensing capacitor to be uniformly initialized to a defined starting potential, ensuring a consistent and repeatable starting point for each charging process. A voltage comparison unit accurately detects the time point at which the sensing capacitor first reaches the preset potential during charging. This time parameter is used as a direct quantitative indicator of liquid level change, and the main control module performs time counting and linear conversion to obtain real-time data on continuous liquid levels. By transforming the capacitance measurement process into a time measurement problem—the time required to charge from zero potential to a threshold potential—the complexity of circuit design is significantly reduced. It eliminates the reliance on expensive and limited-specification dedicated capacitance measurement chips and avoids the inherent defects of oscillation circuits, such as drift and susceptibility to interference in high humidity and high noise environments, resulting in higher measurement accuracy and stronger stability. Meanwhile, since the entire function can be completed with only a general-purpose regulated power supply, fixed resistors, MOSFETs, comparators, and a low-performance MCU, the cost is significantly reduced and the scalability is enhanced. The sensing capacitor structure can be flexibly designed according to the shape of the container, greatly improving adaptability. It not only achieves continuous, linear, and calibrable liquid level measurement capabilities, but also has the advantages of strong anti-interference ability, measurement range not limited by chip specifications, and simple field deployment, fully overcoming the shortcomings of existing float-type, ultrasonic, and traditional capacitive liquid level detection solutions. Attached Figure Description
[0025] Figure 1 This is a flowchart of a capacitive continuous liquid level measuring device according to an embodiment of this application; Figure 2 This is a partial circuit diagram of the regulated charging input module in a capacitive continuous liquid level measuring device according to one embodiment of this application. Figure 3 This is a partial circuit diagram of the main control module, voltage comparison unit, and discharge reset module in a capacitive continuous liquid level measuring device according to one embodiment of this application. Figure 4 This is a schematic diagram of the specific structure of the sensing capacitor in a capacitive continuous liquid level measuring device according to one embodiment of this application. Figure 5 This is a schematic diagram illustrating the application scenario of the sensing capacitor in a capacitive continuous liquid level measuring device according to one embodiment of this application. Figure 6 This is a flowchart of a capacitive continuous liquid level measurement method according to an embodiment of this application.
[0026] Explanation of reference numerals in the attached diagram: 1. Connector female head; 2. Twisted pair wire; 3. Isolation bracket; 4. Metal plate. Detailed Implementation
[0027] The present application will be further described in detail below with reference to the accompanying drawings.
[0028] In one embodiment, such as Figure 1 As shown, this application discloses a capacitive continuous liquid level measuring device, which includes: Main control module; The sensing capacitor, placed in the liquid level measurement space, can generate corresponding electrical signal changes as the liquid level height changes; A discharge reset module, wherein the enable signal input terminal of the discharge reset module is connected to the control signal drive terminal of the main control module, and the power input terminal of the discharge reset module is connected to the positive node of the sensing capacitor, so as to discharge the sensing capacitor to the initial potential. A regulated charging input module, wherein the power output terminal of the regulated charging input module is connected to the positive terminal of the sensing capacitor to output a regulated power supply to power the sensing capacitor; A voltage comparison unit is connected between the jump signal input terminal of the main control module and the positive terminal of the sensing capacitor. When the sensing capacitor is charged to a preset potential, the voltage comparison unit generates a corresponding jump signal and sends it to the main control module, thereby enabling the main control module to calculate the time parameter from the initial potential to the preset potential, and perform linear conversion using the time parameter to generate the liquid level data of the current liquid level in the liquid level measurement space.
[0029] In this embodiment, the capacitive continuous liquid level measuring device comprises a main control module, a sensing capacitor, a discharge reset module, a regulated charging input module, and a voltage comparison unit, forming a complete RC charging liquid level detection circuit. These components work collaboratively through clearly defined electrical connections, forming a measurement system that uses capacitor charging time as the quantification basis for liquid level changes. The sensing capacitor is installed inside the liquid level measurement space, with its two terminals connected to the control circuit via wires. The positive terminal serves as the core signal node of the entire system, carrying the multi-channel coupling logic of the discharge reset module, the regulated charging input module, and the voltage comparison unit. The capacitance value of the sensing capacitor changes linearly and quantifiably with the change in liquid level within the container; this change is reflected in the difference in its charging speed.
[0030] To ensure that each measurement starts from the same point, the power input of the discharge reset module is directly connected to the positive terminal of the sensing capacitor, and its controlled terminal is driven by the control signal drive terminal of the main control module. When the main control module outputs a discharge command, the MOSFET is turned on, and the sensing capacitor discharges rapidly to near zero potential through the current-limiting resistor, completely releasing the remaining charge and ensuring that the next RC charging curve has uniform initial conditions. The power output of the voltage-regulated charging input module is also connected to the positive terminal of the sensing capacitor. This module consists of a voltage regulator chip, a current-limiting resistor, and a filter capacitor. After the discharge reset module is turned off, it provides a stable, low-noise charging power supply to the sensing capacitor, allowing the capacitor to perform a repeatable charging process according to an exponential law under the limitation of a fixed resistor, ensuring the stability and consistency of the charging curve.
[0031] The input of the voltage comparator unit is also connected to the positive terminal of the sensing capacitor to detect the real-time changes in the capacitor's charging voltage, which serves as the basis for determining whether a preset potential has been reached. The non-inverting input of the comparator is connected to the positive terminal via a resistor, enabling it to accurately sense the instantaneous potential of the sensing capacitor. The inverting input of the comparator is connected to a stable reference voltage or a reference signal processed by a filter network to form the comparison condition for determining when the threshold is reached. When the charging voltage of the sensing capacitor first exceeds the reference voltage, a distinct jump event is generated at the output of the comparator. This jump signal is then passed through an RC matching network and input to the jump signal input of the main control module to trigger the main control module to stop timing and record the time elapsed from the initial potential of the capacitor to the preset potential.
[0032] The main control module plays a crucial role in the entire device, handling core functions such as measurement process scheduling, discharge and charging process control, time counter start and stop, transition signal acquisition, and data processing. After controlling the discharge reset module to reset the capacitor, the main control module closes the discharge path and starts the timing mechanism. Simultaneously, driven by the regulated charging input module, it causes the sensing capacitor to begin charging according to a fixed time constant. When the voltage comparison unit outputs a transition signal, the main control module immediately stops counting and performs a linear conversion between the recorded time parameter and the stored empty and full liquid level calibration parameters to obtain the liquid level data corresponding to the current liquid level. Because the geometric structure of the sensing capacitor and the dielectric properties of the liquid cause its capacitance value to change approximately linearly with the liquid level height, this time parameter does not need to be converted to an absolute capacitance value and can be directly used as a quantitative basis for liquid level estimation. This makes the implementation simple in structure, computationally lightweight, and with high measurement resolution.
[0033] Through the electrical connections and functional collaboration of the aforementioned structural components, this embodiment forms a complete signal chain from "capacitor initialization, stable charging, threshold judgment, time quantization to liquid level calculation," enabling liquid level changes to be stably, accurately, and in real-time captured in the form of RC time constant changes. This structure not only simplifies the capacitance measurement circuit and avoids reliance on high-cost dedicated capacitance measurement chips, but also maintains high measurement accuracy and anti-interference capability even in noisy environments, significantly improving the reliability, applicability, and engineering feasibility of continuous liquid level measurement.
[0034] Furthermore, such as Figure 3 As shown, the voltage comparison unit includes a comparator U2, resistors R1, R2, and R5. The non-inverting input of the comparator U2 is connected to the first end of the resistor R5, the second end of the resistor R5 is connected to the positive terminal of the sensing capacitor, the inverting input of the comparator U2 is grounded, the output of the comparator U2 is connected to the first end of the resistor R2, the second end of the resistor R2 is connected to the switching signal input of the main control module, and the resistor R1 is connected between the common node between the second end of the resistor R2 and the switching signal input of the main control module and ground.
[0035] In this embodiment, the voltage comparison unit consists of comparator U2, resistors R1, R2, and R5. This unit is coupled to the positive node of the sensing capacitor and is used to determine the charging voltage generated by the sensing capacitor under the drive of the regulated charging input module in real time. The first end of resistor R5 is connected to the non-inverting input of comparator U2, and the second end is directly connected to the positive node of the sensing capacitor. This allows comparator U2 to acquire the voltage signal generated by the sensing capacitor in real time under high input impedance conditions, ensuring that the signal is not absorbed by additional loads during transmission and does not disrupt the RC charging curve formed by the fixed resistor R6 and the sensing capacitor. The inverting input of comparator U2 is grounded, allowing comparator U2 to use ground potential as a comparison reference. This causes an immediate jump when the charging voltage of the sensing capacitor first exceeds the reference potential. This design makes the threshold judgment point of comparator U2 stable and reliable, providing a definite trigger event for subsequent timing termination.
[0036] The output of comparator U2 is connected to the first end of resistor R2, and the second end of resistor R2 is connected to the transition signal input of the main control module. This allows the transition signal output by comparator U2 to be current-limited and buffered by resistor R2 and stably transmitted to the main control module, avoiding level overshoot, glitches, or load mismatch caused by direct drive. To ensure that the transition signal input of the main control module maintains a defined logic level when there is no signal input, resistor R1 is placed between this input and ground, providing a pull-down path for the signal line to return to ground. This allows the main control module to maintain a stable low potential state when comparator U2 does not output a transition, avoiding noise triggering or false transition events caused by floating lines.
[0037] Through the electrical connection method described above, the voltage comparison unit forms a complete "signal acquisition—reference comparison—jump shaping—logic output" link. As the sensing capacitor continuously increases its potential under the power supply of the regulated charging input module, this potential is transmitted to the non-inverting input of comparator U2 via resistor R5. When the potential first exceeds the reference potential at the inverting input of comparator U2, a logic jump from low to high occurs immediately at the output of comparator U2. This jump signal is output steadily to the jump signal input of the main control module via resistor R2, and under the pull-down constraint of resistor R1, forms a trigger signal with clear edges and stable amplitude. This allows the main control module to capture the precise moment when the RC curve reaches the threshold potential with high time resolution. With this hardware structure, the system can maintain the stability and repeatability of threshold determination even in noisy industrial environments with frequent power fluctuations, making the charging time parameters derived from the main control module more reliable and providing a solid foundation for liquid level calculation.
[0038] Furthermore, such as Figure 3 As shown, the voltage comparison unit further includes a resistor R4 and a parallel filter network composed of a resistor R3 and a capacitor C1. The first end of the resistor R4 is connected to the regulated power supply, the second end of the resistor R4 is connected to the first end of the parallel filter network, the second end of the parallel filter network is grounded, and the common node between the second end of the resistor R4 and the first end of the parallel filter network is connected to the inverting input terminal of the comparator U2.
[0039] In this embodiment, to enhance the anti-interference capability and potential stability of comparator U2 when determining whether the charging voltage of the sensing capacitor has reached a preset potential, a filtering and reference generation structure consisting of resistors R4 and R3 and capacitor C1 is introduced at the inverting input of comparator U2. This structure uses a regulated power supply as the input reference, introduces the potential of the regulated power supply to the filtering node through resistor R4, and utilizes a parallel filtering network consisting of resistor R3 and capacitor C1 to dynamically stabilize and suppress noise at the node's potential. This results in a relatively stable reference voltage at the inverting input of comparator U2, which is then reliably compared with the charging voltage of the sensing capacitor.
[0040] In this structure, the first terminal of resistor R4 is connected to the regulated power supply, and its second terminal, together with the first terminals of resistor R3 and capacitor C1, forms a common filter node. This node serves as the driving source for the inverting input of comparator U2. The series connection of resistor R4 not only limits the instantaneous current supplied by the regulated power supply to the inverting input, but also gives the reference potential itself a certain dynamic response time. This prevents the small ripples or electromagnetic interference of the regulated power supply from being directly coupled to the inverting input of comparator U2, thus preventing false triggering caused by excessively rapid input fluctuations.
[0041] The parallel structure of resistor R3 and capacitor C1 further enhances the anti-interference performance of the inverting input. The addition of capacitor C1 quickly absorbs and buffers potential fluctuations at the common node, smoothly filtering out short-term burst interference. Meanwhile, the presence of resistor R3 ensures a discharge path for capacitor C1, preventing residual effects and avoiding reference shift caused by stored charge in capacitor C1 in the next decision cycle. This parallel combination results in a low impedance reference voltage under high-frequency interference and a high impedance reference voltage under low-frequency steady-state conditions, thus achieving dual-band stable control of the threshold reference potential. This ensures that the reference potential at the inverting input of comparator U2 remains smooth, stable, and resistant to external noise interference.
[0042] When the voltage at the positive terminal of the sensing capacitor is transmitted to the non-inverting input of comparator U2 through resistor R5, comparator U2 uses the reference voltage generated by resistors R4, R3, and capacitor C1 at the inverting input as a comparison benchmark. The voltage relationship between these two voltages becomes the basis for determining the switching output. In this structure, the stability of the reference voltage is particularly important because it determines the trigger boundary of comparator U2 for the sensing capacitor charging curve. When the filtering effect of resistor R3 and capacitor C1 on the reference node takes effect, the reference voltage maintains a highly consistent static value. Even with strong external electromagnetic noise or power supply ripple changes, the judgment threshold of comparator U2 will not change, thus ensuring high repeatability, high anti-interference capability, and high time accuracy in determining the "reaching the threshold potential" event throughout the RC charging measurement process.
[0043] Through the synergistic effect of resistors R4 and R3, capacitor C1, and the inverting input of comparator U2, this embodiment constructs a low-noise, high-stability threshold reference point, enabling comparator U2 to accurately determine the critical moment in the charging process of the sensing capacitor in complex environments. This structure not only effectively suppresses false jumps caused by interference but also ensures the consistency of the timing termination point each time during the liquid level measurement process, thereby significantly improving the repeatability of the time parameters and the accuracy of the final liquid level data.
[0044] Furthermore, such as Figure 3 As shown, the discharge reset module includes a MOSFET Q1, a resistor R7, and a resistor R8. The first end of the resistor R8 is connected to the positive terminal of the sensing capacitor, and the second end of the resistor R8 is connected to the first conducting terminal of the MOSFET Q1. The second terminal of the MOSFET Q1 is grounded, and the controlled terminal of the MOSFET Q1 is connected to the control signal drive terminal of the main control module. The resistor R7 is connected between the common node between the controlled terminal of the MOSFET Q1 and the control signal drive terminal of the main control module and ground.
[0045] In this embodiment, the discharge reset module consists of a MOSFET Q1, resistors R7 and R8, connected in series between the positive terminal of the sensing capacitor and ground. It is used to completely discharge the sensing capacitor to its initial potential before each measurement, ensuring a consistent and repeatable starting condition for the subsequent RC charging process. The introduction of the discharge reset module allows the system to avoid error accumulation caused by residual charge, thus significantly improving the stability and repeatability of the liquid level measurement results. The first end of resistor R8 is directly connected to the positive terminal of the sensing capacitor, serving as the input terminal of the discharge circuit. The second end of resistor R8 is connected to the first conducting terminal of MOSFET Q1, allowing the charge in the sensing capacitor to flow through resistor R8 to the conducting path of MOSFET Q1. Resistor R8 acts as a current limiter during discharge. The second terminal of MOSFET Q1 is directly grounded, forming the return path of the discharge circuit. When MOSFET Q1 is in the conducting state, the charge stored in the sensing capacitor is rapidly released to ground through resistor R8 and MOSFET Q1, causing the voltage of the sensing capacitor to drop to near 0V. The controlled terminal of MOSFET Q1 is connected to the control signal drive terminal of the main control module, enabling the main control module to control the conduction and cutoff of MOSFET Q1 using digital logic. When the main control module outputs a valid control signal, MOSFET Q1 turns on, and the discharge process begins immediately; when the control signal is removed, MOSFET Q1 turns off, the discharge path is cut off, and the sensing capacitor enters the normal charging process. The presence of resistor R7 can promptly pull the controlled terminal of MOSFET Q1 to ground potential when the main control module output signal is disconnected, eliminating the random switching phenomenon caused by the floating state, and ensuring that the conduction and cutoff behavior of MOSFET Q1 is controllable and precise.
[0046] Furthermore, such as Figure 2 As shown, the voltage-regulated charging input module includes a resistor R6, a voltage regulator chip U1, a capacitor C3, and a capacitor C4. The power input terminal of the voltage regulator chip U1 is connected to a 5V power supply, the power output terminal of the voltage regulator chip U1 is connected to the first terminal of the resistor R6, the second terminal of the resistor R6 is connected to the positive terminal of the sensing capacitor, and the capacitors C3 and C4 are connected to ground at the common points between the power output terminal of the voltage regulator chip U1 and the first terminal of the resistor R6.
[0047] In this embodiment, the power input terminal of the voltage regulator chip U1 is connected to an external 5V power supply. By regulating the input voltage, the voltage regulator chip U1 generates a stable 3.3V charging voltage at its power output terminal, which is then used as the driving power for the RC charging circuit. Since liquid level measurement requires extremely high stability of the charging voltage, even minor fluctuations in the power supply can affect the final measurement time through the RC time constant. Therefore, in this embodiment, the voltage regulator chip U1 plays a crucial role in converting potential ripple, fluctuations, and instantaneous drops in the external power supply into a stable output. Resistor R6 serves as a dedicated current-limiting resistor for the sensing capacitor. This resistor not only determines the time constant during the RC charging process but also limits the charging current, preventing the sensing capacitor from rapidly absorbing current in the initial stage, which could cause voltage drop fluctuations at the output terminal of the voltage regulator chip U1. Through the current limiting effect of resistor R6, the RC charging curve becomes smoother, maintaining a good linear relationship between the charging time and the capacitance of the sensing capacitor, which is beneficial for improving the accuracy of liquid level conversion. Capacitors C3 and C4 together constitute the output filtering network. Among them, capacitor C3 is usually a small-capacity, fast-response surface-mount ceramic capacitor, used to quickly suppress high-frequency noise and transient spikes; capacitor C4 is a relatively large energy storage capacitor, used to compensate for the slow fluctuations at the regulated output caused by load changes.
[0048] Specifically, the entire capacitive continuous liquid level measurement device consists of three parts: structural components, control circuit, and measurement software. The structural components form a sensing capacitor that changes capacitance with liquid level variations. The control circuit discharges, charges, and determines thresholds for the sensing capacitor. The measurement software is responsible for acquiring charging time and calculating liquid level. These three components work together to achieve continuous liquid level measurement. The structural components are as follows: Figure 4As shown, the device consists of a female connector 1, twisted-pair wires 2, an isolation bracket 3, and two metal plates 4. The female connector is used for electrical connection with the male connector corresponding to the control circuit. The twisted-pair wires at both ends are connected to the two metal plates, making the metal plates the two poles of the sensing capacitor. The isolation bracket is installed between the two metal plates. On the one hand, it provides mechanical support to ensure that the metal plates maintain an appropriate insulation distance from the liquid being measured. On the other hand, it fixes the spacing between the two metal plates, stabilizing the inter-plate distance of the sensing capacitor, thereby ensuring that capacitance changes are only caused by the liquid level height.
[0049] like Figure 5 As shown, after the structural components are installed inside the liquid level measurement space, the sensing capacitor formed by the two metal plates and the surrounding medium together constitute a parallel plate capacitor measurement structure. Due to the simple structure, low cost, and strong adaptability of parallel plate capacitors, this embodiment preferably uses them as the sensing capacitor for liquid level detection, but it is not limited to this form. The capacitance C of the sensing capacitor is determined by the dielectric constant, the area S of the metal plates, and the distance d between the plates. To adapt to different types of liquids, the outer side of the measured metal plate is covered with a protective layer, creating different dielectric regions between the air and the liquid. When the liquid level is zero, the capacitor can be considered as a series capacitor composed of two protective layers and the air medium, and its equivalent capacitance can be calculated from the thickness T1 of the protective layer, the dielectric constant ε1, and the thickness T2 of the central dielectric layer. As the liquid gradually rises, the liquid dielectric layer gradually replaces the original air medium. The upper half of the two metal plates remains coupled to the air, while the lower half is coupled to the liquid, thus making the sensing capacitor equivalent to a combination of two parallel capacitor segments. Because the dielectric constant ε2 of liquid is much greater than that of air, the equivalent capacitance of the sensing capacitor increases linearly with the increase of liquid level H1. This embodiment utilizes this linear relationship, eliminating the need for precise measurement of the dielectric constant. By simply recording the capacitance of the sensing capacitor at empty and full liquid levels, the relative height of any liquid level can be calculated through linear interpolation, achieving fast, intuitive, and highly robust liquid level calculation.
[0050] In the control circuit section, the device employs the RC charging time measurement principle to obtain the capacitance of the sensing capacitor. Before measurement begins, the sensing capacitor is discharged to near zero potential by the MOSFET in the discharge reset module, placing it at a known initial potential V0=0. Subsequently, a fixed voltage Vu is applied to the sensing capacitor through the regulated power supply of the regulated charging input module, and current flows into the sensing capacitor through a fixed resistor, together forming an RC charging circuit. According to the RC charging formula Vt=Vu·(1−exp(−t / RC)), under the conditions of a fixed resistor R and a fixed voltage Vu, the time t required to reach a certain voltage Vt is proportional to the capacitance C of the sensing capacitor. Therefore, a voltage comparison unit is included in the control circuit so that when the charging voltage of the sensing capacitor first reaches a set threshold potential (e.g., 3V) during the charging process, the comparator immediately generates a jump signal, which is then transmitted to the main control module. The main control module stops timing after receiving the rising edge of the transition signal, thereby obtaining the time parameter taken from charging from the initial potential to the threshold potential. Based on this time parameter, the equivalent capacitance of the sensing capacitor can be deduced.
[0051] In practical applications, to enhance measurement accuracy, this implementation uses a highly stable charging power supply composed of a fixed resistor and a voltage regulator chip, and accurately records the charging time using a counter, so that the measurement resolution is limited only by the microcontroller's main frequency. To enhance field adaptability, this implementation also employs a simple linear calibration method, using the timing of empty and full liquid levels as the minimum and maximum liquid level parameters, respectively. This eliminates the need to obtain the liquid dielectric constant and does not rely on any dedicated capacitance measurement chip, greatly improving the versatility of the application. The entire process requires no complex oscillation circuits or high-cost dedicated chips, simplifying circuit implementation, increasing reliability, and significantly reducing system costs.
[0052] like Figure 6 As shown, a measurement method for a capacitive continuous liquid level measuring device is applied to such a device. The measurement method includes: S10. The discharge reset module is turned on to discharge and reset the sensing capacitor to its initial potential. The discharge reset module is a circuit structure used to actively remove residual charge from the sensing capacitor. It consists of a controllable electronic switch and a current-limiting element. After the control signal output by the main control module is turned on, a controlled discharge path is formed between the positive terminal of the sensing capacitor and ground, allowing the capacitor to return to a uniform initial state of near zero volts in a short time, thereby ensuring consistent initial conditions for subsequent charging processes. The sensing capacitor is a capacitive sensitive element placed inside the liquid level measurement space. Its equivalent capacitance value changes predictably with changes in the liquid level. This capacitor is typically formed by a metal sheet, a dielectric insulating layer, and the container boundary in contact with the liquid.
[0053] S20. If the sensing capacitor is detected to be at its initial potential, the discharge reset module is turned off, and the sensing capacitor is charged through the regulated charging input module. This allows the sensing capacitor to start charging from its initial potential under the action of a fixed resistor and a fixed voltage, and charging timing begins. The regulated charging input module is a circuit unit that provides a stable charging voltage for the sensing capacitor. It contains a voltage regulator chip, a current-limiting resistor, and a filter capacitor. It converts the external power supply voltage into a stable and noise-controlled DC voltage and drives the sensing capacitor to charge exponentially according to a fixed RC time constant through a current-limiting path, thus making the time parameter a directly quantifiable variable. The fixed resistor is a key component in the sensing capacitor charging circuit. Its resistance is constant and it forms an RC network with the sensing capacitor, determining the mathematical relationship of the charging speed and ensuring a consistent time constant in each measurement cycle. The fixed voltage is a stable DC level output by the regulated charging input module, used to ensure that the fluctuations of the charging curve are not affected by external power supply fluctuations, providing a reliable reference for time measurement. Charging timing is an operation in which the main control module uses an internal timer to record the time of the entire process of the sensing capacitor charging from the initial potential to the threshold potential. The timing result is directly used for liquid level calculation.
[0054] S30. Determine whether the sensing capacitor has reached the preset potential. If so, stop the charging timer and record the time parameter from the initial potential to the preset potential. The preset potential is a fixed threshold voltage generated by the voltage comparison structure. This voltage serves as the basis for determining whether the sensing capacitor has reached a specific charging stage. The setting of this threshold potential ensures that the triggering conditions are consistent in each measurement cycle, so that the time parameter can accurately reflect the capacitance change. The time parameter is the complete charging time of the sensing capacitor from the initial potential to the preset potential, serving as the core quantitative indicator for the system to determine the liquid level height.
[0055] S40. Determine the calibration parameter set for the liquid level measurement space at empty and full liquid levels. Based on the linear conversion rule, calculate the liquid level data of the current liquid level in the liquid level measurement space according to the calibration parameter set and the time parameter. The liquid level measurement space is the physical area actually used to contain the liquid and place the sensing capacitor. Its space size, dielectric environment, and liquid properties all affect the equivalent capacitance value of the sensing capacitor. The calibration parameter set corresponding to empty and full liquid levels are two key reference time values recorded by the main control module during on-site configuration or factory calibration. They correspond to the time required for the sensing capacitor to charge to a preset potential when the container is completely empty and when it is full of liquid, respectively. These two sets of calibration parameters are used to establish a linear mapping relationship between liquid level and time. The linear conversion rule is a mathematical method for liquid level calculation implemented internally by the main control module. By using the reference time values of empty and full liquid levels as the two endpoints of the linear interval, the time parameter obtained from any measurement is mapped to the actual liquid level height, enabling liquid level estimation without knowing the dielectric constant of the liquid.
[0056] For example, in a scenario where a transparent plastic container is used as the liquid level measurement space, the sensing capacitor consists of two vertically mounted metal plates sandwiched together with insulating material to form the capacitor structure. As the liquid level in the container increases, the dielectric environment of the capacitor gradually changes from air to liquid, causing its equivalent capacitance to continuously increase. In this structure, a regulated charging input module provides a stable 3.3V charging voltage, with a fixed resistor of 1MΩ. The charging time of the sensing capacitor increases with the rise in liquid level. When the discharge reset module resets the capacitor to 0V, it begins recharging. The main control module calculates the time it takes for the capacitor to reach a preset potential, for example, 3ms for an empty liquid level and 15ms for a full liquid level. If a certain actual measurement yields a time parameter of 9ms, then according to a linear conversion rule, 9ms can be mapped to approximately 50% of the liquid level, achieving quantitative acquisition of the current liquid level.
[0057] Furthermore, the step of determining whether the sensing capacitance has reached the preset potential includes: S301. Obtain the charging voltage at the non-inverting input terminal of the voltage comparator unit. The non-inverting input terminal of the voltage comparator unit is the input port inside the comparator structure used to receive the potential of the positive terminal of the sensing capacitor. It is electrically connected to the positive terminal of the sensing capacitor through a resistor network, enabling this port to sense the instantaneous potential change of the sensing capacitor during charging in real time. Since the charging process of the sensing capacitor increases exponentially, the voltage curve received at the non-inverting input terminal can completely reflect the charging state of the capacitor over time. Therefore, the non-inverting input terminal is the key signal source for determining whether the capacitor has entered the threshold range.
[0058] S302. Determine whether the charging voltage has reached the threshold voltage of the inverting input terminal in the voltage comparator unit for the first time. The inverting input terminal is the reference input terminal used by the voltage comparator unit to maintain the threshold voltage. This port receives a stable reference voltage generated from a regulated power supply, voltage divider resistor, or filter network, enabling the comparator to make a comparison judgment based on a stable threshold potential that is not affected by the charging process. The threshold voltage is a key reference for determining the transition time. Once set, this voltage remains constant throughout the measurement cycle, allowing the comparator to generate a repeatable judgment result when the sensing capacitor reaches this potential, thereby ensuring consistent triggering conditions for time measurement. Reaching the threshold voltage for the first time means that the charging voltage at the non-inverting input terminal exceeds the reference potential provided by the inverting input terminal for the first time. This moment marks the completion of a quantifiable charging stage of the sensing capacitor, which is the theoretical end point of charging time measurement. However, to avoid misjudgments caused by line noise, transient voltage spikes, or other interference, this embodiment does not immediately consider the measurement process to end when the threshold voltage is reached for the first time, but introduces a voltage verification process.
[0059] S303. If the threshold voltage is reached for the first time, a voltage verification process is executed to generate a corresponding verification result. The voltage verification process is an auxiliary algorithm used by the main control module to verify the legality of the threshold trigger event. This process collects several sets of charging voltage data before and after the first threshold point is reached and analyzes their changing trends to determine whether the threshold trigger is caused by a natural RC charging curve, ensuring the physical validity of the jump event. The verification result is the judgment conclusion output by the voltage verification process, used to clarify whether the threshold trigger is reliable. A normal verification indicates that the sampled voltage change characteristics conform to the RC charging law, thus allowing the system to treat this threshold event as a genuine trigger; an abnormal verification means that the voltage change does not conform to the expected curve, and the main control module will refuse to accept this trigger and continue to wait for the next valid trigger.
[0060] S304. If the verification result indicates that the verification is normal, a jump signal is output. When the main control module receives the jump signal, it determines that the sensing capacitor has reached the preset potential. The jump signal is a voltage logic jump output by the comparator after the non-inverting input exceeds the inverting input. This jump is sent to the input of the main control module via a signal shaping network as a clear instruction to end the timing. When the main control module receives the jump signal, it can confirm that the sensing capacitor has reached the preset potential, and the recorded charging time is used as a valid parameter for liquid level calculation.
[0061] In this embodiment, a set of sensing capacitors made of metal sheets is installed in the container. When the liquid level in the container rises, the equivalent capacitance of the sensing capacitors increases, thus slowing down the charging speed. When the regulated power supply charges the sensing capacitors through a fixed resistor, its voltage gradually rises to the non-inverting input terminal; the inverting input terminal remains at the 3V reference potential. When the non-inverting input terminal first reaches 3V, a jump occurs at the comparator output terminal, but the system simultaneously initiates a voltage verification process. By sampling the slope of the voltage change within a few milliseconds before and after the sampling, the system confirms that the charging trend truly exists. If the verification result is normal, the jump signal is accepted by the main control module, and the timing immediately stops. For example, charging from an empty liquid level to 3V takes 2ms, and charging from a full liquid level takes 9ms, while the time measured in this case is 5ms. The system can then determine that the current liquid level is approximately at the middle of the container height.
[0062] Furthermore, the step of executing the voltage verification process to generate the corresponding verification result includes: S3031. Collect charging voltage at multiple sampling time points before and after the first attainment of the threshold voltage. These multiple sampling time points refer to several voltage sampling moments collected by the main control module within a very short time window before and after the comparator output transition, at fixed sampling intervals. These sampling points form the basic time coordinates for analyzing the charging trend of the sensing capacitor. Collecting the charging voltage corresponding to these time points aims to obtain the true voltage value of the sensing capacitor in the key segment of the RC charging curve for subsequent slope analysis.
[0063] S3032. Calculate the voltage difference between two adjacent sampling time points, and calculate the corresponding voltage change slope based on each voltage difference. The voltage difference between two adjacent sampling time points refers to the difference between the sampling voltages at any two adjacent time points among the multiple time points mentioned above. This difference reflects the voltage increase amplitude of the sensing capacitor within the sampling interval. The voltage change slope calculated based on these differences is a parameter used to describe the voltage rise rate of the sensing capacitor in a short time. It can be obtained by dividing the voltage change by the sampling time interval. Since the RC charging curve of the sensing capacitor has a typical monotonically increasing characteristic, under normal charging conditions, the voltage change slope should show a trend of decreasing with time but always remaining positive. Once abnormal fluctuations occur, such as instantaneous jumps caused by noise, the slope will become abnormal locally, enabling the system to identify non-real charging pulses.
[0064] S3033. Determine whether the voltage change slope reaches a preset slope. If it does, generate a verification result indicating normal operation. If it does not reach the preset slope, generate a verification result indicating abnormal operation. The preset slope is a threshold used to determine whether the current threshold trigger is valid. It is usually calibrated experimentally or automatically generated by the system based on previous charging data. It defines the minimum rate of change that the RC charging curve should have in this segment. When the voltage change slope reaches the preset slope, it means that the collected voltage change is consistent with the actual charging behavior, and a verification result indicating normal operation can be generated accordingly. If the slope is insufficient or shows abnormal changes, it indicates that the charging curve may be disturbed. The system will generate a verification result indicating abnormal operation, reject the trigger event, and continue to wait for the subsequent charging process to reach the threshold point again.
[0065] In this embodiment, when the sensing capacitor charges to approximately 2.95V and approaches the 3V threshold voltage, the main control module collects several voltage points within tens of microseconds before and after the comparator prepares to jump. For example, the collected voltage values increase sequentially to 2.91V, 2.94V, 2.97V, and 3.00V, with a sampling interval of 10μs between each two points. Dividing these voltage differences by 10μs yields the corresponding voltage change slopes, such as 300mV / ms, 290mV / ms, and 280mV / ms. If the preset slope is 100mV / ms, the above slopes are all significantly higher than this value, indicating that the capacitor voltage is rising along the natural RC curve. The system therefore generates a normal verification result and allows this threshold trigger as the timing endpoint. If a sudden change occurs in a sampling result, such as an instantaneous jump to 3.02V but the slopes before and after are far lower than the preset value, the system will determine that an abnormal noise jump has occurred and reject this trigger.
[0066] Furthermore, the dynamic adjustment step of the threshold voltage includes: Before the charging voltage reaches the threshold voltage, temperature data is acquired over multiple consecutive cycles, and the corresponding temperature drift rate is calculated based on the temperature data. The corresponding equivalent time constant offset is determined based on the temperature drift rate. The corresponding threshold point is calculated based on the equivalent time constant offset.
[0067] In this embodiment, to ensure consistent time determination accuracy during the charging process of the sensing capacitor under different ambient temperatures, the system continuously collects temperature data for multiple measurement cycles through the internal temperature acquisition unit of the main control module or an external temperature measurement element before the sensing capacitor reaches the threshold voltage. Between each cycle, the corresponding temperature drift rate is calculated based on the temperature change and the cycle time interval. The temperature drift rate characterizes the dynamic trend of ambient temperature changes and reflects the equivalent rate of change of the fixed resistor and sensing capacitor under temperature disturbances. After obtaining the temperature drift rate, the main control module maps the temperature drift rate to an equivalent time constant offset based on the temperature-time constant characteristic model stored in its internal non-volatile memory, enabling the system to quantify the impact of temperature changes on the RC charging process. Subsequently, the main control module uses this equivalent time constant offset to correct the reference threshold point, ensuring that the adjusted threshold potential matches the RC curve characteristics under the current ambient temperature conditions. This ensures that the true charging time relationship is reflected when the comparator triggers the threshold determination, improving the accuracy of time determination and ensuring the consistency and reliability of the liquid level conversion results in temperature-changing environments. The calculation of the equivalent time constant offset is based on the combined effect of temperature drift rate on the intrinsic parameters of the resistor and sensing capacitor. It is derived using the temperature-resistance characteristic model and temperature-dielectric constant variation model established within the main control module. In a conventional RC charging structure, the time constant is obtained by multiplying the fixed resistor by the equivalent capacitance of the sensing capacitor. Both of these physical characteristics exhibit predictable shifts with changes in ambient temperature. Therefore, after obtaining the temperature drift rate, the main control module first calculates the resistance offset under the current temperature change trend based on the temperature coefficient model of the fixed resistor. Simultaneously, the main control module also calculates the rate of change of the dielectric constant with temperature based on the dielectric material model of the sensing capacitor, thus obtaining the offset trend of the equivalent capacitance of the sensing capacitor. By multiplying the resistance offset by the capacitance offset, the change in the overall RC time constant over a very short period in the future can be obtained. This change constitutes the equivalent time constant offset used by the system to adjust the threshold point.
[0068] To ensure more stable and reliable calculation results, the main control module typically employs linear prediction, interpolation, or exponential smoothing algorithms when calculating the time constant offset. This ensures that the time constant offset reflects the true direction of the current temperature change trend without causing significant fluctuations in the threshold voltage due to short-term temperature disturbances. After completing the above calculations, the main control module superimposes the offset with the reference time constant to generate a corrected time constant value. This corrected value serves as the input for the next threshold voltage calculation, ensuring that the trigger point used by the comparator remains consistent with the actual RC charging dynamics in environments with continuously changing temperatures. This guarantees that the liquid level result derived from time measurement exhibits consistency and stability under various temperature conditions.
[0069] For example, in an application scenario where the temperature coefficient of resistance is 100 ppm / °C and the temperature coefficient of the dielectric material of the sensing capacitor is −800 ppm / °C, if the temperature drift rate calculated by the main control module is 0.5°C / s, it can be deduced that the resistance will rise at a rate of 50 ppm / s, while the capacitance will decrease at a rate of approximately −400 ppm / s. Since the time constant is the product of the two, under this temperature change trend, the main control module calculates that the time constant decreases by approximately 0.35% per second, and accordingly raises the next threshold point by approximately 0.35% to offset the early arrival of the RC curve, ensuring that the threshold determination still accurately reflects the physical capacitance behavior, thereby ensuring that the timing accuracy of the liquid level calculation does not shift with changes in ambient temperature.
[0070] Furthermore, the threshold point is calculated based on the aforementioned equivalent time constant offset, and dynamically adjusted through the threshold voltage prediction model within the main control module. Since the charging process of the sensing capacitor follows an exponentially increasing curve, the time it takes to reach the preset potential is a fixed function of the RC time constant. Therefore, after obtaining the time constant offset, the main control module superimposes this offset with the reference time constant to generate a corrected time constant under the current environmental conditions. This corrected time constant is then substituted into the exponential charging formula, and the corrected threshold point is obtained by solving for the corresponding voltage value within the target charging time period. The calculated threshold point serves as the trigger reference for the comparator, ensuring that even when the RC curve advances or lags due to temperature changes, the comparator can still trigger a jump at the corrected voltage point, thus keeping the charging time captured by the main control module consistent with actual physical behavior. Through this threshold point calculation method based on the time constant offset, the system can maintain the accuracy of the judgment point even under rapid temperature fluctuations or continuous drift, ensuring that the liquid level measurement process is unaffected by environmental disturbances, thereby guaranteeing the stability of charging timing and the linear reliability of liquid level calculation.
[0071] Furthermore, the step of calculating the corresponding temperature drift rate based on the temperature data includes: Differential calculations are performed on temperature data collected in multiple consecutive measurement cycles to obtain the temperature change between adjacent measurement cycles. The temperature change is compared with the time interval between adjacent measurement cycles to generate a temperature drift rate that characterizes the temperature change trend.
[0072] In this embodiment, the temperature drift rate is calculated based on temperature data acquired by the main control module in different measurement cycles. By performing trend analysis on this temperature data, a parameter reflecting the rate of change in ambient temperature is formed. Specifically, before each charging of the sensing capacitor, the main control module reads the output value of the current temperature measurement unit and compares this temperature value with the temperature data recorded in the previous measurement cycle. The actual time interval between two temperature samples is recorded using an internal time base, allowing the main control module to obtain the instantaneous rate of temperature change over time by dividing the temperature change by the time interval. To avoid the influence of electrical noise, sampling errors, or short-term disturbances on a single temperature reading, the main control module performs a weighted average of the temperature drift rate over multiple consecutive cycles or uses a first-order filtering model. This ensures that the final temperature drift rate reflects the true trend of ambient temperature change without being overly sensitive to transient errors. The main control module pre-stores temperature-resistance characteristic curves and temperature-capacitance dielectric constant variation models derived from experimental data. Once the temperature drift rate is calculated, the main control module uses this rate to perform table lookups, interpolation, or first-order predictions within the aforementioned models, thereby generating the equivalent time constant offset for the current measurement cycle. This allows the system to dynamically adjust the threshold potential to compensate for RC curve shifts caused by temperature fluctuations. Through this trend-based temperature drift rate calculation model, the system can anticipate the direction and magnitude of RC time constant changes in scenarios of continuous temperature increases or decreases, thus enabling feedforward adjustment of the threshold point and ensuring that the final liquid level timing result is unaffected by ambient temperature changes.
[0073] For example, in a liquid level monitoring scenario where the ambient temperature slowly rises from 25°C to 30°C, the main control module records temperature values of 25.0°C, 25.7°C, and 26.4°C for three consecutive cycles. If the interval between each cycle is 1 second, the temperature drift rate calculated by the main control module is approximately 0.7°C / s. Based on the stored temperature coefficient of resistance and dielectric temperature drift model of capacitance, the equivalent time constant offset corresponding to this rate can be calculated as an increase of approximately 1.5% in the RC constant. The system can then slightly raise the threshold potential before the sensing capacitor begins its next charge, keeping the comparator trigger point matched with the actual RC curve, and ultimately preventing systematic deviations in the liquid level measurement results due to temperature increases.
[0074] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A capacitive continuous liquid level measuring device, characterized in that, The capacitive continuous liquid level measuring device includes: Main control module; The sensing capacitor, placed in the liquid level measurement space, can generate corresponding electrical signal changes as the liquid level height changes; A discharge reset module, wherein the enable signal input terminal of the discharge reset module is connected to the control signal drive terminal of the main control module, and the power input terminal of the discharge reset module is connected to the positive node of the sensing capacitor, so as to discharge the sensing capacitor to the initial potential. A regulated charging input module, wherein the power output terminal of the regulated charging input module is connected to the positive terminal of the sensing capacitor to output a regulated power supply to power the sensing capacitor; A voltage comparison unit is connected between the jump signal input terminal of the main control module and the positive terminal of the sensing capacitor. When the sensing capacitor is charged to a preset potential, the voltage comparison unit generates a corresponding jump signal and sends it to the main control module, thereby enabling the main control module to calculate the time parameter from the initial potential to the preset potential, and perform linear conversion using the time parameter to generate the liquid level data of the current liquid level in the liquid level measurement space.
2. The capacitive continuous liquid level measuring device according to claim 1, characterized in that, The voltage comparison unit includes a comparator U2, resistors R1, R2, and R5. The non-inverting input of the comparator U2 is connected to the first end of the resistor R5, the second end of the resistor R5 is connected to the positive terminal of the sensing capacitor, the inverting input of the comparator U2 is grounded, the output of the comparator U2 is connected to the first end of the resistor R2, the second end of the resistor R2 is connected to the switching signal input of the main control module, and the resistor R1 is connected between the common node between the second end of the resistor R2 and the switching signal input of the main control module and ground.
3. The capacitive continuous liquid level measuring device according to claim 2, characterized in that, The voltage comparison unit also includes a resistor R4 and a parallel filter network composed of a resistor R3 and a capacitor C1. The first end of the resistor R4 is connected to the regulated power supply, the second end of the resistor R4 is connected to the first end of the parallel filter network, the second end of the parallel filter network is grounded, and the common node between the second end of the resistor R4 and the first end of the parallel filter network is connected to the inverting input terminal of the comparator U2.
4. The capacitive continuous liquid level measuring device according to claim 1, characterized in that, The discharge reset module includes a MOSFET Q1, a resistor R7, and a resistor R8. The first end of the resistor R8 is connected to the positive terminal of the sensing capacitor, and the second end of the resistor R8 is connected to the first conducting terminal of the MOSFET Q1. The second terminal of the MOSFET Q1 is grounded, and the controlled terminal of the MOSFET Q1 is connected to the control signal driving terminal of the main control module. The resistor R7 is connected between the common node between the controlled terminal of the MOSFET Q1 and the control signal driving terminal of the main control module and ground.
5. The capacitive continuous liquid level measuring device according to claim 1, characterized in that, The voltage-regulated charging input module includes a resistor R6, a voltage regulator chip U1, a capacitor C3, and a capacitor C4. The power input terminal of the voltage regulator chip U1 is connected to a 5V power supply. The power output terminal of the voltage regulator chip U1 is connected to the first terminal of the resistor R6. The second terminal of the resistor R6 is connected to the positive terminal of the sensing capacitor. The capacitors C3 and C4 are connected to ground at the common points between the power output terminal of the voltage regulator chip U1 and the first terminal of the resistor R6, respectively.
6. A measurement method for a capacitive continuous liquid level measuring device, characterized in that, Applied in a capacitive continuous liquid level measuring device as described in any one of claims 1-5, the measuring method includes: The discharge reset module is turned on to discharge and reset the sensing capacitor to its initial potential. If the sensing capacitor is detected to be at its initial potential, the discharge reset module is turned off, and the sensing capacitor is charged through the regulated charging input module so that the sensing capacitor starts charging from its initial potential under the action of a fixed resistor and a fixed voltage, and the charging timer starts. Determine whether the sensing capacitor has reached the preset potential. If it has, stop the charging timer and record the time parameter from the initial potential to the preset potential. A set of calibration parameters is determined for the liquid level measurement space when it is empty and full. Based on the linear conversion rule, the liquid level data of the current liquid level of the liquid level measurement space is calculated according to the set of calibration parameters and the time parameter.
7. The measurement method of the capacitive continuous liquid level measuring device according to claim 6, characterized in that, The step of determining whether the sensing capacitance has reached the preset potential includes: Obtain the charging voltage at the non-inverting input terminal of the voltage comparator unit; Determine whether the charging voltage reaches the threshold voltage of the inverting input terminal in the voltage comparison unit for the first time; If the threshold voltage is reached for the first time, a voltage verification process is executed to generate the corresponding verification result. If the verification result indicates that the verification is normal, a jump signal is output. When the main control module receives the jump signal, it determines that the sensing capacitor has reached the preset potential.
8. The measurement method of the capacitive continuous liquid level measuring device according to claim 7, characterized in that, The step of executing the voltage verification process to generate the corresponding verification result includes: The charging voltage was collected at multiple sampling time points before and after the first arrival at the threshold voltage; Calculate the voltage difference between the charging voltages at two adjacent sampling time points, and calculate the corresponding voltage change slope based on each voltage difference; Determine whether the slope of the voltage change reaches a preset slope. If it reaches the preset slope, generate a verification result to indicate that the verification is normal. If it does not reach the preset slope, generate a verification result to indicate that the verification is abnormal.
9. The measurement method of the capacitive continuous liquid level measuring device according to claim 7, characterized in that, The dynamic adjustment steps for the threshold voltage include: Before the charging voltage reaches the threshold voltage, temperature data is acquired over multiple consecutive cycles, and the corresponding temperature drift rate is calculated based on the temperature data. The corresponding equivalent time constant offset is determined based on the temperature drift rate. The corresponding threshold point is calculated based on the equivalent time constant offset.
10. The measurement method of the capacitive continuous liquid level measuring device according to claim 9, characterized in that, The step of calculating the corresponding temperature drift rate based on the temperature data includes: Differential calculations are performed on temperature data collected in multiple consecutive measurement cycles to obtain the temperature change between adjacent measurement cycles. The temperature change is compared with the time interval between adjacent measurement cycles to generate a temperature drift rate that characterizes the temperature change trend.