Alternating current detection circuit, LED driving power supply and lighting device

By introducing signal rectification, conversion, and reference generation modules into the AC detection circuit, an adaptive reference voltage is generated for comparison, which solves the problem of high microcontroller resource consumption in the prior art, realizes synchronous detection of AC voltage amplitude and frequency over a wide voltage range, reduces system cost, and improves detection stability.

CN121721348APending Publication Date: 2026-03-24GUANGDONG SOSEN POWER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In digital addressable lighting interface dimming power supply systems, existing technologies struggle to effectively reduce system costs, minimize microcontroller resource consumption, and achieve synchronous detection of AC voltage amplitude and frequency over a wide input voltage range while ensuring detection accuracy and reliability.

Method used

An AC detection circuit is employed, comprising a signal rectification module, a signal conversion module, a reference generation module, and a signal comparison module. By converting the AC input voltage into a full-wave rectified signal and generating an adaptive reference voltage for comparison, the circuit outputs frequency and amplitude signals, thereby reducing the resource consumption of the microcontroller.

Benefits of technology

It enables synchronous detection of AC voltage amplitude and frequency over a wide voltage range with low cost and low resource consumption, reducing system cost and improving detection stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121721348A_ABST
    Figure CN121721348A_ABST
Patent Text Reader

Abstract

The invention discloses an alternating current detection circuit, an LED driving power supply and a lighting device, and relates to the technical field of LED power supply control, the circuit is connected between an alternating current power supply and a microcontroller, and the circuit comprises a signal rectification module used for converting an alternating current input voltage into a full-wave rectification signal; the signal conversion module is used for processing the full-wave rectification signal and outputting a pulse filtering signal and a direct-current voltage signal of which the amplitude tracks the peak value of the full-wave rectification signal; the reference generation module is used for generating a reference voltage signal in a preset proportion with the peak value of the full-wave rectification signal according to the direct-current voltage signal; and the signal comparison module is used for comparing the pulse filtering signal with a reference voltage signal and outputting a pulse signal of which the frequency is the same as that of the full-wave rectification signal to the microcontroller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of LED power supply control technology, and in particular to an AC detection circuit, an LED driver power supply, and a lighting device. Background Technology

[0002] Currently, in Digital Addressable Lighting Interface (DALI) dimming power supply systems, as a high-efficiency and reliable lighting dimming device, it achieves precise control of lamps by linking with other DALI devices, and needs to report power supply operating parameters, including AC input voltage magnitude and frequency, to the main control device. The existing detection method generally adopts the method of directly inputting the pulsating waveform after rectification and voltage division of AC input to the same ADC channel of microcontroller (MCU), and the MCU analyzes the voltage amplitude and frequency simultaneously through high-frequency sampling and combined with software integration, peak finding, zero-crossing point judgment and other algorithms.

[0003] When the AC input range is wide, although the shape and frequency of the rectified pulsating waveform itself do not change with the input voltage, and only the overall amplitude changes proportionally with the input voltage, the amplitude and frequency information are superimposed on the same pulsating waveform. Therefore, the MCU can only rely on fixed thresholds, feature points, or specific level ranges to determine the frequency. When the input voltage amplitude increases or decreases, the absolute level range of the ADC sampled value changes synchronously, causing a shift in the waveform feature position corresponding to the original criteria. This necessitates the MCU to continuously adjust the criteria or improve the sampling accuracy to maintain the stability of frequency detection; otherwise, frequency drift or even failure is highly likely.

[0004] Furthermore, this software-based approach requires the MCU to simultaneously decouple voltage amplitude and frequency on a single ADC channel in real time, necessitating the maintenance of a high sampling rate and computation frequency. The computational burden increases further with changes in input voltage, thus significantly increasing system cost and MCU computing resource consumption in wide voltage input range applications.

[0005] Therefore, how to effectively reduce system costs and MCU resource consumption while ensuring detection accuracy and reliability, and achieve synchronous detection of AC voltage amplitude and frequency over a wide input voltage range, is an urgent problem to be solved. Summary of the Invention

[0006] The main objective of this application is to provide an AC detection circuit that aims to solve the technical problem of effectively reducing system cost, minimizing MCU resource consumption, and achieving synchronous detection of AC voltage amplitude and frequency over a wide input voltage range, while ensuring detection accuracy and reliability.

[0007] To achieve the above objectives, this application proposes an AC detection circuit, which is connected between an AC power supply and a microcontroller. The circuit includes: a signal rectification module, a signal conversion module, a reference generation module, and a signal comparison module. The input terminal of the signal rectification module is connected to the output terminal of the AC power supply, and is used to convert the AC input voltage into a full-wave rectified signal. The input terminal of the signal conversion module is connected to the output terminal of the signal rectification module, which is used to process the full-wave rectified signal and output a pulsating filter signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal. The input terminal of the reference generation module is connected to the output terminal of the signal conversion module, and is used to generate a reference voltage signal that is proportional to the peak value of the full-wave rectified signal according to the DC voltage signal. The first input terminal of the signal comparison module is connected to the output terminal of the signal conversion module, and the second input terminal of the signal comparison module is connected to the output terminal of the reference generation module. The module is used to compare the pulsating filtered signal with the reference voltage signal and output a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller.

[0008] In one embodiment, the signal conversion module is further configured to transmit the DC voltage signal to the microcontroller, so that the microcontroller determines the amplitude of the AC input voltage based on the DC voltage signal.

