A single-chip microcomputer realizes the zero-crossing detection circuit of power-off saving function

CN224732041UActive Publication Date: 2026-09-08ZHONGSHAN TULIN ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202521840966.6
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2026-09-08
Estimated Expiration
2035-08-28

AI Technical Summary

Technical Problem

缺点:响应慢,无法区分短时波动与真实断电

Benefits of technology

本实用新型通过过零检测实时判断交流电通断,提前触发数据保存。利用交流电周期特性提高检测可靠性,避免误判。实现毫秒级响应,确保关键数据完整存储至非易失性存储器;实现了低成本、高可靠性的掉电保存功能,适用于家电、工业控制等领域。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224732041U_ABST
    Figure CN224732041U_ABST
Patent Text Reader

Abstract

The utility model discloses a singlechip realizes zero -crossing detection circuit of power -down save function, including photo -coupler U3 and MCU, photo -coupler U3's input 1 interface is linked with alternating current AC_N end, photo -coupler U3's input 2 interface is linked with resistance R29 one end, and the other end of resistance R29 is linked with resistance R33 one end, and the other end of resistance R33 is linked with alternating current AC_L3, and photo -coupler U3's output 3 interface is linked with capacitor C9 one end, and photo -coupler U3's output 4 interface is linked with resistance R11 one end and resistance R21 one end, and the other end of resistance R11 is linked with MCU power end VDD5, and the other end of resistance R21 and capacitor C9 are all linked with Zero end, the utility model discloses through zero -crossing detection real -time judgment AC on -off, triggers data save in advance. Utilize the period characteristic of alternating current to improve detection reliability, avoid misjudgment. Realize millisecond level response, ensure key data complete storage to non -volatile memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model relates to the field of zero-crossing detection technology, specifically a zero-crossing detection circuit that uses a microcontroller to achieve power-off data retention. Background Technology

[0002] In devices such as smart meters and industrial controllers, unexpected power outages can lead to the loss of operating parameters and metering data. Traditional solutions rely on backup batteries or supercapacitors for data preservation, but these are costly and have limited lifespans. Another solution triggers data preservation by detecting DC-side voltage drops, but the response is delayed due to the limitations of capacitor energy storage.

[0003] Existing solutions: DC voltage monitoring method: This method continuously samples the rectified DC voltage using an ADC, and saves the data when the voltage falls below a threshold. Disadvantages: Slow response time, inability to distinguish between short-term fluctuations and actual power outages.

[0004] Hardware watchdog circuit: detects the Power Good signal of the power chip, but cannot predict AC power failure.

[0005] Therefore, the shortcomings of existing technologies include large detection delays and insufficient storage time; susceptibility to voltage fluctuations caused by sudden load changes; and inability to distinguish between power grid outages and equipment shutdowns. Utility Model Content

[0006] The purpose of this invention is to provide a zero-crossing detection circuit for a microcontroller to achieve power-down retention, so as to solve the problems mentioned in the background art.

[0007] To achieve the above objectives, this utility model provides the following technical solution: a zero-crossing detection circuit for power-down retention function of a microcontroller, comprising an optocoupler U3 and an MCU. The input terminal 1 of the optocoupler U3 is connected to the AC_N terminal. The input terminal 2 of the optocoupler U3 is connected to one end of resistor R29. The other end of resistor R29 is connected to one end of resistor R33. The other end of resistor R33 is connected to AC_L3. The output terminal 3 of the optocoupler U3 is connected to one end of capacitor C9. The output terminal 4 of the optocoupler U3 is connected to one end of resistor R11 and one end of resistor R21. The other end of resistor R11 is connected to the MCU power supply terminal VDD5. The other ends of resistor R21 and capacitor C9 are both connected to the Zero terminal.

[0008] The optocoupler U3 has its input terminals connected to AC power supplies AC_L and AC_N, and its output terminal pulled up to the MCU power supply via resistor R11. When the AC power crosses zero, the optocoupler is cut off, outputting a high level; during normal conduction, it outputs a low-level pulse sequence. The MCU monitors the zero-crossing signal pulse interval: if N consecutive pulses are missing (N≥2), it determines that the AC power is off. An interrupt is triggered, and the RAM data is immediately saved to EEPROM / Flash. After the power failure determination, the system switches to backup capacitor power supply, completes data saving, and then shuts down.

