Water level detection circuit based on square wave isolation
By using a water level detection circuit based on square wave isolation, and utilizing optocoupler isolation technology and square wave signals to detect water level, the problems of easy interference and low accuracy of traditional water level detection methods are solved, achieving high-precision and low-cost water level detection.
Patent Information
- Application Number
- CN202520617789.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2035-04-02
AI Technical Summary
Traditional water level detection methods are susceptible to environmental interference, have low accuracy, and are costly to implement electrical isolation. In particular, methods that detect the resistance of water level probes suffer from poor sensitivity and interference resistance.
A water level detection circuit based on square wave isolation is adopted, including an isolation power supply module, a square wave isolation module, a water level detection module, a signal receiving isolation module, and a microcontroller module. The water level is detected by square wave signal and signal transmission and control are realized by using optocoupler isolation technology, thereby reducing probe polarization.
It improves the anti-interference capability and accuracy of water level detection, ensures the reliability of detection results, and reduces the complexity and cost of the circuit.
Smart Images

Figure CN223856550U_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The utility model relates to water level detection technical field, concretely is a water level detection circuit based on square wave isolation. BACKGROUND
[0002] Water level detection has wide application in industry, agriculture, household and the like. Traditional water level detection methods include float type, capacitive type, ultrasonic type and the like, but these methods have certain limitations, such as being susceptible to environmental interference, low precision and the like.
[0003] In actual application, the water level is detected by directly detecting the water level probe resistance. Since there are charged ions in water, there is current passing between the probes contacting water, and then the water level can be known by detecting whether there is current. However, this method has poor detection sensitivity and anti-interference, and the cost of electrical isolation in this way is also relatively high. UTILITY MODEL CONTENT
[0004] The utility model aims at providing a circuit for detecting water level through square wave signals, having isolation function, which can effectively avoid interference between circuits and improve detection precision and reliability.
[0005] To achieve the above object, the utility model adopts the following technical scheme:
[0006] A water level detection circuit based on square wave isolation, comprising two groups of isolation power supply modules, a square wave isolation module, a water level detection module, a signal receiving isolation module and a single-chip microcomputer module.
[0007] The two groups of isolation power supply modules are connected with the square wave isolation module, the water level detection module, the signal receiving isolation module and the single-chip microcomputer module at the same time.
[0008] The square wave isolation module is also connected with the water level detection module and the single-chip microcomputer module respectively; and the signal receiving isolation module is also connected with the water level detection module and the single-chip microcomputer module respectively.
[0009] The water level detection module is used for connecting with a water level probe to detect water level state, and then converts the water level state into an electric signal and outputs the converted electric signal; the signal receiving isolation module transmits the electric signal to the single-chip microcomputer module through optical coupling isolation; the square wave isolation module is used for receiving the output signal of the single-chip microcomputer module and controlling the on-off of the water level probe through optical coupling isolation; and the single-chip microcomputer module controls the on-off of the water level detection through the output port P32 of the single-chip microcomputer U4, analyzes the input electric signal through the input port P31 of the single-chip microcomputer U4, and judges the water level state and the normal operation of the water level circuit hardware.
[0010] The two groups of isolated power supply modules are used for supplying power to the single-chip microcomputer module, the square wave isolation module, the water level detection module and the signal receiving isolation module.
[0011] Further, the water level detection module comprises a terminal J2, resistors R3, R4 and R5, and transistors Q1 and Q2.
[0012] The terminal J2 is in communication with a water level probe, a pin 2 of the terminal J2 is connected to a power supply +13V, a pin 1 of the terminal J2 is also connected to a connecting pin TOU, the pin TOU is in communication with a network INP+ after being in communication with the square wave isolation module, the network INP+ is also in communication with the resistors R3, R4 and R5, one end of the resistor R3 is connected to the power supply +13V, one end of the resistor R4 is connected to a ground SGND, one end of the resistor R5 is connected to a base B of the transistor Q1, an emitter E of the transistor Q1 is connected to a base B of the transistor Q2, a collector C of the transistor Q1 is connected to a collector C of the transistor Q2 and a network OUTP, and an emitter E of the transistor Q2 is connected to the ground SGND.
[0013] Further, the single-chip microcomputer module comprises a capacitor C4 and a single-chip microcomputer U4.
[0014] A 2-pin of the single-chip microcomputer U4 is connected to a power supply VCC and the capacitor C4, a 4-pin of the single-chip microcomputer U4 is connected to a ground GND and the other end of the capacitor C4, a 6-pin of the single-chip microcomputer U4 is an input port P31, and a 7-pin of the single-chip microcomputer U4 is an output port P32.
[0015] Further, the signal receiving isolation module comprises resistors R2 and R6 and an optocoupler U3.
[0016] The resistor R2 is connected to the power supply VCC, one end of the resistor R2 is connected to the input port P31 of the single-chip microcomputer U4 and a 4-pin of the optocoupler U3, a 3-pin of the optocoupler U3 is connected to the ground GND, a 1-pin of the optocoupler U3 is connected to the power supply +13V, a 1-pin of the optocoupler U3 is connected to the resistor R6, and one end of the resistor R6 is connected to the network OUTP.
[0017] Further, the square wave isolation module comprises a resistor R1 and an optocoupler U2.
[0018] The output port P32 of the single-chip microcomputer U4 is connected to the resistor R1, one end of the resistor R1 is connected to a 2-pin of the optocoupler U2, a 1-pin of the optocoupler U2 is connected to the power supply VCC, a 4-pin of the optocoupler U2 is connected to the pin TOU of the terminal J2, and a 3-pin of the optocoupler U2 is connected to the network INP+.
[0019] Further, the two groups of isolated power supply modules comprise a terminal J1, a transformer T1, a diode D2, a capacitor C3, a bridge D1, capacitors E1, C1, E2 and C2, and a voltage stabilizing chip U1.
[0020] The power supply AC220V is input from the pin L and pin N of the terminal J1, the pin L and pin N are connected to the two ends of the primary of the transformer T1, the secondary of the transformer T1 outputs two groups of AC12V, the 12A and 12B of one group of AC12V are connected to the AC input end of the bridge D1, the output end of the bridge D1 is connected with the capacitor E1 and the capacitor C1 in parallel to output +12V, the output +12V is connected to the input end of the voltage stabilizing chip U1, the output end of the voltage stabilizing chip U1 is connected with the capacitor E2 and the capacitor C2 in parallel to output VCC, the other end of the capacitor E2 is connected to GND; the pin 13B of the other group of AC12V is connected to the ground SGND, the pin 13A is connected to the anode of the diode D2, the cathode of the diode D2 is connected to the capacitor C3 to output the power supply +13V.
[0021] The water level detection circuit based on square wave isolation has the advantages that the water level signal feedback and power supply isolation design are realized through the output square wave signal, water level detection is realized, the anti-interference ability and detection precision are improved, the circuit hardware operation state can be self-checked, the reliability of the detection result is ensured, the whole circuit is simple, and the cost is low. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 It is a principle block diagram of the utility model;
[0023] Figure 2 It is a two-group isolation power supply module circuit principle diagram of the utility model;
[0024] Figure 3 It is a water level detection module circuit principle diagram of the utility model;
[0025] Figure 4 It is a square wave isolation module circuit principle diagram of the utility model;
[0026] Figure 5 It is a signal receiving isolation module circuit principle diagram of the utility model;
[0027] Figure 6 It is a single-chip microcomputer module circuit principle diagram of the utility model;
[0028] Figure 7 It is a circuit principle diagram of the utility model. DETAILED DESCRIPTION
[0029] Example 1
[0030] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. It should be understood that the terms "comprise" and "include" as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0031] The embodiment provides a water level detection circuit based on square wave isolation, which comprises two groups of isolation power supply modules, a square wave isolation module, a water level detection module, a signal receiving isolation module and a single-chip microcomputer module.
[0032] The principle block diagram of each module is shown in the drawing. Figure 1 The two groups of isolation power supply modules are connected with the square wave isolation module, the water level detection module, the signal receiving isolation module and the single-chip microcomputer module simultaneously.
[0033] The square wave isolation module is also connected with the water level detection module and the single-chip microcomputer module respectively.
[0034] The water level detection module is used for connecting with a water level probe to detect a water level state, and then converts the water level state into an electric signal and outputs the converted electric signal. The signal receiving isolation module transmits the electric signal to the single-chip microcomputer module through optical coupling isolation. The square wave isolation module is used for receiving an output signal of the single-chip microcomputer module and controlling the on-off of the water level probe through optical coupling isolation. The single-chip microcomputer module controls the on-off of the water level detection through the output port P32 of the single-chip microcomputer U4, analyzes the input electric signal through the input port P31 of the single-chip microcomputer U4, and judges the water level state and the normal operation of the water level circuit hardware.
[0035] The two groups of isolation power supply modules are used for separately supplying power to the single-chip microcomputer module and the water level detection module.
[0036] The circuit principle diagram of the two groups of isolation power supply modules is shown in the drawing. Figure 2 The two groups of isolation power supply modules comprise a wiring terminal J1, a transformer T1, a diode D2, a capacitor C3, a bridge D1, a capacitor E1, a capacitor C1, a voltage stabilizing chip U1, a capacitor E2 and a capacitor C2.
[0037] The power supply AC220V is input from the pins L and N of the terminal J1, the pins L and N are connected to the two ends of the primary of the transformer T1, the secondary of the transformer T1 outputs two groups of AC12V, one group of AC12V is connected to the AC input end of the bridge D1 (the model is MB10S) through the pins 12A and 12B, the output end of the bridge D1 is connected to the output +12V of the parallel capacitor E1 and capacitor C1, the input end of the voltage stabilizing chip U1 is connected to the output +12V, the output end of the voltage stabilizing chip U1 (the model is 78M05) is connected to the output VCC of the parallel capacitor E2 and capacitor C2, the other end of the capacitor E2 is connected to GND; the pin 13B of the other group of AC12V is connected to the ground SGND, the pin 13A is connected to the anode of the diode D2, the cathode of the diode D2 is connected to the output power supply +13V of the capacitor C3.
[0038] The power supply VCC and GND provide power supply for the input end of the single-chip microcomputer module, the output end of the square wave isolation module and the output end circuit of the signal receiving isolation module; the power supply +13V and SGND provide power supply for the input end of the water level detection module, the output end of the square wave isolation module and the input end circuit of the signal receiving isolation module, and the isolation power supply can effectively prevent external interference from being transmitted to the single-chip microcomputer through the water level.
[0039] The circuit principle diagram of the water level detection module is as shown in Figure 3 The water level detection module comprises the terminal J2, resistors R3, R4 and R5, and transistors Q1 and Q2.
[0040] The terminal J2 is connected with the water level probe, the pin 2 of the terminal J2 is connected to the power supply +13V, the pin 1 of the terminal J2 is also connected to the pin TOU, the pin TOU is connected with the square wave isolation module and then connected with the network INP+, the network INP+ is also connected with the resistors R3, R4 and R5, the other end of the resistor R3 is connected to the power supply +13V, the other end of the resistor R4 is connected to the ground SGND, the other end of the resistor R5 is connected to the base B of the transistor Q1, the emitter E of the transistor Q1 is connected to the base B of the transistor Q2, the collector C of the transistor Q1 is connected to the collector C of the transistor Q2 and the network OUTP, and the emitter E of the transistor Q2 is connected to the ground SGND.
[0041] Both the transistors Q1 and Q2 are 9014 transistors.
[0042] After power on, when the output port P32 of the single-chip microcomputer U4 is high level, the pin TOU and the network INP+ are not connected, the network INP+ is the voltage division of the resistance R3 and the resistance R4, the triode Q1 and the triode Q2 are cut off, the network OUTP and the ground SGND are not connected; when the output port P32 of the single-chip microcomputer U4 is low level, the pin TOU and the network INP+ are connected, the network INP+ is the voltage division of the water level probe resistance and the resistance R4, the water level has water, the triode Q1 and the triode Q2 are turned on for two-stage amplification, the network OUTP and the SGND are connected, and when the water level has no water, the triode Q1 and the triode Q2 are cut off, and the network OUTP and the ground SGND are not connected.
[0043] The circuit principle diagram of the square wave isolation module is shown in Figure 4 The square wave isolation module comprises the resistance R1 and the optical coupler U2. The output port P32 of the single-chip microcomputer U4 is connected with the resistance R1, the other end of the resistance R1 is connected with the 2 pin of the optical coupler U2, the 1 pin of the optical coupler U2 is connected with the power supply VCC, the 4 pin of the optical coupler U2 is connected with the pin TOU of the terminal J2, and the 3 pin of the optical coupler U2 is connected with the network INP+.
[0044] After power on, when the output port P32 of the single-chip microcomputer U4 is high level, there is no potential difference between the 1 pin of the optical coupler U2 and the 2 pin of the optical coupler U2, so the 4 pin of the optical coupler U2 and the 3 pin of the optical coupler U2 are not conducted. When the output port P32 of the single-chip microcomputer U4 is low level, there is potential difference between the 1 pin of the optical coupler U2 and the 2 pin of the optical coupler U2, the 4 pin of the optical coupler U2 and the 3 pin of the optical coupler U2 are conducted, and the pin TOU and the network INP+ are connected through the optical coupler U2.
[0045] The output port P32 of the single-chip microcomputer U4 controls the conduction or not of the pin TOU and the network INP+ through the optical coupler U2. The square wave isolation module is used for controlling the on-off of the water level probe through the optical coupler U2, reducing the duty cycle of the output low level of the output port P32 of the single-chip microcomputer U4, and effectively reducing the polarization phenomenon of the probe.
[0046] The circuit principle diagram of the signal receiving isolation module is shown in Figure 5 The signal receiving isolation module comprises the resistance R2, the resistance R6 and the optical coupler U3. The resistance R2 is connected with the power supply VCC, the other end of the resistance R2 is connected with the input port P31 of the single-chip microcomputer U4 and the 4 pin of the optical coupler U3, the 3 pin of the optical coupler U3 is connected with the ground GND, the 1 pin of the optical coupler U3 is connected with the power supply +13V, the 1 pin of the optical coupler U3 is connected with the resistance R6, and the other end of the resistance R6 is connected with the network OUTP.
[0047] After power on, when the network OUTP and ground SGND are not connected, the pin 4 of the optocoupler U3 and the pin 3 of the optocoupler U3 are not conductive, and the input port P31 of the single-chip microcomputer U4 is high level. When the network OUTP and ground SGND are connected, the pin 4 of the optocoupler U3 and the pin 3 of the optocoupler U3 are conductive, and the input port P31 of the single-chip microcomputer U4 is low level. The signal receiving isolation module is used for the single-chip microcomputer U4 to receive the water level detection electric signal through the optocoupler U3.
[0048] The circuit principle diagram of the single-chip microcomputer module is as shown in Figure 6 The single-chip microcomputer module comprises a capacitor C4 and a single-chip microcomputer U4. The pin 2 of the single-chip microcomputer U4 is connected with the power supply VCC and the capacitor C4, the pin 4 of the single-chip microcomputer U4 is connected with the ground GND and the other end of the capacitor C4, the pin 6 of the single-chip microcomputer U4 is an input port P31, and the pin 7 of the single-chip microcomputer U4 is an output port P32. The model of the single-chip microcomputer U4 is STC8G1K08.
[0049] After power on, when the output port P32 of the single-chip microcomputer U4 is low level, the input port P31 is detected, and the input port P31 is high level, which indicates that there is no water, otherwise, the input port P31 is low level, which indicates that there is water.
[0050] When the output port P32 of the single-chip microcomputer U4 is high level, the input port P31 is detected, and the input port P31 is high level, which indicates that the water level detection circuit is normal, otherwise, the input port P31 is low level, which indicates that the water level detection circuit is abnormal, and the circuit needs to be checked. The duty ratio of the low level of the output port P32 can prevent the water level probe from being polarized. The single-chip microcomputer module is used for controlling the on-off of the water level detection through the output port P32, and judging the water level state and the normal operation of the water level circuit hardware through the analysis of the input level signal of the input port P31.
[0051] The total circuit principle diagram of the utility model is as shown in Figure 7 The specific working principle is as follows:
[0052] The power supply AC220V is input from the pin L and the pin N of the terminal J1, the pin L and the pin N are connected with the two ends of the primary side of the transformer T1, two groups of AC12V are output from the secondary side of the transformer T1, the pin 12A and the pin 12B of one group of AC12V are connected with the alternating current input end of the bridge rectifier D1, the output end of the bridge rectifier D1 is connected with the output +12V of the parallel capacitor E1 and the capacitor C1, the output +12V is connected with the input end of the voltage stabilizing chip U1, the output end of the voltage stabilizing chip U1 is connected with the output VCC of the parallel capacitor E2 and the capacitor C2, the pin 13B of the other group of AC12V is connected with SGND, the pin 13A is connected with the anode of the diode D2, and the cathode of the diode D2 is connected with the output +13V of the capacitor C3.
[0053] The single-chip microcomputer U4 is connected with the power supply VCC and GND in parallel with the capacitor C4, when the output port P32 of the single-chip microcomputer U4 outputs low level, the 4th pin of the optocoupler U2 and the 3rd pin of the optocoupler U2 are conducted, the water level probe loop is conducted, the water level probe resistance and the resistance R4 are divided, whether the water level has water or not determines whether the triode Q1 and the triode Q2 are conducted or not, the network OUTP outputs the water level signal, and then whether the 4th pin of the optocoupler U3 and the 3rd pin of the optocoupler U3 are conducted or not is detected, and the high or low level of the input port P31 of the single-chip microcomputer U4 is analyzed to analyze the water level result.
[0054] When the output port P32 of the single-chip microcomputer U4 outputs high level, the 4th pin of the optocoupler U2 and the 3rd pin of the optocoupler U2 are not conducted, the water level probe loop is disconnected, the resistance R3 and the resistance R4 are divided, the network OUTP outputs the water level signal, and then whether the 4th pin of the optocoupler U3 and the 3rd pin of the optocoupler U3 are conducted or not is detected, and the high or low level of the input port P31 of the single-chip microcomputer U4 is analyzed to analyze the water level circuit hardware result.
[0055] The total circuit principle diagram is to control the high or low level of the output port P32 of the single-chip microcomputer U4 through two groups of power supply isolation, so as to achieve the purpose of actively detecting the water level state and the water level circuit hardware, reduce the water level probe conduction time, effectively prevent the water level probe polarization, and prevent the equipment abnormality caused by the water level circuit hardware.
[0056] The specific detection process is shown in Table 1.
[0057] Table 1
[0058]
[0059] In Table 1, "L" represents low level, and "H" represents high level.
[0060] It should be pointed out that the above-mentioned embodiments are only for illustrating the technical concept and characteristics of the present application, and the one end, the other end and the like described above are corresponding to the description of the drawings of the present application, and are not used to limit the specific content, the purpose is to enable the person skilled in the art to understand the content of the present application and to implement it, and cannot limit the protection scope of the present application. Any equivalent changes or modifications made according to the spirit and essence of the present application should be covered within the protection scope of the present application.
Claims
1. A square wave isolation based water level detection circuit, characterized in that, The water level detection circuit comprises two groups of isolation power supply modules, a square wave isolation module, a water level detection module, a signal receiving isolation module and a single-chip microcomputer module; The two groups of isolation power supply modules are connected with the square wave isolation module, the water level detection module, the signal receiving isolation module and the single-chip microcomputer module simultaneously. The square wave isolation module is further connected with the water level detection module and the single-chip microcomputer module respectively; and the signal receiving isolation module is further connected with the water level detection module and the single-chip microcomputer module respectively. The water level detection module is used for connecting with a water level probe to detect a water level state, and then converting the water level state into an electric signal, and outputting the converted electric signal; the signal receiving isolation module transmits the electric signal to the single-chip microcomputer module through optical coupling isolation; the square wave isolation module is used for receiving an output signal of the single-chip microcomputer module and controlling on-off of the water level probe through optical coupling isolation; the single-chip microcomputer module controls on-off of the water level detection through an output port P32 of a single-chip microcomputer U4, and analyzes an input electric signal through an input port P31 of the single-chip microcomputer U4 to determine the water level state and normal operation of the water level circuit hardware. The two groups of isolation power supply modules are used for supplying power to the single-chip microcomputer module, the square wave isolation module, the water level detection module and the signal receiving isolation module.
2. The water level detecting circuit according to claim 1, wherein The water level detection module comprises a wiring terminal J2, resistors R3, R4 and R5, and transistors Q1 and Q2. The wiring terminal J2 is connected with the water level probe; a pin 2 of the wiring terminal J2 is connected with a power supply +13V; a pin 1 of the wiring terminal J2 is further connected with a connecting pin TOU; the connecting pin TOU is connected with a network INP+ after being connected with the square wave isolation module; the network INP+ is further connected with the resistors R3, R4 and R5; another end of the resistor R3 is connected with the power supply +13V; another end of the resistor R4 is connected with a ground SGND; another end of the resistor R5 is connected with a base B of the transistor Q1; an emitter E of the transistor Q1 is connected with a base B of the transistor Q2; a collector C of the transistor Q1 is connected with a collector C of the transistor Q2 and the network OUTP; an emitter E of the transistor Q2 is connected with the ground SGND.
3. The water level detecting circuit according to claim 1, wherein The single-chip microcomputer module comprises a capacitor C4 and a single-chip microcomputer U4. A 2-pin of the single-chip microcomputer U4 is connected with a power supply VCC and the capacitor C4; a 4-pin of the single-chip microcomputer U4 is connected with a ground GND and another end of the capacitor C4; a 6-pin of the single-chip microcomputer U4 is an input port P31; and a 7-pin of the single-chip microcomputer U4 is an output port P32.
4. The water level detecting circuit according to claim 3, wherein The signal receiving isolation module comprises resistors R2 and R6 and an optical coupling U3. The resistor R2 is connected with the power supply VCC; another end of the resistor R2 is connected with the input port P31 of the single-chip microcomputer U4 and a 4-pin of the optical coupling U3; a 3-pin of the optical coupling U3 is connected with the ground GND; a 1-pin of the optical coupling U3 is connected with the power supply +13V; a 1-pin of the optical coupling U3 is connected with the resistor R6; and another end of the resistor R6 is connected with the network OUTP.
5. The water level detecting circuit according to claim 3, wherein The square wave isolation module comprises a resistor R1 and an optical coupling U2. The output port P32 of the single-chip microcomputer U4 is connected with the resistor R1; another end of the resistor R1 is connected with a 2-pin of the optical coupling U2; a 1-pin of the optical coupling U2 is connected with the power supply VCC; a 4-pin of the optical coupling U2 is connected with the pin TOU of the wiring terminal J2; and a 3-pin of the optical coupling U2 is connected with the network INP+.
6. The water level detecting circuit according to claim 1, wherein The two groups of isolated power module include terminal J1, transformer T1, diode D2, capacitor C3, bridge D1, capacitor E1, capacitor C1, voltage regulator chip U1, capacitor E2 and capacitor C2; The power supply AC220V is input from the pin L and pin N of terminal J1, the pin L and pin N are connected to the two ends of the primary of transformer T1, the secondary output of transformer T1 is two groups of AC12V, the 12A and 12B of one group of AC12V are connected to the AC input end of bridge D1, the output end of bridge D1 is connected in parallel with capacitor E1 and capacitor C1 to output +12V, the input end of voltage regulator chip U1 is connected to the output +12V, the output end of voltage regulator chip U1 is connected in parallel with capacitor E2 and capacitor C2 to output VCC, the other end of capacitor E2 is connected to GND; the pin 13B of the other group of AC12V is connected to the ground SGND, the pin 13A is connected to the anode of diode D2, the cathode of diode D2 is connected to capacitor C3 to output power supply +13V.