[0009] In one embodiment, the circuit further includes: a voltage divider module; The voltage divider module is connected to both the signal rectification module and the signal conversion module. The voltage divider module is used to divide the full-wave rectified signal and transmit the resulting pulsating waveform signal to the signal conversion module. The signal conversion module is used to filter the pulsating waveform signal to obtain the pulsating filtered signal, and transmit the pulsating filtered signal to the signal comparison module; The signal conversion module is also used to perform peak detection on the pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the pulsating waveform signal to the signal comparison module and the microcontroller.

[0010] In one embodiment, the voltage divider module includes: a first resistor, a second resistor, and a first capacitor; The first end of the first resistor is connected to the signal rectification module, the second end of the first resistor is connected to the first end of the second resistor and the first end of the first capacitor, the second end of the second resistor is connected to the signal rectification module and the second end of the first capacitor, and the second end of the first capacitor and the second end of the first capacitor are both connected to the signal conversion module.

[0011] In one embodiment, the signal rectification module includes: a rectifier bridge and a second capacitor; The input terminal of the rectifier bridge is connected to the output terminal of the AC power supply. The first output terminal of the rectifier bridge is connected to the first terminal of the second capacitor and the signal conversion module, respectively. The second terminal of the rectifier bridge is connected to the second terminal of the second capacitor and the signal conversion module, respectively.

[0012] In one embodiment, the signal conversion module includes: a waveform conversion unit and a DC-DC conversion unit; The voltage divider module is connected to the waveform conversion unit and the DC-DC conversion unit respectively. The DC-DC conversion unit is also connected to the reference generation module and the microcontroller respectively. The waveform conversion unit is also connected to the signal comparison module. The waveform conversion unit is used to filter the pulsating waveform signal to obtain the pulsating filtered signal, and transmit the pulsating filtered signal to the signal comparison module; The DC-DC conversion unit is also used to perform peak detection on the pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the pulsating waveform signal to the signal comparison module and the microcontroller.

[0013] In one embodiment, the waveform conversion unit includes: a third resistor, a fourth resistor, and a third capacitor; The first end of the third resistor is connected to the first end of the first capacitor, the second end of the third resistor is connected to the first end of the fourth resistor, the first end of the third capacitor and the signal comparison module, and the second end of the fourth resistor is connected to the second end of the first capacitor and the second end of the third capacitor.

[0014] In one embodiment, the DC-DC conversion unit includes: a first diode and a fourth capacitor; The positive terminal of the first diode is connected to the second terminal of the first capacitor and the first terminal of the third resistor, respectively. The negative terminal of the first diode is connected to the microcontroller, the reference generation module and the first terminal of the fourth capacitor, respectively. The second terminal of the fourth capacitor is grounded.

[0015] In addition, to achieve the above objectives, this application also proposes an LED driver power supply, which includes the AC detection circuit as described above.

[0016] In addition, to achieve the above objectives, this application also proposes a lighting device, which includes an LED driver power supply and an AC detection circuit as described above.

[0017] This application proposes an AC detection circuit connected between an AC power supply and a microcontroller. The circuit includes: a signal rectification module, a signal conversion module, a reference generation module, and a signal comparison module. The input terminal of the signal rectification module is connected to the output terminal of the AC power supply, used to convert the AC input voltage into a full-wave rectified signal. The input terminal of the signal conversion module is connected to the output terminal of the signal rectification module, used to process the full-wave rectified signal and output a pulsating filtered signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal. The input terminal of the reference generation module is connected to the output terminal of the signal conversion module, used to generate a reference voltage signal with a preset ratio to the peak value of the full-wave rectified signal based on the DC voltage signal. The first input terminal of the signal comparison module is connected to the output terminal of the signal conversion module, and the second input terminal of the signal comparison module is connected to the output terminal of the reference generation module, used to compare the pulsating filtered signal with the reference voltage signal and output a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller.

[0018] Because this application incorporates AC detection circuits directly in the AC power supply and microcontroller, the input of the signal rectification module is connected to the output of the AC power supply to convert the AC input voltage into a full-wave rectified signal. The input of the signal conversion module is connected to the output of the signal rectification module to process the full-wave rectified signal and output a pulsating filtered signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal. The input of the reference generation module is connected to the output of the signal conversion module to generate a reference voltage signal with a preset ratio to the peak value of the full-wave rectified signal based on the DC voltage signal. The first input of the signal comparison module is connected to the output of the signal conversion module, and the second input of the signal comparison module is connected to the output of the reference generation module. This module compares the pulsating filtered signal with the reference voltage signal and outputs a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller. Compared with existing technologies, this application achieves low-cost, low-resource-consumption synchronous detection of AC amplitude and frequency over a wide voltage range by generating an adaptive reference through peak detection and multiplexing it with a voltage divider network for frequency detection. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the structure of the first embodiment of the AC detection circuit proposed in this application; Figure 2 This is a schematic diagram of the structure of the second embodiment of the AC detection circuit proposed in this application. Figure 3 This is a circuit diagram of the third embodiment of the AC detection circuit proposed in this application.

[0022] Explanation of icon numbers:

[0023] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0024] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0026] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly.

[0027] Furthermore, the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.

[0028] It should be noted that currently, in Digital Addressable Lighting Interface (DALI) dimming power supply systems, as a high-efficiency and reliable lighting dimming device, it achieves precise control of the lamps by linking with other DALI devices, and needs to report power supply operating parameters, including AC input voltage magnitude and frequency, to the main control device. The existing detection method generally adopts the method of directly inputting the pulsating waveform after rectification and voltage division of AC input to the same ADC channel of the microcontroller (MCU), and the MCU analyzes the voltage amplitude and frequency simultaneously through high-frequency sampling and combined with software integration, peak finding, zero-crossing point judgment and other algorithms.