[0009] Preferably, the MCU monitors the signal pulse interval at the Zero terminal: if N pulses are missing consecutively (N≥2), it is determined that the AC power is off; an interrupt is triggered to immediately save the RAM data to EEPROM / Flash.

[0010] Preferably, the resistor R11 has a resistance of 21 kΩ, an accuracy of ±1%, and a package size of 0.04 inches in length and 0.02 inches in width.

[0011] Preferably, the resistor R21 has a resistance of 100 ohms, an accuracy of ±1%, and a package size of 0.04 inches in length and 0.02 inches in width.

[0012] Preferably, the resistor R29 has a resistance of 220 kΩ, an accuracy of ±1%, and a package size of 0.12 inches in length and 0.06 inches in width.

[0013] Preferably, the resistor R33 has a resistance of 220 kΩ, an accuracy of ±1%, and a package size of 0.12 inches in length and 0.06 inches in width.

[0014] Preferably, the capacitor C9 has a capacitance of 0.01μF, an accuracy of ±10%, and package dimensions of 0.12 inches in length and 0.06 inches in width; the rated operating voltage is 50V.

[0015] Preferably, the optocoupler U3 is model UTDM354A(T1)-GV / SOP4.

[0016] Compared with the prior art, the beneficial effects of this utility model are: This invention uses zero-crossing detection to determine the AC power on / off state in real time, triggering data saving in advance. It utilizes the cyclic characteristics of AC power to improve detection reliability and avoid false alarms. Achieving millisecond-level response ensures that critical data is completely stored in non-volatile memory; it implements a low-cost, high-reliability power-off data saving function, suitable for home appliances, industrial control, and other fields. Attached Figure Description

[0017] Figure 1 This is the circuit diagram of this utility model. Detailed Implementation

