Voltage detection device, control method thereof and electronic equipment
By converting the sine wave into a square wave and calculating its level length, the problems of complex and high cost of voltage detection circuits in the prior art are solved, and low-cost AC power detection is achieved.
Patent Information
- Application Number
- CN202510501635.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-06-20
AI Technical Summary
In the prior art, the voltage detection circuit has a complex structure and high cost.
By using the on-off characteristics of the voltage regulator, the sine wave output from the target AC power supply is converted into a square wave, and the current voltage of the target AC power supply is calculated based on the high and low level time of the square wave and the reference voltage of the voltage regulator to determine whether the set requirements are met.
The detection of AC power is achieved using a low-cost simple circuit, reducing circuit complexity and cost.
Smart Images

Figure CN120177845A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of detection technologies, and in particular, to a voltage detection device, a control method thereof, and an electronic device. Background Art
[0002] Currently, there are generally the following two schemes for isolated AC voltage sampling: using a voltage transformer for isolated sampling, or using an isolation chip to convert an analog signal into a digital signal and then performing isolated sampling through an optocoupler. These two schemes usually have relatively complex circuits and high overall costs. Summary of the Invention
[0003] Embodiments of the present invention provide a voltage detection device, a control method thereof, and an electronic device, which solve the technical problems of complex structure and high cost of the existing voltage detection circuit.
[0004] Embodiments of the present invention provide a voltage detection device, and the voltage detection device includes:
[0005] A waveform conversion unit, in which a voltage regulator is provided, for converting a sine wave output by a target AC power supply into a square wave by using the on-off characteristic of the voltage regulator;
[0006] A control unit, configured to calculate the current voltage of the target AC power supply based on the high and low level durations within a single cycle of the square wave and the reference voltage of the voltage regulator, and determine whether the target AC power supply meets the set requirements by using the current voltage.
[0007] Further, the waveform conversion unit includes an acquisition module, an optocoupler isolation module, and a waveform output module; the acquisition module includes the voltage regulator;
[0008] The acquisition module is connected to the target AC power supply, for dividing the output voltage of the target AC power supply and controlling the on-off of the optocoupler isolation module by using the on-off characteristic of the voltage regulator;
[0009] The optocoupler isolation module is used to output a low level when conducting, and the waveform output module is used to output a high level when the optocoupler isolation module is turned off, so as to convert the sine wave output by the target AC power supply into a square wave.
[0010] Further, the acquisition module further includes a diode, a first resistor, a second resistor, a second resistor, and a third resistor:
[0011] The positive electrode of the diode is electrically connected to the live wire of the target AC power supply, the negative electrode of the diode is electrically connected to the first end of the first resistor, and the negative electrode of the diode is electrically connected to the first end of the third resistor;
[0012] The second terminal of the first resistor is electrically connected to the neutral wire of the target AC power supply through the second resistor; the second terminal of the third resistor is electrically connected to the opto-isolation module;
[0013] The negative pole of the voltage regulator is electrically connected to the opto-isolation module, the positive pole of the voltage regulator is electrically connected to the neutral wire of the target AC power supply, and the reference terminal of the voltage regulator is electrically connected to the second terminal of the first resistor.
[0014] Further, the acquisition module further includes a fourth resistor;
[0015] The first terminal of the fourth resistor is electrically connected to the second terminal of the third resistor, and the second terminal of the fourth resistor is electrically connected to the positive pole of the voltage regulator.
[0016] Further, the opto-isolation module includes an opto-coupler;
[0017] The positive input terminal of the opto-coupler is electrically connected to the second terminal of the third resistor, the negative input terminal of the opto-coupler is electrically connected to the negative pole of the voltage regulator, the positive output terminal of the opto-coupler is electrically connected to the control unit, and the negative output terminal of the opto-coupler is grounded.
[0018] Further, the waveform output module includes a first power supply and a fifth resistor;
[0019] The first terminal of the fifth resistor is electrically connected to the positive output terminal of the opto-coupler and the control unit respectively; the second terminal of the fifth resistor is electrically connected to the first power supply.
[0020] Further, the control unit includes a period detection sub-unit, a voltage calculation sub-unit and a voltage detection sub-unit;
[0021] The period detection sub-unit is configured to obtain the high-level duration and the low-level duration of the square wave within a single period;
[0022] The voltage calculation sub-unit is configured to calculate the current voltage of the target AC power supply based on the high-level duration, the low-level duration and the reference voltage of the voltage regulator;
[0023] The voltage detection sub-unit is configured to determine whether the target AC power supply meets the set requirements based on the current voltage.
[0024] Further, the voltage calculation sub-unit is specifically configured to calculate according to the formula Calculate the current voltage of the target AC power supply, where V is the current voltage, V0 is the reference voltage of the voltage regulator, R1 is the resistance value of the first resistor, R2 is the resistance value of the second resistor, T is the period of the sine wave, T = t1 + t2, t1 is the low-level duration of the square wave, and t2 is the high-level duration of the square wave.
[0025] An embodiment of the present invention also provides a control method for a voltage detection device. The control method includes:
[0026] Convert the sine wave output by the target AC power supply into a square wave by using the on-off characteristic of the voltage regulator;
[0027] Obtain the high and low level durations of the square wave within a single period and the reference voltage of the voltage regulator;
[0028] Calculate the current voltage of the target AC power supply based on the high and low level durations and the reference voltage;
[0029] Determine whether the target AC power supply meets the set requirements by using the current voltage.
[0030] An embodiment of the present invention also provides an electronic device, and the electronic device includes the voltage detection device described in any of the above embodiments.
[0031] An embodiment of the present invention discloses a voltage detection device, its control method, and an electronic device. The device includes a waveform conversion unit, in which a voltage regulator is provided for converting the sine wave output by the target AC power supply into a square wave by using the on-off characteristic of the voltage regulator; a control unit configured to calculate the current voltage of the target AC power supply based on the high and low level durations of the square wave within a single period and the reference voltage of the voltage regulator, and determine whether the target AC power supply meets the set requirements by using the current voltage. By converting the sine wave into a square wave by using the on-off characteristic of the voltage regulator and then inversely calculating the current voltage of the target AC power supply according to the high and low level durations of the square wave and the reference voltage of the voltage regulator, the present invention solves the technical problems of complex circuit structure and high cost in the prior art, and realizes the technical effect of detecting the AC power supply by using a simple circuit with low cost. Description of the Drawings
[0032] Figure 1 is a structural diagram of a voltage detection device provided by an embodiment of the present invention;
[0033] Figure 2 is a circuit diagram of a voltage detection device provided by an embodiment of the present invention;
[0034] Figure 3 is a schematic diagram of converting a sine wave into a square wave by a voltage detection device provided by an embodiment of the present invention;
[0035] Figure 4 It is a flowchart of a control method for a voltage detection device provided by an embodiment of the present invention. Detailed implementation manners
[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of convenience of description, only parts related to the present invention rather than all structures are shown in the drawings.
[0037] It should be noted that the terms "first", "second", etc. in the description, claims and drawings of the present invention are used to distinguish different objects, rather than to limit a specific order. Each of the following embodiments of the present invention can be implemented independently, and the embodiments can also be combined with each other. The embodiments of the present invention do not make specific limitations in this regard.
[0038] Figure 1 It is a structural diagram of a voltage detection device provided by an embodiment of the present invention.
[0039] As Figure 1 shown, the voltage detection device includes:
[0040] A waveform conversion unit 10, in which a voltage regulator Z1 is provided, and is used to convert the sine wave output by the target AC power supply 30 into a square wave by using the on-off characteristic of the voltage regulator Z1.
[0041] A control unit 20, configured to calculate the current voltage of the target AC power supply 30 based on the high and low level durations within a single cycle of the square wave and the reference voltage of the voltage regulator Z1, and determine whether the target AC power supply 30 meets the set requirements by using the current voltage.
[0042] Among them, the voltage regulator Z1 selects a three-terminal adjustable voltage regulator with relatively high precision, and preferably a voltage regulator of model TL431; the output voltage of the TL431 voltage regulator can be set to any value within the range of 2.5V to 36V by using two resistors. It has relatively high voltage regulation accuracy, low dynamic impedance and high voltage regulation characteristics.
[0043] Exemplarily, the target AC power supply 30 can be mains power. In some application scenarios, such as some devices with resistive loads need the output power of the mains power to be stable to ensure the safe and reliable stable operation of the load. According to the power calculation principle P = V 2 / R, when the voltage V fluctuates, the corresponding output power P will also fluctuate. Therefore, it is necessary to detect the voltage V to determine whether it currently meets the requirements.
[0044] Specifically, the waveform conversion unit 10 is electrically connected to the target AC power supply 30. When the voltage of the target AC power supply 30 is higher than the reference voltage of the voltage regulator Z1, the voltage regulator Z1 conducts, and the waveform conversion unit 10 outputs a low level; when the voltage of the target AC power supply 30 is lower than the reference voltage of the voltage regulator Z1, the voltage regulator Z1 does not conduct, and the waveform conversion unit 10 outputs a high level. Then, the sine wave of the target AC power supply 30 is converted into a square wave of high and low levels. The control unit 20 can obtain the high-level duration and low-level duration of the converted square wave within one cycle, and perform inverse calculation based on the high and low level durations and the known reference voltage of the voltage regulator Z1 to obtain the current voltage V of the target AC power supply 30. Finally, it is determined whether the current voltage V meets the set requirements based on the calculated current voltage V.
[0045] In the present invention, by using the on-off characteristic of the voltage regulator to convert the sine wave into a square wave, and then inversely calculating the current voltage of the target AC power supply according to the high and low level durations of the square wave and the reference voltage of the voltage regulator, the technical problems of complex structure and high cost of the voltage detection circuit in the prior art are solved, and the technical effect of detecting the AC power supply by using a simple circuit with low cost is achieved.
[0046] Optionally, as Figure 1 shown, the waveform conversion unit 10 includes a sampling module 11, an optocoupler isolation module 12, and a waveform output module 13; the sampling module 11 includes a voltage regulator Z1.
[0047] The sampling module 11 is connected to the target AC power supply 30, and is used to divide the output voltage of the target AC power supply 30, and control the on-off of the optocoupler isolation module 12 by using the on-off characteristic of the voltage regulator Z1.
[0048] The optocoupler isolation module 12 is used to output a low level when conducting, and the waveform output module 13 is used to pull up the level when the optocoupler isolation module 12 is turned off, so as to convert the sine wave output by the target AC power supply 30 into a square wave.
[0049] Specifically, the sampling module 11 is connected to the target AC power supply 30, divides the voltage output by the target AC power supply 30, and compares the partial voltage passing through the voltage regulator Z1 with the reference voltage of the voltage regulator Z1. When the partial voltage passing through the voltage regulator Z1 is higher than the reference voltage of the voltage regulator Z1, the voltage regulator Z1 conducts, the optocoupler isolation module 12 conducts and outputs a low level, that is, the waveform conversion unit 10 outputs a low level; when the partial voltage passing through the voltage regulator Z1 is lower than the reference voltage of the voltage regulator Z1, the voltage regulator Z1 does not conduct, the optocoupler isolation module 12 does not conduct, and the waveform output module 13 pulls up the level, that is, the waveform conversion unit 10 outputs a high level, so as to convert the sine wave of the target AC power supply 30 into a square wave of high and low levels.
[0050] Figure 2It is the circuit diagram of a voltage detection device provided by an embodiment of the present invention.
[0051] Optionally, as Figure 2 shown, the acquisition module 11 further includes a diode D1, a first resistor R1, a second resistor R2, and a third resistor R3.
[0052] The positive electrode of the diode D1 is electrically connected to the live wire L of the target AC power supply 30, the negative electrode of the diode D1 is electrically connected to the first end of the first resistor R1, and the negative electrode of the diode D1 is electrically connected to the first end of the third resistor R3.
[0053] The second end of the first resistor R2 is electrically connected to the neutral wire N of the target AC power supply 30 through the second resistor R2; the second end of the third resistor R3 is electrically connected to the optocoupler isolation module 12.
[0054] The negative electrode K of the voltage regulator Z1 is electrically connected to the optocoupler isolation module 12, the positive electrode A of the voltage regulator Z1 is electrically connected to the neutral wire N of the target AC power supply 30, and the reference terminal R of the voltage regulator Z1 is electrically connected to the second end of the first resistor R1.
[0055] Specifically, after the voltage output by the target AC power supply 30 passes through the diode D1, it is divided by the first resistor R1 and the second resistor R2. Then the voltage V2 across the second resistor R2 = V * (R2 / (R1 + R2)). Therefore, the voltage threshold V for the target AC power supply 30 to turn on the voltage regulator Z1 = V2 * (R1 + R2) / R2. Where V is the total voltage output by the target AC power supply 30, R1 is the resistance value of the first resistor R1, and R2 is the resistance value of the second resistor R2. Then.
[0056] Taking the voltage regulator Z1 as TL431 as an example, its reference voltage V0 is 2.5V. Then the voltage V2 across the second resistor R2 is compared with the reference voltage V0 of the voltage regulator Z1. If V2 ≥ V0, the voltage regulator Z1 conducts, the optocoupler isolation module 12 conducts and outputs a low level, that is, the waveform conversion unit 10 outputs a low level. Taking V2 = V0 as an example, V = V0 * (R1 + R2) / R2; if V2 < V0, the voltage regulator Z1 does not conduct, the optocoupler isolation module 12 does not conduct, and the waveform output module 13 pulls up the level, that is, the waveform conversion unit 10 outputs a high level, realizing the conversion of the sine wave of the target AC power supply 30 into a square wave of high and low levels.
[0057] Optionally, as Figure 2 shown, the acquisition module 11 further includes a fourth resistor R4;
[0058] The first end of the fourth resistor R4 is electrically connected to the second end of the third resistor R3, and the second end of the fourth resistor R4 is electrically connected to the positive electrode A of the voltage regulator Z1.
[0059] Specifically, in order to prevent the optocoupler isolation module 12 and the voltage regulator Z1 from failing due to overvoltage, a fourth resistor R4 is provided in parallel at both ends of the optocoupler isolation module 12 and the voltage regulator Z1, for pulling down the voltage at both ends of the optocoupler isolation module 12 and the voltage regulator Z1.
[0060] Optionally, as Figure 2 shown, the optocoupler isolation module 12 includes an optocoupler OC;
[0061] The positive input terminal of the optocoupler OC is electrically connected to the second terminal of the third resistor R3, the negative input terminal of the optocoupler OC is electrically connected to the negative electrode K of the voltage regulator Z1, the positive output terminal of the optocoupler OC is electrically connected to the control unit 20, and the negative output terminal of the optocoupler OC is grounded to GND.
[0062] Optionally, as Figure 2 shown, the waveform output module 13 includes a first power supply VCC and a fifth resistor R5;
[0063] The first terminal of the fifth resistor R5 is electrically connected to the positive output terminal of the optocoupler OC and the control unit 20 respectively; the second terminal of the fifth resistor R5 is electrically connected to the first power supply VCC.
[0064] Specifically, when the voltage regulator Z1 is turned on, the input terminal of the optocoupler OC is turned on, the optocoupler OC starts to work, its output terminal receives the optical signal at the input terminal and converts it into an electrical signal, and this electrical signal is pulled down to the ground by the negative output terminal of the optocoupler OC, so a low level is output; when the voltage regulator Z1 is turned off, the input terminal of the optocoupler OC is turned off, the optocoupler OC does not work, and no optical signal is emitted from the input terminal. At this time, the first power supply VCC in the waveform output module 13 pulls up the level through the fifth resistor R5, so a high level is output.
[0065] In the embodiment of the present invention, only the fifth resistor R5 and the first power supply VCC need to be provided at the output terminal of the optocoupler isolation module 12 to realize the conversion from a sine wave to a square wave. The circuit structure is relatively simple, fewer devices are used, and the detection cost is reduced to the greatest extent. At the same time, due to the use of fewer components, while simplifying the production process, the integration degree of the circuit board is improved, the space occupation is reduced, which is beneficial to the miniaturization and light weight of the device.
[0066] Optionally, as Figure 1 shown, the control unit 20 includes a period detection sub-unit 21, a voltage calculation sub-unit 22, and a voltage detection sub-unit 23.
[0067] The period detection subunit 21 is configured to obtain the high-level duration and the low-level duration of the square wave within a single period; the voltage calculation subunit 22 is configured to calculate the current voltage of the target AC power supply 30 based on the high-level duration, the low-level duration, and the reference voltage of the voltage regulator Z1; the voltage detection subunit 23 is configured to determine whether the target AC power supply 30 meets the set requirements based on the current voltage.
[0068] Optionally, the voltage calculation subunit 22 is specifically configured to calculate according to the formula to calculate the current voltage of the target AC power supply, where V is the current voltage, V0 is the reference voltage of the voltage regulator, R1 is the resistance value of the first resistor, R2 is the resistance value of the second resistor, T is the period of the sine wave, T = t1 + t2, t1 is the low-level duration of the square wave, and t2 is the high-level duration of the square wave.
[0069] Figure 3 It is a schematic diagram of converting a sine wave into a square wave by the voltage detection device provided by an embodiment of the present invention.
[0070] Specifically, as Figure 3 shown, if the target AC power supply 30 is a sine wave, the function of the target AC power supply 30 with respect to time t can be expressed as where T is the period of the target AC power supply 30, V is the voltage of the target AC power supply 30. Taking the target AC power supply 30 as the mains power supply as an example, T = 20 ms.
[0071] See Figure 3 , the changing sine wave is converted by the waveform conversion unit 10 to obtain a square wave. The period of the square wave is also T. When the square wave signal enters the control unit 20, the period detection subunit 21 in the control unit 20 will detect the high and low level durations of the square wave within a period T. Among them, the low-level duration is t1, and the high-level duration is t2. If the target AC power supply 30 is the mains power supply, the period T is 20 ms. If the target AC power supply 30 outputs an AC voltage with an uncertain frequency, then its period T = t1 + t2.
[0072] Since the rising time of the positive half-wave of the sine wave from 0 to 90° phase is T / 4, the duration of the sine wave from 0 to 90° phase relative to the low level of the square wave is t1 / 2. Therefore, the falling edge duration of the square wave can be obtained as T / 4 - t1 / 2. At this time, the corresponding current voltage of the target AC power supply 30 is:
[0073]
[0074] Therefore, the current voltage V of the target AC power supply 30 can be calculated from the above formula as:
[0075]
[0076] Therefore, after the period detection subunit 21 detects that the low-level duration of the square wave is t1 and the high-level duration is t2 within a period T, the voltage calculation subunit 22 calculates the current voltage of the target AC power supply 30 based on the formula where V0 is the reference voltage of the voltage regulator Z1. Exemplarily, when the voltage regulator Z1 selects TL431, the reference voltage V0 = 2.5V.
[0077] Subsequently, the voltage detection subunit 23 determines whether the target AC power supply 30 meets the set requirements based on the calculated current voltage V. Exemplarily, the voltage detection subunit 23 compares the current voltage V with a preset voltage threshold. If it is lower than the preset voltage threshold, it indicates that the target AC power supply 30 does not meet the power requirements of the connected device at this time. At this time, the control unit 20 can alarm through the alarm subunit to prompt the user to perform maintenance.
[0078] Figure 4 It is a flowchart of a control method for a voltage detection device provided by an embodiment of the present invention.
[0079] As Figure 4 shown, the control method of the voltage detection device specifically includes the following steps:
[0080] S101, convert the sine wave output by the target AC power supply into a square wave by using the on-off characteristic of the voltage regulator.
[0081] Specifically, when the voltage of the target AC power supply is higher than the reference voltage of the voltage regulator Z1, the voltage regulator Z1 conducts, and the waveform conversion unit outputs a low level; when the voltage of the target AC power supply is lower than the reference voltage of the voltage regulator Z1, the voltage regulator Z1 does not conduct, and the waveform conversion unit outputs a high level. Then, the sine wave of the target AC power supply is converted into a square wave of high and low levels.
[0082] S102, obtain the high and low level durations of the square wave within a single period and the reference voltage of the voltage regulator.
[0083] Specifically, the period detection subunit in the control unit detects the high and low level durations of the square wave within a period T, including the low-level duration t1 and the high-level duration t2. At the same time, the control unit also obtains the reference voltage V0 of the voltage regulator.
[0084] S103, calculate the current voltage of the target AC power supply based on the high and low level durations and the reference voltage.
[0085] Specifically, after the period detection subunit detects the high and low level durations of the square wave, the voltage calculation subunit calculates the current voltage V of the target AC power supply based on the formula
[0086] S104. Determine whether the target AC power supply meets the set requirements using the current voltage.
[0087] Specifically, after obtaining the current voltage V of the target AC power supply, the voltage detection sub-unit 23 compares the calculated current voltage V with a preset voltage threshold to determine whether the target AC power supply meets the set requirements.
[0088] The control method of the voltage detection device provided by the embodiments of the present invention is executed by the voltage detection device in the above embodiments. Therefore, the control method of the voltage detection device provided by the embodiments of the present invention also has the beneficial effects described in the above embodiments, which will not be elaborated here.
[0089] The embodiments of the present invention also provide an electronic device, which includes the voltage detection device in any of the above embodiments.
[0090] The electronic device provided by the embodiments of the present invention includes the voltage detection device in the above embodiments. Therefore, the electronic device provided by the embodiments of the present invention also has the beneficial effects described in the above embodiments, which will not be elaborated here.
[0091] In the description of the embodiments of the present invention, unless otherwise clearly defined and limited, the terms "installation", "connection", and "connection" shall be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0092] Finally, it should be noted that the above is only the preferred embodiment of the present invention and the applied technical principle. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A voltage detection device, characterized in that: The voltage detection device comprises: A waveform conversion unit, wherein a voltage stabilizer is provided in the waveform conversion unit, and is used to convert the sine wave output by the target AC power supply into a square wave by utilizing the on-off characteristics of the voltage stabilizer; The control unit is configured to calculate the current voltage of the target AC power source based on the high and low level durations of the square wave in a single cycle and the reference voltage of the regulator, and use the current voltage to determine whether the target AC power source meets the set requirements.
2. The voltage detection device according to claim 1, characterized in that: The waveform conversion unit includes an acquisition module, an optical coupling isolation module and a waveform output module; the acquisition module includes the voltage stabilizer; The acquisition module is connected to the target AC power supply, and is used to divide the output voltage of the target AC power supply, and use the on-off characteristics of the voltage regulator to control the on-off of the optical coupling isolation module; The optocoupler isolation module is used to output a low level when it is turned on, and the waveform output module is used to output a high level when the optocoupler isolation module is turned off, so as to convert the sine wave output by the target AC power supply into a square wave.
3. The voltage detection device according to claim 2, characterized in that: The acquisition module also includes a diode, a first resistor, a second resistor and a third resistor; The positive electrode of the diode is electrically connected to the live wire of the target AC power source, the negative electrode of the diode is electrically connected to the first end of the first resistor, and the negative electrode of the diode is electrically connected to the first end of the third resistor; The second end of the first resistor is electrically connected to the neutral line of the target AC power supply through the second resistor; the second end of the third resistor is electrically connected to the optical coupling isolation module; The negative electrode of the voltage stabilizer is electrically connected to the optical coupling isolation module, the positive electrode of the voltage stabilizer is electrically connected to the neutral line of the target AC power supply, and the reference end of the voltage stabilizer is electrically connected to the second end of the first resistor.
4. The voltage detection device according to claim 3, characterized in that: The acquisition module also includes a fourth resistor; The first end of the fourth resistor is electrically connected to the second end of the third resistor, and the second end of the fourth resistor is electrically connected to the positive electrode of the regulator.
5. The voltage detection device according to claim 3, characterized in that: The optical coupling isolation module includes a photoelectric coupler; The positive input terminal of the photoelectric coupler is electrically connected to the second end of the third resistor, the negative input terminal of the photoelectric coupler is electrically connected to the negative electrode of the voltage regulator, the positive output terminal of the photoelectric coupler is electrically connected to the control unit, and the negative output terminal of the photoelectric coupler is grounded.
6. The voltage detection device according to claim 5, characterized in that: The waveform output module includes a first power supply and a fifth resistor; The first end of the fifth resistor is electrically connected to the positive output end of the photoelectric coupler and the control unit respectively; the second end of the fifth resistor is electrically connected to the first power supply.
7. The voltage detection device according to claim 3, characterized in that: The control unit includes a period detection subunit, a voltage calculation subunit and a voltage detection subunit; The period detection subunit is configured to obtain a high level duration and a low level duration of the square wave in a single period; The voltage calculation subunit is configured to calculate the current voltage of the target AC power source based on the high level duration, the low level duration and the reference voltage of the voltage regulator; The voltage detection subunit is configured to determine whether the target AC power source meets the set requirement based on the current voltage.
8. The voltage detection device according to claim 7, characterized in that: The voltage calculation subunit is specifically configured to calculate the voltage according to the formula The current voltage of the target AC power supply is calculated, wherein V is the current voltage, V0 is the reference voltage of the voltage regulator, R1 is the resistance value of the first resistor, R2 is the resistance value of the second resistor, T is the period of the sine wave, T=t1+t2, t1 is the low level duration of the square wave, and t2 is the high level duration of the square wave.
9. A control method for a voltage detection device, characterized in that: The control method comprises: The on-off characteristic of the voltage stabilizer is used to convert the sine wave output by the target AC power supply into a square wave; Obtaining the high and low level durations of the square wave in a single cycle and the reference voltage of the voltage regulator; Calculating the current voltage of the target AC power source based on the high and low level durations and the reference voltage; The current voltage is used to determine whether the target AC power source meets a set requirement.
10. An electronic device, characterized in that: The electronic device comprises the voltage detection device according to any one of claims 1 to 8.