[0029] When the AC input range is wide, although the shape and frequency of the rectified pulsating waveform itself do not change with the input voltage, and only the overall amplitude changes proportionally with the input voltage, the amplitude and frequency information are superimposed on the same pulsating waveform. Therefore, the MCU can only rely on fixed thresholds, feature points, or specific level ranges to determine the frequency. When the input voltage amplitude increases or decreases, the absolute level range of the ADC sampled value changes synchronously, causing a shift in the waveform feature position corresponding to the original criteria. This necessitates the MCU to continuously adjust the criteria or improve the sampling accuracy to maintain the stability of frequency detection; otherwise, frequency drift or even failure is highly likely.

[0030] Furthermore, this software-based approach requires the MCU to simultaneously decouple voltage amplitude and frequency on a single ADC channel in real time, necessitating the maintenance of a high sampling rate and computation frequency. The computational burden increases further with changes in input voltage, thus significantly increasing system cost and MCU resource consumption in wide voltage input range applications.

[0031] Therefore, how to effectively reduce system costs and MCU resource consumption while ensuring detection accuracy and reliability, and achieve synchronous detection of AC voltage amplitude and frequency over a wide input voltage range, is an urgent problem to be solved.

[0032] To address the aforementioned technical problems, this embodiment proposes an AC detection circuit. This application directly incorporates an AC detection circuit in the AC power supply 5 and the microcontroller 6. The input terminal of the signal rectification module 1 is connected to the output terminal of the AC power supply 5, used to convert the AC input voltage into a full-wave rectified signal. The input terminal of the signal conversion module 2 is connected to the output terminal of the signal rectification module 1, used to process the full-wave rectified signal and output a pulsating filtered signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal. The input terminal of the reference generation module 3 is connected to the output terminal of the signal conversion module 2, used to generate a reference voltage signal with a preset ratio to the peak value of the full-wave rectified signal based on the DC voltage signal. The first input terminal of the signal comparison module 4 is connected to the output terminal of the signal conversion module 2, and the second input terminal of the signal comparison module 4 is connected to the output terminal of the reference generation module 3, used to compare the pulsating filtered signal with the reference voltage signal and output a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller 6. Compared with existing technologies, this embodiment generates an adaptive reference by peak detection and reuses it with a voltage divider network for frequency detection, thereby achieving low-cost and low-resource-consumption synchronous detection of AC amplitude and frequency over a wide voltage range.

[0033] For ease of understanding, the following is combined with Figures 1 to 3 The AC detection circuit provided in the embodiments of this application will be described in detail.

[0034] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the first embodiment of the AC detection circuit proposed in this application.

[0035] like Figure 1 As shown, in this embodiment, the AC detection circuit is connected between the AC power supply 5 and the microcontroller 6. The circuit includes: a signal rectification module 1, a signal conversion module 2, a reference generation module 3, and a signal comparison module 4. The input terminal of the signal rectification module 1 is connected to the output terminal of the AC power supply 5, and is used to convert the AC input voltage into a full-wave rectified signal. The input terminal of the signal conversion module 2 is connected to the output terminal of the signal rectification module 1, and is used to process the full-wave rectified signal and output a pulsating filter signal and a DC voltage signal that can characterize the peak voltage of the full-wave rectified signal through peak capture and hold.

[0036] The input terminal of the reference generation module 3 is connected to the output terminal of the signal conversion module 2, and is used to generate an adaptive reference voltage that changes synchronously with the peak value of the AC input voltage and is proportional to the peak value of the full-wave rectified signal according to the DC voltage signal. The first input terminal of the signal comparison module 4 is connected to the output terminal of the signal conversion module 2, and the second input terminal of the signal comparison module 4 is connected to the output terminal of the reference generation module 3. It is used to compare the pulsating filtered signal with the reference voltage signal and output a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller 6. Specifically, the signal comparison module 4 generates a pulse signal whose transition position coincides with the period of the full-wave rectified signal through a comparison operation, and simultaneously decouples frequency detection from the input voltage amplitude using a reference voltage that adaptively adjusts with the input peak value.

[0037] It should be noted that the aforementioned signal rectification module 1 can be a module composed of a rectifier bridge BD (such as a DB107, MB6S, or other bridge rectifiers) and its related filter capacitors. It is understood that the function of the aforementioned signal rectification module 1 is to convert the sinusoidal signal of the AC input voltage from the AC power supply 5 into the aforementioned full-wave rectified signal. The aforementioned signal conversion module 2 can be a module with voltage division filtering and peak detection functions for the rectified signal.

[0038] It should also be noted that the aforementioned reference generation module 3 can be a module that generates a corresponding reference voltage signal based on the aforementioned DC voltage signal. The aforementioned signal comparison module 4 can be a module that has a signal comparison function.

[0039] Understandably, the aforementioned full-wave rectified signal can be a pulsating waveform with a frequency of 100Hz / 120Hz formed by the AC power output from the aforementioned AC detection circuit after passing through the aforementioned signal rectification module 1. Its voltage value is always positive, but its amplitude changes periodically. The aforementioned pulsating filtered signal can be a signal that retains the original frequency characteristics but filters out high-frequency noise. The aforementioned DC voltage signal can be a stable DC voltage signal formed after peak holding, whose voltage value is equivalent to the peak value of the aforementioned AC input voltage. The aforementioned reference voltage signal can be a reference voltage with a fixed proportional relationship generated by the aforementioned reference generation module 3 from the aforementioned DC voltage signal. The aforementioned pulse signal can be a square wave signal generated by the aforementioned comparison module after comparing the aforementioned pulsating filtered signal with the aforementioned reference voltage signal, whose frequency has a definite conversion relationship with the AC input frequency (50Hz power frequency corresponds to a 100Hz pulse).