[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention.

[0019] Please see Figure 1 This utility model provides a zero-crossing detection circuit for a microcontroller to achieve power-down retention function, including an optocoupler U3 and an MCU. The input terminal 1 of the optocoupler U3 is connected to the AC_N terminal. The input terminal 2 of the optocoupler U3 is connected to one end of resistor R29. The other end of resistor R29 is connected to one end of resistor R33. The other end of resistor R33 is connected to AC_L3. The output terminal 3 of the optocoupler U3 is connected to one end of capacitor C9. The output terminal 4 of the optocoupler U3 is connected to one end of resistor R11 and one end of resistor R21. The other end of resistor R11 is connected to the MCU power supply terminal VDD5. The other ends of resistor R21 and capacitor C9 are both connected to the Zero terminal.

[0020] The MCU monitors the signal pulse interval at the Zero terminal: if N pulses are missing consecutively (N≥2), it is determined that the AC power is off; an interrupt is triggered and the RAM data is immediately saved to EEPROM / Flash.

[0021] Resistor R11 has a resistance of 21 kΩ, an accuracy of ±1%, and a package size of 0.04 inches long and 0.02 inches wide.

[0022] Resistor R21 has a resistance of 100 ohms, an accuracy of ±1%, and a package size of 0.04 inches in length and 0.02 inches in width.

[0023] Resistor R29 has a resistance of 220 kΩ, an accuracy of ±1%, and a package size of 0.12 inches long and 0.06 inches wide.

[0024] Resistor R33 has a resistance of 220 kΩ, an accuracy of ±1%, and a package size of 0.12 inches long and 0.06 inches wide.

[0025] Capacitor C9 has a capacitance of 0.01μF, an accuracy of ±10%, and package dimensions of 0.12 inches in length and 0.06 inches in width; its rated operating voltage is 50V.

[0026] The model number of optocoupler U3 is UTDM354A(T1)-GV / SOP4.

[0027] Working principle: The input terminals of optocoupler U3 are connected to AC power supplies AC_L and AC_N, and the output terminal is pulled up to the MCU power supply through resistor R11. When the AC power crosses zero, the optocoupler is cut off, and the output is high; during normal conduction, it outputs a low-level pulse sequence. The MCU monitors the zero-crossing signal pulse interval: if N consecutive pulses are missing (N≥2), it is determined that the AC power is off. An interrupt is triggered, and the RAM data is immediately saved to EEPROM / Flash. After the power failure determination, the system switches to backup capacitor power supply, completes data saving, and then shuts down.

[0028] In this zero-crossing detection circuit, resistors R11, R21, R29, and R33 form a voltage divider network. Through precise resistance values, the input voltage is divided, converting the high voltage into a voltage signal suitable for subsequent circuit processing. The high-precision (±1%) resistors ensure the accuracy of the voltage division, thus improving detection accuracy. Capacitor C9 primarily functions as a filter and energy storage unit. Utilizing a capacitance of 0.01μF and a rated operating voltage of 50V, it stabilizes the voltage signal in the circuit, removes high-frequency interference, and provides a stable operating environment for the circuit. Optocoupler U3 (UTDM354A (T1)-GV / SOP4), as a key isolation component, converts the input electrical signal into an optical signal through photoelectric conversion, and then converts the optical signal back into an electrical signal for output. This achieves electrical isolation between the input and output circuits, preventing interference from high-voltage power to the low-voltage control circuit. Simultaneously, it accurately transmits the zero-crossing signal to the microcontroller, enabling the microcontroller to detect the voltage zero-crossing point in a timely manner and achieve power-off data retention.

[0029] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A zero-crossing detection circuit for implementing power-down data retention function using a microcontroller, comprising an optocoupler U3 and an MCU, characterized in that, The input terminal 1 of the optocoupler U3 is connected to the AC_N terminal. The input terminal 2 of the optocoupler U3 is connected to one end of resistor R29. The other end of resistor R29 is connected to one end of resistor R33. The other end of resistor R33 is connected to AC_L3. The output terminal 3 of the optocoupler U3 is connected to one end of capacitor C9. The output terminal 4 of the optocoupler U3 is connected to one end of resistor R11 and one end of resistor R21. The other end of resistor R11 is connected to the MCU power supply terminal VDD5. The other ends of resistor R21 and capacitor C9 are both connected to the Zero terminal.

2. The zero-crossing detection circuit for implementing power-down retention function of a microcontroller according to claim 1, characterized in that: The MCU monitors the signal pulse interval at the Zero terminal: if N pulses are missing consecutively, it is determined that the AC power is off; an interrupt is triggered and the RAM data is immediately saved to EEPROM / Flash.

3. The zero-crossing detection circuit for implementing power-down retention function in a microcontroller according to claim 1, characterized in that: The resistor R11 has a resistance of 21 kΩ, an accuracy of ±1%, and a package size of 0.04 inches in length and 0.02 inches in width.

4. The zero-crossing detection circuit for implementing power-down retention function of a microcontroller according to claim 1, characterized in that: The resistor R21 has a resistance of 100 ohms, an accuracy of ±1%, and a package size of 0.04 inches in length and 0.02 inches in width.

5. A zero-crossing detection circuit for implementing power-down retention function in a microcontroller according to claim 1, characterized in that: The resistor R29 has a resistance of 220 kΩ, an accuracy of ±1%, and a package size of 0.12 inches in length and 0.06 inches in width.

6. A zero-crossing detection circuit for implementing power-down retention function in a microcontroller according to claim 1, characterized in that: The resistor R33 has a resistance of 220 kΩ, an accuracy of ±1%, and a package size of 0.12 inches in length and 0.06 inches in width.

7. A zero-crossing detection circuit for implementing power-down retention function in a microcontroller according to claim 1, characterized in that: The capacitor C9 has a capacitance of 0.01μF, an accuracy of ±10%, and package dimensions of 0.12 inches in length and 0.06 inches in width; its rated operating voltage is 50V.

8. A zero-crossing detection circuit for implementing power-down retention function in a microcontroller according to claim 1, characterized in that: The optocoupler U3 is model UTDM354A(T1)-GV / SOP4.