Voltage detection circuit, method, storage medium, electronic device and air conditioning device
By introducing low-voltage and high-voltage detection branches into the voltage detection circuit and using controlled switching devices to achieve hardware-level interlocking, the problem that traditional voltage detection circuits cannot distinguish between multiple voltage levels and signal crosstalk is solved, thus improving the accuracy and reliability of voltage monitoring.
Patent Information
- Application Number
- CN202611297060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-27
AI Technical Summary
Traditional voltage detection circuits use a single threshold architecture, which cannot distinguish between multiple voltage levels and lack a hardware interlocking mechanism between high and low voltage detection branches, resulting in signal crosstalk and voltage misjudgment. This makes it impossible to meet the refined detection requirements of smart grids under wide voltage fluctuation conditions.
A low-voltage detection branch and a high-voltage detection branch were designed to detect the voltage in the low-voltage and high-voltage ranges, respectively. A hardware-level interlocking mechanism was implemented through controlled switching devices. When a high voltage input is received, the grounding path of the low-voltage detection branch is automatically cut off to avoid signal crosstalk and false triggering.
It enables accurate identification of multiple voltage levels, improves the identification accuracy and reliability of voltage monitoring, and enhances the operational stability and security of the smart grid.
Smart Images

Figure CN123176322A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of smart grid voltage detection technology, specifically relating to a voltage detection circuit, method, storage medium, electronic device, and air conditioning device. Background Technology
[0002] In smart grid systems, complex operating conditions such as grid connection of distributed renewable energy sources, instantaneous switching of electric vehicle charging and discharging loads, and bidirectional power flow between microgrids and the main grid are becoming increasingly common. Grid voltage exhibits wide-range dynamic fluctuations, with frequent switching between high and low voltage ranges becoming the norm. Accurate voltage detection is a crucial prerequisite for achieving voltage situational awareness, equipment safety protection, and efficient renewable energy consumption in smart grids, placing extremely high demands on the hierarchical identification capabilities and operating condition adaptability of the detection circuitry.
[0003] Traditional voltage detection circuits generally employ a single threshold detection architecture, capable of determining only a single voltage critical point and unable to differentiate between multiple voltage levels. Furthermore, traditional circuits lack a hardware interlocking mechanism between high and low voltage detection branches. When high voltage is input, the low-voltage detection branch cannot be effectively shielded, easily leading to signal crosstalk and voltage misjudgment. This deficiency results in low monitoring accuracy in smart grids under conditions of wide voltage fluctuations, failing to meet the demand for refined voltage detection in scenarios with high penetration rates of renewable energy. Summary of the Invention
[0004] The purpose of this application is to address the shortcomings of the aforementioned technologies by proposing a voltage detection circuit, method, storage medium, electronic device, and air conditioning device. The aim is to solve the problems of traditional voltage detection circuits that use a single threshold architecture and lack hardware interlocking, resulting in signal crosstalk and voltage misjudgment, and insufficient detection accuracy and reliability when high voltage input is not effectively shielded from low voltage branches.
[0005] This application provides a voltage detection circuit, including an input voltage terminal, a low-voltage detection branch, a high-voltage detection branch, a controlled switching device, and a main control unit; The input terminal of the low-voltage detection branch is electrically connected to the input voltage terminal. The low-voltage detection branch is configured with a first grounding path. The low-voltage detection branch is configured to output a first voltage signal when the voltage at the input voltage terminal reaches a first threshold and the low-voltage detection branch is not suppressed. The input terminal of the high-voltage detection branch is electrically connected to the input voltage terminal. The high-voltage detection branch is configured to output a first level signal when the voltage at the input voltage terminal does not reach a second threshold, and to output a second voltage signal and a second level signal when the voltage at the input voltage terminal reaches the second threshold; the second threshold is greater than the first threshold. The control terminal of the controlled switching device is electrically connected to the output terminal of the high-voltage detection branch; the controlled switching device is configured to: respond to the first level signal to put the low-voltage detection branch into an operational state; or respond to the second level signal to suppress the low-voltage detection branch and block the output of the first voltage signal from the low-voltage detection branch. The output terminals of the low-voltage detection branch and the high-voltage detection branch are respectively electrically connected to the main control unit. The main control unit is used to receive the first voltage signal and the second voltage signal, and to identify the voltage state of the input voltage terminal.
[0006] Furthermore, the controlled switching device is connected in series in the first grounding path; The controlled switching device is configured to: turn on in response to the first level signal, thereby connecting the first grounding path and putting the low-voltage detection branch into an operational state; and turn off in response to the second level signal, thereby disconnecting the first grounding path, suppressing the low-voltage detection branch, and blocking the output of the first voltage signal from the low-voltage detection branch.
[0007] Furthermore, the first grounding path includes a first Zener diode and a first current-limiting resistor; The input voltage terminal, the first Zener diode, the first current-limiting resistor, and the controlled switching device are connected in series; One end of the controlled switching device is electrically connected to the first current-limiting resistor, and the other end is grounded; When the input voltage reaches the first threshold but not the second threshold, the first Zener diode breaks down, the controlled switching device is turned on, the first grounding path is turned on, and the low-voltage detection branch has the excitation condition to output the first voltage signal.
[0008] Furthermore, the low-voltage detection branch also includes a low-voltage level output unit; The low-voltage level output unit is electrically connected to the anode of the first Zener diode and the main control unit, respectively. The low-voltage level output unit is configured to output the first voltage signal to the main control unit when the first Zener diode breaks down and the low-voltage detection branch is not suppressed.
[0009] Furthermore, the high-voltage detection branch includes a second grounding path, which includes a second Zener diode and a second current-limiting resistor; The cathode of the second Zener diode is electrically connected to the input voltage terminal, and the anode is grounded through the second current-limiting resistor; When the input voltage reaches the second threshold, the second Zener diode breaks down, and the second grounding path is turned on, so that the high voltage detection branch has the excitation conditions to output the second voltage signal.
[0010] Accordingly, this application also provides a voltage detection method applied to the above-mentioned circuit, the method comprising: The high-voltage detection branch collects the voltage at the input voltage terminal and outputs a first-level signal or a second voltage signal and a second-level signal depending on whether the input voltage reaches the second threshold. The controlled switching device receives the level signal output from the high-voltage detection branch and turns on or off the grounding loop of the low-voltage detection branch according to the level signal; The low-voltage detection branch outputs a first voltage signal when the grounding loop is connected and the input voltage reaches the first threshold. The main control unit acquires the first voltage signal output from the low-voltage detection branch and / or the second voltage signal output from the high-voltage detection branch, and identifies the voltage range of the input voltage terminal.
[0011] Accordingly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the voltage detection method as described above.
[0012] Accordingly, this application also provides an electronic device including the voltage detection circuit described above.
[0013] Accordingly, this application also provides an air conditioning device, including the voltage detection circuit as described above.
[0014] By adopting the above technical solution, this application has the following beneficial effects compared with the prior art: This application achieves graded detection of voltage levels in both high and low ranges by setting up low-voltage and high-voltage detection branches with different threshold values. The low-voltage detection branch detects voltage in the low-voltage range, while the high-voltage detection branch detects voltage in the high-voltage range. The two branches operate independently, and the main control unit can accurately identify the current input voltage level after receiving both signals. This solves the problem that traditional single-threshold detection circuits cannot distinguish between multiple voltage levels, thus improving the identification accuracy of voltage monitoring in smart grids.
[0015] This application directly controls the controlled switching device through the output level of the high-voltage detection branch, and the switching of high and low voltage detection logic is automatically completed by hardware. When high voltage is input, the controlled switching device cuts off the grounding path of the low-voltage detection branch, physically isolating the low-voltage branch, avoiding signal crosstalk and false triggering, without the need for software intervention, with fast response speed and high reliability, solving the problem that the low-voltage branch cannot be effectively shielded under high voltage conditions in traditional circuits.
[0016] The hierarchical interlocking architecture proposed in this application is applicable to voltage fluctuation scenarios in smart grids such as new energy grid connection and dynamic load switching. It can provide a reliable hardware foundation for voltage monitoring and fault diagnosis, improve the operational stability of smart grids, and has good engineering application and promotion value. Attached Figure Description
[0017] The present application will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0018] The following will provide further explanation of this application in conjunction with the accompanying drawings: Figure 1 A schematic diagram illustrating the overall working process of the voltage detection circuit provided in this application; Figure 2 A circuit diagram of the voltage detection circuit provided in this application; Figure 3 A flowchart of the voltage detection method provided in this application; Figure 4 This is a flowchart of the intermittent sampling process for the voltage detection method provided in this application.
[0019] In the picture: 1. Low-voltage detection branch; 2. High-voltage detection branch; 3. Main control unit; 4. Controlled switching devices; 11. First grounding path; 12. Low-voltage level output unit; 21. Second grounding path; 22. High-voltage level output unit. Detailed Implementation
[0020] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0021] Throughout the specification and claims, the following terms will have at least the meaning explicitly associated herein, unless the context otherwise requires. The meanings defined below are not intended to limit the terms, but are merely illustrative examples.
[0022] In the description of this application, the phrase "in one embodiment" does not necessarily refer to the same embodiment, although it may refer to the same embodiment. Similarly, the phrase "in some embodiments," as used herein, does not necessarily refer to the same embodiment when used multiple times, although it may refer to the same embodiment. As used herein, the term "or" is an inclusive "or" operator and is equivalent to the term "and / or," unless the context clearly specifies otherwise. The term "based on" is not exclusive and allows for reliance on additional factors not described, unless the context clearly specifies otherwise. The word "exemplary" herein means "serving as an example, instance, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior to or better than other embodiments. The scope of this application is limited only by the scope of the appended claims, and any examples set forth in this specification are not intended to be limiting, but merely to illustrate some of the many possible embodiments of the claimed application. The various embodiments provided in this application should not be construed as limiting the scope of protection of this application.
[0023] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0024] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0025] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0026] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature being directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0027] like Figure 1 and Figure 2 As shown, this application provides a voltage detection circuit, including an input voltage terminal V1, a low-voltage detection branch 1, a high-voltage detection branch 2, a controlled switching device 4, and a main control unit 3.
[0028] The input terminal of the low-voltage detection branch 1 is electrically connected to the input voltage terminal V1. The low-voltage detection branch 1 is equipped with a first grounding path 11. The low-voltage detection branch 1 is configured to output a first voltage signal to the main control unit 3 when the voltage of the input voltage terminal V1 reaches a first threshold and the low-voltage detection branch 1 is not suppressed.
[0029] The input terminal of the high-voltage detection branch 2 is electrically connected to the input voltage terminal V1. The high-voltage detection branch 2 is configured to output a first-level signal when the voltage at the input voltage terminal V1 does not reach a second threshold; and to output a second voltage signal and a second-level signal when the voltage at the input voltage terminal V1 reaches the second threshold. The second threshold is greater than the first threshold. In this embodiment, the first threshold is set to 6.2V for detecting a 12V voltage input; the second threshold is set to 18V for detecting a 24V voltage input.
[0030] The control terminal of the controlled switching device 4 is electrically connected to the output terminal of the high-voltage detection branch 2. The controlled switching device 4 is configured to: respond to the first level signal output by the high-voltage detection branch 2 to put the low-voltage detection branch 1 into an operable state; and respond to the second level signal output by the high-voltage detection branch 2 to suppress the low-voltage detection branch 1 and block the output of the first voltage signal from the low-voltage detection branch 1.
[0031] The output terminals of low-voltage detection branch 1 and high-voltage detection branch 2 are electrically connected to the main control unit 3. The main control unit 3 receives the first voltage signal output from low-voltage detection branch 1 and the second voltage signal output from high-voltage detection branch 2, and identifies the current voltage state of the input voltage terminal V1 based on the received signals. When the main control unit 3 receives the first voltage signal, it determines that the current input voltage is in the low-voltage range. When the main control unit 3 receives the second voltage signal, it determines that the current input voltage is in the high-voltage range.
[0032] In this embodiment, the controlled switching device 4 is connected in series in the first grounding path 11. The controlled switching device 4 is configured to: turn on in response to the first level signal output by the high-voltage detection branch 2, thereby turning on the first grounding path 11 and putting the low-voltage detection branch 1 into an operational state; and turn off in response to the second level signal output by the high-voltage detection branch 2, thereby turning off the first grounding path 11, suppressing the low-voltage detection branch 1, and blocking the output of the first voltage signal by the low-voltage detection branch 1. When the first grounding path 11 is cut off, the low-voltage detection branch 1 cannot output a valid first voltage signal because it loses its grounding loop, thus completely blocking the false triggering of the low-voltage detection branch 1 under high-voltage input conditions at the physical level.
[0033] In one implementation, the input voltage terminal V1 is connected to the voltage output terminal of the air conditioner's internal power supply board. This voltage detection circuit is used to detect the DC voltage level provided by the air conditioner's internal power supply board. Under different operating modes or configurations, the internal power supply board may output either 12V or 24V. The voltage detection circuit needs to adaptively identify the current supply voltage to match the subsequent load drive logic.
[0034] In one implementation, when the voltage input to the input voltage terminal V1 is located in the intermediate region between the low-voltage and high-voltage ranges, the high-voltage detection branch 2 outputs a second-level signal. Upon receiving this second-level signal, the controlled switching device 4 immediately disconnects, cutting off the first grounding path 11. At this time, even if the threshold condition of the low-voltage detection branch 1 is met, because the first grounding path 11 is physically cut off, the low-voltage detection branch 1 cannot form a current loop, and its first voltage signal is completely blocked. Therefore, in any case where the input voltage crosses the second threshold, the hardware interlocking mechanism can ensure that the high-voltage branch responds first, the low-voltage branch is forcibly suppressed, and there is no false triggering caused by a momentary intermediate state.
[0035] In one implementation, when a low voltage is input to the input voltage terminal V1, the first grounding path 11 of the low-voltage detection branch 1 automatically turns on after the voltage reaches a first threshold, and the low-voltage detection branch 1 outputs a first voltage signal to the main control unit 3. The high-voltage detection branch 2 outputs a first level signal because the input voltage has not reached a second threshold. After receiving the first level signal, the controlled switching device 4 remains in the conducting state and does not interfere with the normal operation of the low-voltage detection branch 1.
[0036] In one embodiment, when high voltage is input to the input voltage terminal V1, the high voltage detection branch 2 outputs a second-level signal to the main control unit 3. Simultaneously, this second-level signal is applied to the control terminal of the controlled switching device 4, causing the controlled switching device 4 to open, thereby cutting off the first grounding path 11 of the low voltage detection branch 1. At this time, even if the voltage threshold condition of the low voltage detection branch 1 is met, because the grounding loop is physically cut off, the low voltage detection branch 1 cannot form a current loop, and the first voltage signal is completely blocked and will not be transmitted to the main control unit 3, thus avoiding false triggering of the low voltage detection branch 1 when high voltage is input.
[0037] This application achieves hardware-level suppression of the low-voltage detection branch 1 by directly controlling the controlled switching device 4 through the output level of the high-voltage detection branch 2. This purely hardware mechanism requires no software intervention, has a fast response speed, and strong anti-interference capability. It fundamentally solves the problem of false triggering caused by mutual interference between multiple voltage detection branches, and improves the accuracy of voltage detection and the safety of circuit operation.
[0038] Please refer to Figure 2 As shown, in one embodiment, the first grounding path 11 includes a first Zener diode D2 and a first current-limiting resistor R6. The input voltage terminal V1, the first Zener diode D2, the first current-limiting resistor R6, and the controlled switching device 4 are connected in series. One end of the controlled switching device 4 is electrically connected to the first current-limiting resistor R6, and the other end of the controlled switching device 4 is grounded to GND. The breakdown voltage of the first Zener diode D2 is the aforementioned first threshold voltage. When the input voltage reaches the first threshold voltage but does not reach the second threshold voltage, the first Zener diode D2 breaks down in reverse and conducts, and the current flows into ground GND through the first current-limiting resistor R6 and the controlled switching device 4, thus turning on the first grounding path 11. The first current-limiting resistor R6 is used to limit the loop current of the first grounding path 11 to prevent overcurrent damage to the first Zener diode D2 and subsequent components.
[0039] In one implementation, the resistance value of the first current-limiting resistor R6 can be calculated based on the input voltage range and the required current value.
[0040] Please refer to Figure 2 As shown, in one embodiment, the low-voltage detection branch 1 further includes a low-voltage level output unit 12. The low-voltage level output unit 12 is electrically connected to the anode of the first Zener diode D2 and the main control unit 3, respectively. The low-voltage level output unit 12 is configured to output a first voltage signal to the main control unit 3 when the first Zener diode D2 breaks down and the low-voltage detection branch 1 is not suppressed.
[0041] In one embodiment, the low-voltage level output unit 12 includes a first drive current limiting subunit, a first switching subunit, and a first level generation subunit.
[0042] In one embodiment, the first drive current limiting subunit is a third current limiting resistor R2. One end of the third current limiting resistor R2 is electrically connected to the anode of the first Zener diode D2, and the other end is electrically connected to the control terminal of the first switching subunit, for transmitting a signal from the anode of the first Zener diode D2 to the control terminal of the first switching subunit.
[0043] In one embodiment, the first switching sub-unit is a first NMOS transistor Q2. The gate of the first NMOS transistor Q2 is electrically connected to a third current-limiting resistor R2, the drain of the first NMOS transistor Q2 is electrically connected to a first level generation sub-unit, and the source of the first NMOS transistor Q2 is grounded to GND. The first NMOS transistor Q2 is configured such that when the gate receives a signal from the third current-limiting resistor R2, the drain and source are connected; when the gate does not receive a signal from the third current-limiting resistor R2, the drain and source are disconnected.
[0044] In one embodiment, the first level generation subunit includes a first pull-up resistor R4 and a first isolation diode D4. The drain of the first NMOS transistor Q2, the first isolation diode D4, the first pull-up resistor R4, and the operating power supply terminal VCC are connected in series. The first voltage signal is led out from the common node of the cathode of the first isolation diode D4 and the first pull-up resistor R4 to the GPIO2 pin of the main control unit 3. The first isolation diode D4 is used for unidirectional conduction, isolating reverse signals and preventing other signals on the GPIO pin of the main control unit 3 from flowing back to the first NMOS transistor Q2. The first pull-up resistor R4 is used to establish a potential reference with the operating power supply terminal VCC, pulling up the loop potential. When the first NMOS transistor Q2 is off, the GPIO2 node remains at a high level; when the first NMOS transistor Q2 is on, the GPIO2 node is pulled low to a low level, i.e., the first voltage signal.
[0045] In one embodiment, the first NMOS transistor Q2 is an enhancement-mode N-channel MOS transistor, whose turn-on voltage is less than the voltage amplitude of the drive signal to ensure full conduction. The value of the third current-limiting resistor R2 can be a surface-mount resistor in the range of 10kΩ to 100kΩ. The first pull-up resistor R4 can be 10kΩ.
[0046] When the input voltage is low, the first Zener diode D2 breaks down in reverse, and the first grounding path 11 is turned on. The potential of the anode of the first Zener diode D2 is transmitted to the gate of the first NMOS transistor Q2 through the third current-limiting resistor R2, turning on Q2. After Q2 is turned on, the GPIO2 node is pulled low to a low level through the first isolation diode D4 and the first pull-up resistor R4, outputting the first voltage signal to the main control unit 3.
[0047] Please refer to Figure 2 As shown, in one embodiment, the high-voltage detection branch 2 includes a second grounding path 21 and a high-voltage level output unit 22.
[0048] In one embodiment, the second grounding path 21 includes a second Zener diode D1 and a second current-limiting resistor R5. The cathode of the second Zener diode D1 is electrically connected to the input voltage terminal V1, and the anode of the second Zener diode D1 is grounded to GND through the second current-limiting resistor R5. The breakdown voltage of the second Zener diode D1 is the aforementioned second threshold voltage. When the input voltage reaches the second threshold voltage, the second Zener diode D1 breaks down in reverse and conducts, and current flows into ground GND through the second current-limiting resistor R5, thus turning on the second grounding path 21 and enabling the high-voltage detection branch 2 to output the second voltage signal. The second current-limiting resistor R5 is used to limit the loop current of the second grounding path 21 to prevent overcurrent damage to the second Zener diode D1.
[0049] In one implementation, the input voltage exhibits normal deviations under actual operating conditions. The nominal high voltage value may fluctuate within a certain range in the actual system, and the nominal low voltage value also has a corresponding deviation range. The breakdown voltage setting of the second Zener diode D1 is lower than the lower limit of the nominal high voltage value, ensuring that the high voltage detection branch 2 can reliably break down and conduct within all normal voltage deviation ranges. Simultaneously, this breakdown voltage is significantly higher than the upper limit of the nominal low voltage value, ensuring that the high voltage detection branch 2 will not falsely break down when a low voltage input is encountered. This threshold selection maintains sufficient margin between the deviation boundaries of the two voltage levels.
[0050] In one embodiment, the high-voltage output unit 22 is electrically connected to the cathode of the second Zener diode D1 and the main control unit 3, respectively. The high-voltage output unit 22 is configured to output a second voltage signal to the main control unit 3 when the second Zener diode D1 breaks down. The control terminal of the controlled switching device 4 is electrically connected to the high-voltage output unit 22. The high-voltage output unit 22 is also configured to output a first voltage signal to the controlled switching device 4 when the second Zener diode D1 does not break down; and to output a second voltage signal to the controlled switching device 4 when the second Zener diode D1 breaks down.
[0051] In one embodiment, the high-voltage output unit 22 includes a third current-limiting resistor R1, a high-voltage switching transistor Q1, a third isolation diode D3, and a second pull-up resistor R3. One end of the third current-limiting resistor R1 is electrically connected to the cathode of the second Zener diode D1, and the other end of the third current-limiting resistor R1 is electrically connected to the gate of the high-voltage switching transistor Q1. The third current-limiting resistor R1 is used to perform current-limiting adaptation processing on the signal generated when the second grounding path 21 is turned on, so as to output a stable high-voltage drive signal.
[0052] The gate of the high-voltage switch Q1 is electrically connected to the other end of the third current-limiting resistor R1. The high-voltage switch Q1 is configured to turn on when the gate receives a high-voltage drive signal and turn off when the gate does not receive a high-voltage drive signal. The drain of the high-voltage switch Q1 is connected in series with the third isolation diode D3, and the source of the high-voltage switch Q1 is grounded to GND.
[0053] The third isolation diode D3, the second pull-up resistor R3, and the operating power supply VCC are connected in series. Specifically, the drain of the high-voltage switch Q1 is connected to the anode of the third isolation diode D3, the cathode of the third isolation diode D3 is connected to one end of the second pull-up resistor R3, and the other end of the second pull-up resistor R3 is connected to the operating power supply VCC. The second voltage signal is led out from the common node between the cathode of the third isolation diode D3 and the second pull-up resistor R3 to the GPIO1 pin of the main control unit 3. The third isolation diode D3 is used for unidirectional conduction, isolating reverse signals. The second pull-up resistor R3 is used to establish a potential reference with the operating power supply VCC, raising the circuit potential. When the high-voltage switch Q1 is off, the GPIO1 node remains high; when the high-voltage switch Q1 is on, the GPIO1 node is pulled low.
[0054] In one embodiment, the high-voltage switching transistor Q1 is an enhancement-type N-channel MOSFET of the same type as the first NMOS transistor Q2. The value of the third current-limiting resistor R1 can be 10kΩ, and the value of the second pull-up resistor R3 can also be 10kΩ.
[0055] When the input voltage is high, the second Zener diode D1 breaks down in reverse, and the second grounding path 21 is turned on. The potential of the cathode of the second Zener diode D1 is transmitted to the gate of the high-voltage switch Q1 through the third current-limiting resistor R1, turning on Q1. After Q1 is turned on, the GPIO1 node is pulled low to a low level through the third isolation diode D3 and the second pull-up resistor R3, outputting a second voltage signal to the main control unit 3. At the same time, the low level of the drain of Q1 is output as the second level signal to the control terminal of the controlled switching device 4.
[0056] When the input voltage is low, the second Zener diode D1 is not broken down, and the high-voltage switch Q1 remains off. The GPIO1 node is maintained at a high level by the second pull-up resistor R3, and this high level is output as the first level signal to the control terminal of the controlled switching device 4.
[0057] Please refer to Figure 2 As shown, in one embodiment, the controlled switching device 4 is specifically a second NMOS transistor Q3. The gate of the second NMOS transistor Q3 is electrically connected to the output terminal of the high-voltage detection branch 2, specifically connected to the drain node of the high-voltage switching transistor Q1. The drain of the second NMOS transistor Q3 is connected in series in the first grounding path 11, specifically, the drain of the second NMOS transistor Q3 is connected to one end of the first current-limiting resistor R6. The source of the second NMOS transistor Q3 is grounded to GND.
[0058] The second NMOS transistor Q3 is configured such that it is turned on when the gate receives a first level signal (i.e., a high level), so that the first ground path 11 is connected to ground through its drain and source; and it is turned off when the gate receives a second level signal (i.e., a low level), thereby cutting off the grounding path of the first ground path 11.
[0059] In one implementation, when the input voltage is high, the high-voltage switch Q1 is turned on, and its drain is at a low level. This low level is directly applied to the gate of the second NMOS transistor Q3, causing Q3 to be quickly turned off. At this time, even if the threshold element in the low-voltage detection branch 1 is prone to breakdown due to the high voltage, since the drain of Q3 is floating and there is no grounding loop, the entire first grounding path 11 cannot form a current loop. The first voltage signal of the low-voltage detection branch 1 is completely blocked and cannot be output to the main control unit 3.
[0060] Using an NMOS transistor as the controlled switching device offers fast response and low drive current, allowing it to be directly driven by the output level of the high-voltage branch. Its series connection in the grounding path physically suppresses the low-voltage detection branch, significantly reducing the probability of false triggering compared to traditional signal path switching schemes.
[0061] Please see Figure 3 This application also provides a voltage detection method applied to the voltage detection circuit described above. The voltage detection method includes the following steps.
[0062] Step S10: The high-voltage detection branch 2 collects the voltage of the input voltage terminal V1, and outputs a first level signal or a second voltage signal and a second level signal depending on whether the input voltage reaches the second threshold.
[0063] Specifically, when the voltage at the input voltage terminal V1 does not reach the second threshold, the high-voltage detection branch 2 outputs a first-level signal to the control terminal of the controlled switching device 4; when the voltage at the input voltage terminal V1 reaches the second threshold, the high-voltage detection branch 2 outputs a second voltage signal to the GPIO1 pin of the main control unit 3, and simultaneously outputs a second-level signal to the control terminal of the controlled switching device 4. The second voltage signal and the second-level signal are the same signal. This signal is led out from the drain node of the high-voltage switching transistor Q1, and is transmitted to the main control unit 3 through the third isolation diode D3 and the second pull-up resistor R3, and directly to the control terminal of the controlled switching device 4.
[0064] Step S20: The controlled switching device 4 receives the level signal output by the high voltage detection branch 2, and turns on or off the grounding circuit of the low voltage detection branch 1 according to the level signal.
[0065] Specifically, when the controlled switching device 4 receives the first level signal, it turns on, connecting the first grounding path 11 of the low-voltage detection branch 1; when the controlled switching device 4 receives the second level signal, it turns off, cutting off the first grounding path 11 of the low-voltage detection branch 1.
[0066] Step S30: When the low-voltage detection branch 1 is connected to the grounding circuit and the input voltage reaches the first threshold, it outputs the first voltage signal.
[0067] Specifically, when the controlled switch 4 is turned on and the voltage at the input voltage terminal V1 reaches the first threshold, the first grounding path 11 forms a complete current loop, and the low-voltage level output unit 12 is turned on, outputting the first voltage signal to the GPIO2 pin of the main control unit 3. When the controlled switch 4 is turned off, even if the input voltage reaches the first threshold, the first grounding path 11 is cut off, and the low-voltage detection branch 1 cannot output the first voltage signal.
[0068] Step S40: The main control unit 3 acquires the first voltage signal output by the low-voltage detection branch 1 and the second voltage signal output by the high-voltage detection branch 2, and identifies the voltage range of the input voltage terminal V1.
[0069] Specifically, if the main control unit 3 detects a first voltage signal on the GPIO2 pin and the GPIO1 pin is at a high level, it determines that the current input voltage is in the low-voltage range. If the main control unit 3 detects a second voltage signal on the GPIO1 pin, it determines that the current input voltage is in the high-voltage range. If both pins are at a high level, it determines that the current input voltage is invalid or no voltage is connected.
[0070] Steps S10 to S40 described above are executed in parallel after the circuit is powered on. The input voltage applies simultaneously to both the low-voltage detection branch 1 and the high-voltage detection branch 2. The output signal of the high-voltage detection branch 2 simultaneously determines the state of the controlled switching device 4 and the main control unit 3's identification of the high-voltage state. The output of the low-voltage detection branch 1 depends simultaneously on whether the input voltage reaches the first threshold and whether the controlled switching device 4 is turned on. There is no strict temporal relationship between the steps; rather, they are parallel processing logic under the steady-state condition of the circuit.
[0071] In one embodiment, the main control unit 3 acquires the output signals of the low-voltage detection branch 1 and the high-voltage detection branch 2 in an intermittent sampling mode. The intermittent sampling mode is configured with a first sampling interval and a second sampling interval, wherein the duration of the first sampling interval is shorter than the duration of the second sampling interval.
[0072] The main control unit 3 does not continuously read the GPIO pin status, but periodically wakes up at preset time intervals to perform brief voltage sampling operations. During the sampling time, the main control unit 3 reads the voltage levels of the GPIO1 and GPIO2 pins.
[0073] In one implementation, the first sampling interval, or short interval, ranges from 10 milliseconds to 1 second. The lower limit of this range, 10 milliseconds, is determined by the program execution cycle of the main control unit 3 and the time required for multiple software sampling and filtering processes for voltage detection. The MCU requires several machine cycles to complete a full voltage detection task, including AD sampling, software filtering, and logical judgment. A sampling interval lower than this lower limit will prevent the detection task from being fully executed within the interval. The upper limit of 1 second is limited by the requirement of significant voltage changes during the initial power-on phase. Accurate voltage values need to be confirmed promptly during this phase; if the interval exceeds 1 second, critical states may be missed during voltage establishment, leading to delays in subsequent load control decisions. In this implementation, the first sampling interval is preferably 1 second.
[0074] In one implementation, the second sampling interval, i.e., the long interval, ranges from 5 seconds to 10 seconds. The lower limit of this range, 5 seconds, is determined by power consumption optimization requirements. During normal operation, voltage changes are infrequent. If the sampling interval is less than 5 seconds, the main control unit 3 will wake up too frequently, resulting in insignificant power saving. The upper limit of 10 seconds is limited by the timeliness of fault protection. If the sampling interval exceeds 10 seconds, when the voltage abnormally drops or disappears, the protection action will be delayed, potentially causing the load equipment to operate under undervoltage conditions and be damaged. In this implementation, the second sampling interval is preferably 10 seconds.
[0075] When the device is in the initial power-on phase, sampling is performed using the first sampling interval. When the device is in the normal operation phase, sampling is performed using the second sampling interval. When the air conditioner controller powers on, the system enters the initial power-on phase. At this time, the main control unit 3 samples the voltage periodically using the first sampling interval to quickly confirm whether the input voltage is stable and within the normal range. After the initial power-on phase ends and all system parameters stabilize, the system enters the normal operation phase, and the main control unit 3 switches to the sampling mode with the second sampling interval.
[0076] The duration of the initial power-on phase can be pre-stored in the memory of the main control unit 3. The initial power-on phase includes not only the moment when the system is first powered on, but also the moment when the system wakes up from deep sleep.
[0077] Please refer to Figure 4 As shown, in one embodiment, during the sampling process using the second sampling interval, if the number of times the main control unit 3 fails to detect an effective voltage consecutively reaches the first threshold, then the sampling is switched to the first sampling interval.
[0078] In one implementation, the threshold value for the first count is between 2 and 3 counts. This redundant counting aims to prevent misjudgments from single sampling caused by instantaneous voltage fluctuations or electromagnetic interference. If the threshold is only 1 count, occasional noise spikes may trigger unnecessary mode switching, increasing system instability. If the threshold exceeds 3 counts, the switching response delay is too long when a voltage anomaly actually occurs, hindering timely protection. A redundant count of 2 to 3 counts strikes a balance between anti-interference capability and response speed. In this implementation, the first count threshold is preferably 3 counts.
[0079] Specifically, assuming the current operation is normal, the sampling interval is 10 seconds. The main control unit 3 maintains a first counter, initially set to 0. At each sampling time, if the main control unit 3 fails to detect a valid voltage level on GPIO1 or GPIO2 (i.e., both pins are high), the first counter increments by 1. When the value of the first counter reaches the first counting threshold, it indicates a possible voltage input anomaly or fluctuation. The main control unit 3 immediately switches the sampling interval to the first sampling interval for more intensive monitoring of the voltage status.
[0080] In one implementation, if an effective voltage is detected during a sampling in the continuous counting process, the first counter is reset to zero and counting restarts to prevent accidental fluctuations from causing unnecessary switching.
[0081] In one implementation, during the sampling process using the first sampling interval, the main control unit 3 executes the following bidirectional decision logic.
[0082] Firstly, if the number of consecutive effective voltage detections reaches the second threshold, the system switches back to the second sampling interval. In one implementation, the second threshold ranges from 2 to 3 times, and its principle is the same as the first threshold, used to prevent premature recovery from intermittent noise and missing the true voltage instability state. When switching to a short interval, the main control unit 3 maintains a second counter. Each time an effective voltage is detected (i.e., GPIO1 or GPIO2 is low), the second counter increments by 1. When the value of the second counter reaches the second threshold, it indicates that the voltage has stabilized, and the main control unit 3 switches back to the long interval to resume normal operation.
[0083] Secondly, if the number of consecutive times a valid voltage is not detected during the sampling process at the first sampling interval reaches the third threshold, the current voltage is determined to be abnormal, the equipment is shut down, and a fault is reported. In one embodiment, the third threshold ranges from 2 to 3 times, preferably 3 times. This threshold is used for reliable fault confirmation. If a fault is determined after only one invalid sample, it is very easy to cause false shutdowns due to noise, affecting equipment availability. If a fault is determined only after more than 3 invalid samples, the fault confirmation time is too long, which may cause the load to operate under undervoltage conditions and be damaged. The main control unit 3 maintains a third counter. If the number of consecutive times a valid voltage is not detected during the short-interval sampling period reaches the third threshold, it indicates that the voltage input has been continuously missing or seriously abnormal. The main control unit 3 immediately outputs a shutdown control signal, cuts off the power supply to the load, and reports a fault code to the air conditioning main control system or user terminal through the communication interface.
[0084] The second threshold can be the same as the first and third thresholds, or it can be set to different values depending on the actual application scenario.
[0085] In one implementation, after each sampling interval switch is completed, the main control unit 3 starts a cooling timer. The sampling interval is prohibited from being switched again until the cooling time threshold is reached.
[0086] In one implementation, the cooling time threshold ranges from 20 to 60 seconds. The lower limit of this range, 20 seconds, is determined by the time required to complete at least one full long-interval detection process. If the cooling period is shorter than 20 seconds, switching may be allowed again before a detection cycle of the long interval is completed, rendering the switching logic meaningless. The upper limit of 60 seconds considers the effective utilization rate of the switching mechanism. If the cooling period exceeds 60 seconds, the system cannot respond in time when the voltage state actually changes, reducing the flexibility of the switching mechanism. Furthermore, the fluctuation period of air conditioning loads such as compressors is typically on the order of tens of seconds; a cooling period of 20 to 60 seconds can effectively avoid repeated oscillations in the sampling interval during this fluctuation. In this implementation, the cooling time threshold is preferably 60 seconds.
[0087] Specifically, whether switching from a long interval to a short interval or vice versa, once the switching action is completed, the main control unit 3 immediately resets a cooling timer and starts timing. During the period when the timer value is less than a preset cooling time threshold, the main control unit 3 disables all switching decision logic. Even if the switching conditions are met during this period, the main control unit 3 will not perform the switching, but will maintain the current sampling interval until the cooling timer ends.
[0088] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When executed by a processor, the computer program implements the voltage detection method described above.
[0089] In one embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), flash memory, or a hard disk. The storage medium may exist independently or be integrated within the main control unit 3.
[0090] This application also provides an electronic device. The electronic device includes the voltage detection circuit described above.
[0091] In one embodiment, the electronic device is specifically an air conditioner controller. The input voltage terminal V1 of the voltage detection circuit is connected to the voltage output terminal of the internal power supply board of the air conditioner. The voltage detection circuit is used to detect the DC voltage level output by the internal power supply board of the air conditioner. Based on the detected voltage level, the main control unit 3 automatically adjusts the operating parameters of the air conditioner controller, such as adjusting the reference value of the fan speed control curve, or switching the compressor drive logic to match different power supply voltages.
[0092] This application also provides an air conditioning device. The air conditioning device includes the voltage detection circuit described above. The voltage detection circuit is integrated into the controller of the air conditioning device and is used to detect the voltage level output by the internal power supply board of the air conditioner.
[0093] In one implementation, the electronic device can also be other controllers that require a wide voltage input, such as a smart home gateway or an industrial field control module.
[0094] The sequence numbers or order of description of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0095] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0096] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A voltage detection circuit, characterized in that, It includes the input voltage terminal, low-voltage detection branch, high-voltage detection branch, controlled switching devices, and main control unit; The input terminal of the low-voltage detection branch is electrically connected to the input voltage terminal. The low-voltage detection branch is configured with a first grounding path. The low-voltage detection branch is configured to output a first voltage signal when the voltage at the input voltage terminal reaches a first threshold and the low-voltage detection branch is not suppressed. The input terminal of the high-voltage detection branch is electrically connected to the input voltage terminal. The high-voltage detection branch is configured to output a first level signal when the voltage at the input voltage terminal does not reach the second threshold, and to output a second voltage signal and a second level signal when the voltage at the input voltage terminal reaches the second threshold. The second threshold is greater than the first threshold; The control terminal of the controlled switching device is electrically connected to the output terminal of the high-voltage detection branch; the controlled switching device is configured to: respond to the first level signal to put the low-voltage detection branch into an operational state; or respond to the second level signal to suppress the low-voltage detection branch and block the output of the first voltage signal from the low-voltage detection branch. The output terminals of the low-voltage detection branch and the high-voltage detection branch are respectively electrically connected to the main control unit. The main control unit is used to receive the first voltage signal and the second voltage signal, and to identify the voltage state of the input voltage terminal.
2. The voltage detection circuit according to claim 1, characterized in that, The controlled switching device is connected in series in the first grounding path; The controlled switching device is configured to turn on in response to the first level signal, thereby turning on the first grounding path and putting the low-voltage detection branch into an operational state. When responding to the second level signal, the circuit is disconnected, thus disconnecting the first grounding path, suppressing the low-voltage detection branch, and blocking the output of the first voltage signal from the low-voltage detection branch.
3. The voltage detection circuit according to claim 2, characterized in that, The first grounding path includes a first Zener diode and a first current-limiting resistor; The input voltage terminal, the first Zener diode, the first current-limiting resistor, and the controlled switching device are connected in series; One end of the controlled switching device is electrically connected to the first current-limiting resistor, and the other end is grounded; When the input voltage reaches the first threshold but not the second threshold, the first Zener diode breaks down, the controlled switching device is turned on, the first grounding path is turned on, and the low-voltage detection branch has the excitation condition to output the first voltage signal.
4. The voltage detection circuit according to claim 3, characterized in that, The low-voltage detection branch also includes a low-voltage level output unit; The low-voltage level output unit is electrically connected to the anode of the first Zener diode and the main control unit, respectively. The low-voltage level output unit is configured to output the first voltage signal to the main control unit when the first Zener diode breaks down and the low-voltage detection branch is not suppressed.
5. The voltage detection circuit according to claim 1, characterized in that, The high-voltage detection branch includes a second grounding path, which includes a second Zener diode and a second current-limiting resistor. The cathode of the second Zener diode is electrically connected to the input voltage terminal, and the anode is grounded through the second current-limiting resistor; When the input voltage reaches the second threshold, the second Zener diode breaks down, and the second grounding path is turned on, so that the high voltage detection branch has the excitation conditions to output the second voltage signal.
6. The voltage detection circuit according to claim 5, characterized in that, The high-voltage detection branch also includes a high-voltage level output unit; The high-voltage output unit is electrically connected to the cathode of the second Zener diode and the main control unit, respectively. The high-voltage output unit is configured to output the second voltage signal to the main control unit when the second Zener diode breaks down. The control terminal of the controlled switching device is electrically connected to the high-voltage level output unit. The high-voltage level output unit is further configured to: output the first level signal to the controlled switching device when the second Zener diode is not broken down, and output the second level signal to the controlled switching device when the second Zener diode is broken down.
7. The voltage detection circuit according to claim 3, characterized in that, The low-voltage detection branch also includes a low-voltage level output unit, which includes a first driving current limiting subunit, a first switching subunit, and a first level generation subunit. The main control unit, the first level generation subunit, the first switch subunit, and the first drive current limiting subunit are connected in series, and the first drive current limiting subunit is electrically connected to the anode of the first Zener diode. The low-voltage level output unit is configured to output the first level signal to the main control unit when the first grounding path is turned on.
8. The voltage detection circuit according to claim 7, characterized in that, The first driving current limiting subunit is the third current limiting resistor; One end of the third current-limiting resistor is electrically connected to the anode of the first Zener diode, and the other end is electrically connected to the control terminal of the first switching subunit, for transmitting a signal from the anode of the first Zener diode to the control terminal of the first switching subunit.
9. The voltage detection circuit according to claim 8, characterized in that, The first switching subunit is a first NMOS transistor; The gate of the first NMOS transistor is electrically connected to the third current-limiting resistor, the drain is electrically connected to the first level generation sub-unit, and the source is grounded; The first NMOS transistor is configured such that when the gate receives a signal from the third current-limiting resistor, the drain and source are connected. When the gate does not receive a signal from the third current-limiting resistor, the drain is disconnected from the source.
10. The voltage detection circuit according to claim 9, characterized in that, The first level generation subunit includes a first pull-up resistor and a first isolation diode; The drain of the first NMOS transistor, the first isolation diode, the first pull-up resistor, and the main control unit are electrically connected in sequence. The first isolation diode is used for unidirectional conduction to isolate reverse signals; The first pull-up resistor is used in conjunction with the main control unit to generate the first voltage signal.
11. The voltage detection circuit according to claim 1, characterized in that, The controlled switching device is a second NMOS transistor; The gate of the second NMOS transistor is electrically connected to the output terminal of the high-voltage detection branch, the drain of the second NMOS transistor is connected in series in the first grounding path, and the source is grounded; The second NMOS transistor is configured to turn on when it receives the first level signal and turn off when it receives the second level signal.
12. The voltage detection circuit according to any one of claims 1-11, characterized in that, The main control unit is configured to acquire the output signals of the low-voltage detection branch and the high-voltage detection branch in an intermittent sampling mode.
13. A voltage detection method, characterized in that, Applied to the circuit according to any one of claims 1-12, the method comprises: S10: The high-voltage detection branch collects the voltage at the input voltage terminal and outputs a first-level signal or a second voltage signal and a second-level signal depending on whether the input voltage reaches the second threshold. S20: The controlled switching device receives the level signal output from the high-voltage detection branch and turns on or off the grounding loop of the low-voltage detection branch according to the level signal; S30: The low-voltage detection branch outputs a first voltage signal when the grounding loop is connected and the input voltage reaches the first threshold. S40: The main control unit acquires the first voltage signal output from the low-voltage detection branch and / or the second voltage signal output from the high-voltage detection branch, and identifies the voltage range of the input voltage terminal.
14. The voltage detection method according to claim 13, characterized in that, The main control unit acquires the output signals of the low-voltage detection branch and the high-voltage detection branch in an intermittent sampling mode. This intermittent sampling mode includes dynamically adjusting the sampling interval, wherein: During the initial power-on phase, sampling is performed using the first sampling interval; During normal operation, sampling is performed using the second sampling interval; The duration of the first sampling interval is less than the duration of the second sampling interval.
15. The voltage detection method according to claim 14, characterized in that, The dynamic adjustment of the sampling interval also includes: When sampling at the second sampling interval, if no valid voltage signal is detected for N consecutive times, the sampling interval is switched to the first sampling interval. When sampling at the first sampling interval, if a valid voltage signal is detected N times consecutively, the sampling interval is switched back to the second sampling interval, where N is a preset positive integer.
16. The voltage detection method according to claim 15, characterized in that, It also includes a cooling-off period step: after the sampling interval switching is completed, a preset cooling-off period is entered, during which the sampling interval switching is not performed.
17. The voltage detection method according to claim 15 or 16, characterized in that, It also includes fault handling steps: if no valid voltage signal is detected consecutively multiple times during the first sampling interval, the voltage is determined to be abnormal, and a fault alarm and / or equipment shutdown is executed.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the voltage detection method as described in any one of claims 13-17.
19. An electronic device, characterized in that, Includes the voltage detection circuit as described in any one of claims 1-12.
20. An air conditioning device, characterized in that, Includes the voltage detection circuit as described in any one of claims 1-12.