[0040] In its implementation, the AC input voltage from the AC power supply 5 is first sent to the signal rectification module 1. The signal rectification module 1 converts the alternating positive and negative sinusoidal voltage into a single-polarity full-wave rectified signal, which contains all voltage and frequency information of the AC input. The signal conversion module 2 receives the full-wave rectified signal from the signal rectification module 1 and performs two parallel processing steps: firstly, it uses an internal filtering unit to waveform-condition the full-wave rectified signal, outputting a smooth, pulsating filtered signal; secondly, it uses a peak detection unit to track the full-wave rectified signal in real time, outputting a DC voltage signal that corresponds to the peak voltage of the full-wave rectified signal. The reference generation module 3 receives the DC voltage signal output from the signal conversion module 2 and precisely divides it using an internal proportional setting unit to generate a reference voltage signal that maintains a fixed proportional relationship with the peak value of the full-wave rectified signal. This reference voltage can automatically adjust with changes in the input voltage, forming an adaptive characteristic. The signal comparison module 4 simultaneously receives the pulsed filtered signal from the signal conversion module 2 and the reference voltage signal from the reference generation module 3. By comparing the instantaneous voltage values ​​of these two signals in real time, it converts the continuous analog waveform into a corresponding digital pulse signal. When the voltage of the pulsed filtered signal is higher than the reference voltage, it outputs a high level; otherwise, it outputs a low level, thereby generating a pulse signal with a frequency completely consistent with the full-wave rectified signal and outputting it to the microcontroller 6. The microcontroller 6 calculates the amplitude of the AC input voltage by detecting the amplitude of the DC voltage signal and determines the frequency of the AC input voltage by measuring the frequency of the pulse signal, thus completing the entire detection process.

[0041] Furthermore, in order to obtain the amplitude of the aforementioned AC input voltage, continue as follows: Figure 1 As shown, in this embodiment, the signal conversion module 2 is further used to transmit the DC voltage signal to the microcontroller 6, so that the microcontroller 6 can determine the amplitude of the AC input voltage based on the DC voltage signal. Since the DC voltage signal is used to characterize the peak voltage of the full-wave rectified signal, the microcontroller 6 only needs to use the peak voltage and known parameters such as the voltage division ratio to reconstruct the effective value or peak value of the AC input voltage through simple calculations. This eliminates the need for high-speed sampling, waveform peak finding, or complex calculations, thus significantly reducing the computational power required by the MCU.

[0042] It should be noted that the microcontroller 6 mentioned above can be an embedded control chip (such as the STM32 series, GD32 series, or ESP32 series) that includes an ADC analog-to-digital converter and a digital processing unit, used for digital processing of analog signals. The amplitude of the AC input voltage mentioned above can be the peak or effective value of the AC power supply 5 voltage, which is obtained in the detection system by proportional conversion from the quantized value of the DC voltage signal.

[0043] In its implementation, the signal conversion module 2 continuously captures the instantaneous peak value of the full-wave rectified signal and maintains this peak voltage through an energy storage element, forming a stable DC voltage signal output. This eliminates the need for high-frequency sampling by the MCU and software peak finding, allowing direct output of the DC level corresponding to the input voltage peak value, providing a reliable basis for subsequent reference voltage generation and voltage amplitude detection. The DC voltage signal is directly connected to the ADC input pin of the microcontroller 6 via an analog transmission line. Taking a 220V / 50Hz AC input as an example, when the peak value of the rectified signal is 311V, a 2.5V DC voltage signal is obtained after voltage division and peak detection. The microcontroller 6 performs analog-to-digital conversion on the DC voltage signal with a fixed sampling period (e.g., 1ms), multiplying the obtained digital value by a preset voltage conversion factor (e.g., a conversion factor of 124.4, corresponding to the voltage division ratio and peak factor), thus directly calculating the actual amplitude of the AC input voltage. The implementation method of this embodiment avoids the complex integral calculations described in the background art, so that the MCU only needs to perform ADC acquisition and multiplication operation once to obtain the voltage amplitude, which significantly reduces the CPU resource consumption.

[0044] This embodiment proposes an AC detection circuit. The AC detection circuit is directly integrated into the AC power supply 5 and the microcontroller 6. The input terminal of the signal rectification module 1 is connected to the output terminal of the AC power supply 5, used to convert the AC input voltage into a full-wave rectified signal. The input terminal of the signal conversion module 2 is connected to the output terminal of the signal rectification module 1, used to process the full-wave rectified signal and output a pulsating filtered signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal. The input terminal of the reference generation module 3 is connected to the output terminal of the signal conversion module 2, used to generate a reference voltage signal with a preset ratio to the peak value of the full-wave rectified signal based on the DC voltage signal. The first input terminal of the signal comparison module 4 is connected to the output terminal of the signal conversion module 2, and the second input terminal of the signal comparison module 4 is connected to the output terminal of the reference generation module 3, used to compare the pulsating filtered signal with the reference voltage signal and output a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller 6. Compared with the prior art, this embodiment achieves low-cost, low-resource-consumption synchronous detection of AC amplitude and frequency over a wide voltage range by generating an adaptive reference through peak detection and multiplexing it with a voltage divider network for frequency detection.

[0045] Reference Figure 2 , Figure 2 This is a schematic diagram of the structure of the second embodiment of the AC detection circuit proposed in this application.

[0046] Based on the above embodiments, a second embodiment of this application is proposed. To perform voltage division on the above full-wave rectified signal, as follows... Figure 2 As shown, in this embodiment, the circuit further includes a voltage divider module; The voltage divider module is connected to the signal rectification module 1 and the signal conversion module 2 respectively; The voltage divider module is used to divide the full-wave rectified signal and transmit the resulting pulsating waveform signal to the signal conversion module 2. The signal conversion module 2 is used to filter the pulsating waveform signal to obtain the pulsating filtered signal, and transmit the pulsating filtered signal to the signal comparison module 4; The signal conversion module 2 is also used to perform peak detection on the pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the pulsating waveform signal to the signal comparison module 4 and the microcontroller 6.

[0047] It should be noted that the aforementioned voltage divider module can be a voltage conversion module composed of a precision resistor network, whose function is to attenuate the high-voltage signal to a level suitable for subsequent circuit processing at a fixed ratio. The aforementioned pulsating waveform signal can be a full-wave rectified pulsating waveform signal whose amplitude is reduced but whose original waveform characteristics are maintained after the aforementioned full-wave rectified signal has been processed by voltage divider.

[0048] Understandably, the aforementioned peak detection can be a technical means of capturing and maintaining the peak voltage of the input signal through a specific circuit.

[0049] In its implementation, the voltage divider module first converts the high-voltage full-wave rectified signal (e.g., a 220V AC input with a peak value of 311V) output from the signal conversion module 2 into a safe low-voltage pulsating waveform signal (peak value 3.11V) using a precision resistor voltage divider network at a predetermined ratio (e.g., 1:100). This pulsating waveform signal is simultaneously fed into two independent processing channels of the signal conversion module 2. In the filtering channel, a low-pass RC filter removes high-frequency noise, outputting a smooth pulsating filtered signal which is then sent to the signal comparison module 4 for frequency detection. In the peak detection channel, a diode-capacitor peak hold circuit is used. The rapid charging of the diode and the slow discharging of the capacitor maintain the peak voltage of the input signal at the output, forming a stable DC voltage signal.

[0050] Reference Figure 3 , Figure 3This is a circuit diagram of the third embodiment of the AC detection circuit proposed in this application.

[0051] Based on the above embodiments, a third embodiment of this application is proposed. To perform voltage division on the above full-wave rectified signal, as follows... Figure 3 As shown, in this embodiment, the voltage divider module includes: a first resistor R1, a second resistor R2, and a first capacitor C1; The first end of the first resistor R1 is connected to the signal rectification module 1. The second end of the first resistor R1 is connected to the first end of the second resistor R2 and the first end of the first capacitor C1. The second end of the second resistor R2 is connected to the signal rectification module 1 and the second end of the first capacitor C1. The second end of the first capacitor C1 and the second end of the first capacitor C1 are both connected to the signal conversion module 2.

[0052] It is understandable that the first resistor R1 and the second resistor R2 constitute the main voltage divider network (usually using metal film resistors with an accuracy of ±1%), and the first capacitor C1 can be a high-frequency noise filtering capacitor (usually a ceramic capacitor of 100pF-1nF).

[0053] In a specific implementation, the first resistor R1 (e.g., 120kΩ) and the second resistor R2 (e.g., 10kΩ) are connected in series to form a voltage divider, which attenuates the high-voltage full-wave rectified signal (e.g., a 220V AC input with a peak value of 311V) output by the signal rectifier module 1 into a low-voltage signal (peak value of approximately 25.9V) according to the resistor ratio (120:10=12:1). The first capacitor C1 (e.g., 1nF) is connected in parallel across the second resistor R2, and together with the voltage divider resistor, they form a low-pass filter network. The cutoff frequency is calculated using the formula f=1 / (2πRC). When the second resistor R2 is 10kΩ and the capacitor is 1nF, the cutoff frequency is approximately 15.9kHz, which can effectively filter out high-frequency switching noise while retaining the characteristics of the 50Hz / 100Hz power frequency signal. After this processing, the pulsating waveform signal is transmitted to the signal conversion module 2 through the connection point between the two ends of the first capacitor C1. This ensures that the signal amplitude is within the safe detection range and eliminates high-frequency interference, providing the necessary conditions for subsequent accurate detection.

[0054] Furthermore, in order to convert the AC input voltage into a full-wave rectified signal, the process continues as follows: Figure 3 As shown, in this embodiment, the signal rectification module 1 includes: a rectifier bridge BD and a second capacitor C2; The input terminal of the rectifier bridge BD is connected to the output terminal of the AC power supply 5. The first output terminal of the rectifier bridge BD is connected to the first terminal of the second capacitor C2 and the signal conversion module 2, respectively. The second terminal of the rectifier bridge BD is connected to the second terminal of the second capacitor C2 and the signal conversion module 2, respectively.

[0055] It should be noted that the aforementioned rectifier bridge BD can be a standard component consisting of four diodes forming a full-bridge rectifier structure (such as DB107, MB6S, and other packaged rectifier bridge BDs). The input terminal of the aforementioned rectifier bridge BD receives two phase lines of the aforementioned AC power supply 5, and the output terminal generates the aforementioned full-wave rectified signal. The aforementioned second capacitor C2 can be a high-voltage filter capacitor (typically a 0.1-1μF / 400V film capacitor or ceramic capacitor) connected in parallel at the output terminal of the aforementioned rectifier bridge BD, used to absorb high-frequency interference and suppress voltage spikes.

[0056] In its implementation, when the AC power supply 5 (e.g., 220V / 50Hz) is connected to the input terminal of the rectifier bridge BD, the diode array inside the rectifier bridge BD performs full-wave rectification of the AC power, converting the bidirectional AC signal into a unidirectional pulsating DC signal, which is output from the first output terminal (positive) and the second output terminal (negative). The second capacitor C2 is connected in parallel to the output terminal of the rectifier bridge BD. Utilizing the impedance frequency characteristics of the capacitor, a low-impedance path is formed for the high-frequency noise components after rectification (such as noise above 100kHz generated by the switching power supply), while maintaining the complete waveform of the power frequency signal (i.e., the full-wave rectified signal). For example, when 220V AC power is input, the rectifier bridge BD outputs a 100Hz pulsating DC with a peak value of 311V. The parallel 0.47μF / 400V capacitor can filter out radio frequency interference in the MHz band without affecting the detection accuracy of the 100Hz main signal.

[0057] Furthermore, in order to process the aforementioned full-wave rectified signal and output a pulsating filtered signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal, the process continues as follows: Figure 3 As shown, in this embodiment, the signal conversion module 2 includes: a waveform conversion unit 21 and a DC-DC conversion unit 22; The voltage divider module is connected to the waveform conversion unit 21 and the DC conversion unit 22 respectively. The DC conversion unit 22 is also connected to the reference generation module 3 and the microcontroller 6 respectively. The waveform conversion unit 21 is also connected to the signal comparison module 4. The waveform conversion unit 21 is used to filter the pulsating waveform signal to obtain the pulsating filtered signal, and transmit the pulsating filtered signal to the signal comparison module 4; The DC-DC conversion unit 22 is also used to perform peak detection on the pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the pulsating waveform signal to the signal comparison module 4 and the microcontroller 6.

[0058] It should be noted that the waveform conversion unit 21 described above can be a unit that retains the original waveform frequency characteristics of the pulsating waveform signal while suppressing high-frequency noise. The DC-DC conversion unit 22 described above can be a unit that has unidirectional conduction and charge storage characteristics to convert AC pulsating signals into stable DC signals.

[0059] It is understood that the aforementioned pulsating waveform signal can refer to the low-voltage full-wave rectified pulsating waveform signal processed by the voltage divider module. The aforementioned pulsating filtered signal can be an AC signal with a smooth waveform and reduced noise after being filtered by the aforementioned waveform conversion unit 21. The aforementioned DC voltage signal can be a stable DC level output by the DC conversion unit 22 that maintains an equal amplitude relationship with the peak value of the input signal.

[0060] In its implementation, the waveform conversion unit 21 employs an RC filter network (such as a 1kΩ resistor and a 1nF capacitor in series) to perform low-pass filtering on the pulsating waveform signal from the voltage divider module. Its cutoff frequency is set much higher than the 100Hz power frequency signal, effectively filtering out high-frequency noise above the kHz level. The clean output pulsating filtered signal is directly sent to the non-inverting input of the signal comparison module 4. The DC-DC conversion unit 22 uses a diode-capacitor peak detection circuit (such as a 1N4148 switching diode and a 0.22μF energy storage capacitor). When the voltage of the pulsating waveform signal rises, the diode conducts forward to rapidly charge the capacitor; when the voltage drops, the diode is cut off, and the capacitor slowly discharges through a high-impedance load, thus maintaining the peak voltage of the input signal at the output and forming a stable DC voltage signal. This dual-channel design allows a single input signal to simultaneously meet the requirements of frequency detection and amplitude detection, fundamentally solving the resource waste problem caused by the traditional scheme requiring two independent detection circuits, as described in the background art, and achieving high-precision detection of AC parameters over a wide voltage range.

[0061] Furthermore, in order to filter the above-mentioned pulsating waveform signal to obtain the above-mentioned pulsating filtered signal, the following steps are continued... Figure 3 As shown, in this embodiment, the waveform conversion unit 21 includes: a third resistor R3, a fourth resistor R4, and a third capacitor C3; The first end of the third resistor R3 is connected to the first end of the first capacitor C1. The second end of the third resistor R3 is connected to the first end of the fourth resistor R4, the first end of the third capacitor C3, and the signal comparison module 4. The second end of the fourth resistor R4 is connected to the second end of the first capacitor C1 and the second end of the third capacitor C3.

[0062] It should be noted that the third resistor R3 (e.g., 1kΩ) and the fourth resistor R4 (e.g., 10kΩ) form a secondary voltage divider network, and the third capacitor C3 (e.g., 1nF) is a high-frequency noise filtering capacitor.

[0063] In the specific implementation, the third resistor R3 and the fourth resistor R4 are connected in series to form a secondary voltage divider network, further attenuating the pulsating waveform signal from the voltage divider module to a level suitable for processing by the signal comparison module 4. Simultaneously, the third capacitor C3 is connected in parallel across the fourth resistor R4 to form a low-pass filter. For example, when the peak value of the input pulsating waveform signal is 3.11V, the output signal peak value drops to approximately 0.28V after passing through the voltage divider network with a voltage division ratio of 1:11 formed by the third resistor R3 (1kΩ) and the fourth resistor R4 (10kΩ). The parallel 1nF capacitor and 10kΩ resistor constitute a low-pass filter with a cutoff frequency of approximately 15.9kHz, effectively filtering out switching noise in the MHz band while fully preserving the characteristics of the 100Hz / 120Hz power frequency signal. After this optimized processing, the pulsating filtered signal retains the original frequency information and eliminates high-frequency interference, solving the frequency detection misjudgment problem caused by noise interference in traditional detection circuits described in the background art, and providing a clean waveform signal for the subsequent comparator U.

[0064] Furthermore, in order to perform peak detection on the aforementioned pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the aforementioned pulsating waveform signal to the aforementioned signal comparison module 4 and the aforementioned microcontroller 6, the process continues as follows: Figure 3 As shown, in this embodiment, the DC-DC conversion unit 22 includes: a first diode D1 and a fourth capacitor C4; The positive terminal of the first diode D1 is connected to the second terminal of the first capacitor C1 and the first terminal of the third resistor R3, respectively. The negative terminal of the first diode D1 is connected to the microcontroller 6, the reference generation module 3 and the first terminal of the fourth capacitor C4, respectively. The second terminal of the fourth capacitor C4 is grounded.

[0065] It should be noted that the first diode D1 mentioned above can be a fast recovery diode with excellent switching characteristics (such as 1N4148), with its positive terminal being the anode and its negative terminal being the cathode, forming a unidirectional conductive device. The fourth capacitor C4 mentioned above can be an energy storage capacitor with low leakage current (such as a 0.22μF ceramic capacitor) used to store and maintain charge.

[0066] In the specific implementation, when the voltage of the aforementioned pulsating waveform signal is in the rising phase, the first diode D1 is forward-biased, rapidly charging the fourth capacitor C4 to the signal peak. When the voltage of the aforementioned pulsating waveform signal is in the falling phase, the first diode D1 is reverse-biased and cut off, and the fourth capacitor C4 slowly discharges through the subsequent high-impedance load (the megohm-level resistor of the reference generation module 3 and the ADC input impedance of the microcontroller 6), thereby maintaining the DC voltage corresponding to the peak value of the input signal across the fourth capacitor C4. Taking a 220V AC input as an example, the peak value of the pulsating waveform signal after voltage division is 3.11V. When the first diode D1 is on, the voltage drop is approximately 0.7V, and the fourth capacitor C4 will be charged to approximately 2.41V and maintained at this voltage. The aforementioned DC voltage signal is simultaneously sent to the ADC pin of the microcontroller 6 and the reference generation module 3. This achieves the desired function of directly converting the full-wave rectified pulsating waveform signal into the aforementioned DC level, allowing the MCU to obtain the voltage amplitude without performing complex integration calculations, significantly reducing processor resource consumption.

[0067] Furthermore, in order to compare the aforementioned pulsating filtered signal with the aforementioned reference voltage signal and output a pulse signal with the same frequency as the aforementioned full-wave rectified signal to the aforementioned microcontroller 6, the following process continues... Figure 3 As shown, in this embodiment, the signal comparison module 4 includes: a comparator U, a second diode D2, a fifth resistor R5, a fifth capacitor C5, and a sixth capacitor C6; The inverting input of comparator U is connected to the reference generation module 3. The non-inverting input of comparator U is connected to the signal conversion module 2 and the positive terminal of the second diode D2. The ground terminal of comparator U is grounded. The power supply terminal of comparator U is connected to the negative terminal of the second diode D2, the first terminal of the fifth capacitor C5, and the power supply. The output terminal of comparator U is connected to the first terminal of the fifth resistor R5. The second terminal of the fifth capacitor C5 is connected to the second terminal of the sixth capacitor C6. The second terminal of the fifth resistor R5 is connected to the first terminal of the sixth capacitor C6 and the microcontroller 6.

[0068] It should be noted that the comparator U mentioned above can be a low-power voltage comparator chip (such as LM393) used to compare the voltages of two input signals. The second diode D2 mentioned above can be a switching diode (such as 1N4148) used for power supply polarity protection. The fifth resistor R5 mentioned above can be a pull-up resistor at the output (typically 4.7kΩ). The fifth capacitor C5 mentioned above can be a power supply decoupling capacitor (typically 0.1μF). The sixth capacitor C6 mentioned above can be an output filter capacitor (typically 100pF).

[0069] In its implementation, the inverting input of comparator U receives an adaptive reference voltage (e.g., 0.22V) from reference generation module 3, while the non-inverting input receives a pulsating filter signal (a full-wave rectified pulsating waveform signal with a peak value of 0.28V) from signal conversion module 2. The second diode D2 is connected in parallel between the non-inverting input of comparator U and the power supply to form a clamping protection circuit, preventing overvoltage damage. When the pulsating filter signal voltage exceeds the reference voltage, comparator U outputs a high level; otherwise, it outputs a low level, thus converting the analog full-wave rectified pulsating waveform signal into the aforementioned pulse signal. The fifth resistor R5 acts as a pull-up resistor to ensure the integrity of the output level, the fifth capacitor C5 filters out power supply noise, and the sixth capacitor C6, together with the fifth resistor R5, forms an RC filter network to shape the output pulse. For example, when a 220V / 50Hz AC power is input, the comparator U will output a 100Hz PWM signal with a stable duty cycle of around 66%, unaffected by input voltage fluctuations. The stable duty cycle of the output pulse signal ensures that the comparator switching time does not drift with changes in the input voltage amplitude, thereby achieving complete decoupling between frequency detection and voltage changes, improving frequency detection accuracy, and significantly reducing the computational complexity of the MCU.

[0070] Furthermore, in order to generate the aforementioned reference voltage signal, continue as follows: Figure 3 As shown, in this embodiment, the reference generation module 3 includes a sixth resistor and a seventh resistor; The first end of the sixth resistor is connected to the signal conversion module 2, the second end of the sixth resistor is connected to the first end of the seventh resistor and the signal comparison module 4, and the second end of the seventh resistor is grounded.

[0071] It should be noted that the sixth resistor mentioned above (e.g., 1MΩ) can be a pull-up resistor, and the seventh resistor mentioned above (e.g., 100kΩ) can be a pull-down resistor. The two are connected in series to form a precise voltage divider network.

[0072] In the specific implementation, the sixth resistor and the seventh resistor are connected in series to form a voltage divider, which performs a fixed-ratio voltage division on the DC voltage signal (VDC) output by the signal conversion module 2. The voltage division ratio is determined by the resistance ratio of the two resistors, and the calculation formula is Vref=VDC×[R7 / (R6+R7)]. For example, when the input DC voltage signal is 2.41V (corresponding to 220V AC input), using the 1MΩ sixth resistor and the 100kΩ seventh resistor, the voltage division ratio is approximately 1 / 11, and the output reference voltage is approximately 0.22V. The reference voltage automatically adjusts with the change of AC input voltage, forming an adaptive characteristic, effectively solving the problem that the traditional fixed reference voltage scheme cannot simultaneously meet the high and low voltage detection requirements within a wide input voltage range, and ensuring the stability of the duty cycle of the comparator U output pulse signal.

[0073] To achieve the above objectives, this application also proposes an LED driver power supply, which includes the AC detection circuit described above.

[0074] It should be noted that the specific implementation of the LED driver power supply provided in this embodiment can refer to the above embodiments, and this embodiment will not elaborate on it further. Therefore, the effects achieved by the LED driver power supply in this embodiment can also refer to the above embodiments, and this embodiment will not elaborate on them further.

[0075] To achieve the above objectives, this application also proposes a lighting device, which includes an LED driver power supply and an AC detection circuit as described above.

[0076] It should be noted that the specific implementation of the lighting device provided in this embodiment can refer to the above embodiments, and this embodiment will not elaborate on it further. Therefore, the effects achieved by the lighting device in this embodiment can also refer to the above embodiments, and this embodiment will not elaborate on them further.

[0077] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. An AC detection circuit, characterized in that, The AC detection circuit is connected between the AC power supply and the microcontroller, and the circuit includes: a signal rectification module, a signal conversion module, a reference generation module, and a signal comparison module; The input terminal of the signal rectification module is connected to the output terminal of the AC power supply, and is used to convert the AC input voltage into a full-wave rectified signal. The input terminal of the signal conversion module is connected to the output terminal of the signal rectification module, which is used to process the full-wave rectified signal and output a pulsating filter signal and a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal. The input terminal of the reference generation module is connected to the output terminal of the signal conversion module, and is used to generate a reference voltage signal that is proportional to the peak value of the full-wave rectified signal according to the DC voltage signal. The first input terminal of the signal comparison module is connected to the output terminal of the signal conversion module, and the second input terminal of the signal comparison module is connected to the output terminal of the reference generation module. The module is used to compare the pulsating filtered signal with the reference voltage signal and output a pulse signal with the same frequency as the full-wave rectified signal to the microcontroller.

2. The circuit as described in claim 1, characterized in that, The signal conversion module is also used to transmit the DC voltage signal to the microcontroller so that the microcontroller can determine the amplitude of the AC input voltage based on the DC voltage signal.

3. The circuit as described in claim 1, characterized in that, The circuit also includes: a voltage divider module; The voltage divider module is connected to both the signal rectification module and the signal conversion module. The voltage divider module is used to divide the full-wave rectified signal and transmit the resulting pulsating waveform signal to the signal conversion module. The signal conversion module is used to filter the pulsating waveform signal to obtain the pulsating filtered signal, and transmit the pulsating filtered signal to the signal comparison module; The signal conversion module is also used to perform peak detection on the pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the full-wave rectified signal to the signal comparison module and the microcontroller.

4. The circuit as described in claim 3, characterized in that, The voltage divider module includes: a first resistor, a second resistor, and a first capacitor; The first end of the first resistor is connected to the signal rectification module, the second end of the first resistor is connected to the first end of the second resistor and the first end of the first capacitor, the second end of the second resistor is connected to the signal rectification module and the second end of the first capacitor, and the second end of the first capacitor and the second end of the first capacitor are both connected to the signal conversion module.

5. The circuit as described in claim 1, characterized in that, The signal rectification module includes: a rectifier bridge and a second capacitor; The input terminal of the rectifier bridge is connected to the output terminal of the AC power supply. The first output terminal of the rectifier bridge is connected to the first terminal of the second capacitor and the signal conversion module, respectively. The second terminal of the rectifier bridge is connected to the second terminal of the second capacitor and the signal conversion module, respectively.

6. The circuit as described in claim 3, characterized in that, The signal conversion module includes: a waveform conversion unit and a DC-DC conversion unit; The voltage divider module is connected to the waveform conversion unit and the DC-DC conversion unit respectively. The DC-DC conversion unit is also connected to the reference generation module and the microcontroller respectively. The waveform conversion unit is also connected to the signal comparison module. The waveform conversion unit is used to filter the pulsating waveform signal to obtain the pulsating filtered signal, and transmit the pulsating filtered signal to the signal comparison module; The DC-DC conversion unit is also used to perform peak detection on the pulsating waveform signal and output a DC voltage signal whose amplitude tracks the peak value of the pulsating waveform signal to the signal comparison module and the microcontroller.

7. The circuit as described in claim 6, characterized in that, The waveform conversion unit includes: a third resistor, a fourth resistor, and a third capacitor; The first end of the third resistor is connected to the first end of the first capacitor, the second end of the third resistor is connected to the first end of the fourth resistor, the first end of the third capacitor and the signal comparison module, and the second end of the fourth resistor is connected to the second end of the first capacitor and the second end of the third capacitor.

8. The circuit as described in claim 6, characterized in that, The DC-DC conversion unit includes: a first diode and a fourth capacitor; The positive terminal of the first diode is connected to the second terminal of the first capacitor and the first terminal of the third resistor, respectively. The negative terminal of the first diode is connected to the microcontroller, the reference generation module and the first terminal of the fourth capacitor, respectively. The second terminal of the fourth capacitor is grounded.

9. An LED driver power supply, characterized in that, The LED driver power supply includes the AC detection circuit according to any one of claims 1 to 8.

10. A lighting device, characterized in that, The lighting device includes the LED driver power supply and the AC detection circuit according to any one of claims 1 to 8.