An isolated single-chip AC zero-crossing signal detection circuit
By designing an AC zero-crossing signal detection circuit of an isolated microcontroller and using a rectifier bridge and an optocoupler for signal processing, the problem of poor anti-interference performance and stability of traditional detection circuits is solved, high impedance input and delay output are realized, and speed is ensured. Slow device signal reading capability.
Patent Information
- Application Number
- CN202011388450.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-02
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2040-12-02
AI Technical Summary
The traditional AC power zero-crossing signal detection circuit has problems with poor anti-interference performance and stability, and lacks delay function, which makes it difficult for devices with slow reading speed to successfully read signals.
An isolated microcontroller AC electric zero-crossing signal detection circuit is designed, using main control circuit, sub-control circuit one, sub-control circuit two, sub-control circuit three and sub-control circuit four, and signals are carried out through rectifier bridges, optocouplers and microcontrollers. Processing, realizes high impedance input, low power consumption and optocoupling isolation of thermoelectric parts, and provides delayed output function.
It realizes synchronous real-time acquisition of 50-265V sinusoidal AC voltage zero-crossing signals, improving the stability and anti-interference performance of the system, ensuring that slow equipment can successfully read the signal and consume less than 1mA.
Smart Images

Figure CN112415260B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of single-chip computers, and in particular to an isolated single-chip computer alternating current zero-crossing signal detection circuit. Background Art
[0002] With the rapid development of science and technology, chip technology is also booming. A single-chip microcomputer is an integrated circuit chip that uses ultra-large-scale integrated circuit technology to integrate a central processing unit CPU with data processing capabilities, random access memory RAM, read-only memory ROM, multiple I / O ports and interrupt systems, timers / counters and other functions on a silicon chip to form a small and complete microcomputer system. It is widely used in the field of industrial control. When the traditional single-chip microcomputer AC zero-crossing signal detection circuit is actually used, its output signal has problems with anti-interference performance and poor stability. In addition, since its detection circuit does not have a delay function, some devices with slower reading speeds have difficulty in reading signals. Summary of the invention
[0003] The object of the present invention is to provide an isolated single-chip microcomputer alternating current zero-crossing signal detection circuit in view of the defects and shortcomings of the prior art.
[0004] The invention discloses an isolated single-chip microcomputer AC zero-crossing signal detection circuit, which comprises a main control circuit, a sub-control circuit 1, a sub-control circuit 2, a sub-control circuit 3 and a sub-control circuit 4;
[0005] The main control circuit includes a U1 unit, wherein the first pin of the U1 unit is grounded, and the second to fourth pins of the U1 unit are connected to the TCK terminal, the TDIO terminal, and the AC terminal, respectively; one end of a capacitor C5 is grounded, and the other end of the capacitor C5 is connected in parallel with the fourth pin of the U1 unit; the fifth pin of the U1 unit is connected to the OUT terminal, and the eighth pin of the U1 unit is connected to the VCC+5V terminal; a capacitor C4 is connected in parallel between the first and eighth pins of the U1 unit;
[0006] The sub-control circuit 1 includes a rectifier bridge DB2, wherein the first foot of the rectifier bridge DB2 is connected in series with a resistor R1, the other end of the resistor R1 is connected to the third foot of the wiring port P1, the first foot of the wiring port P1 is connected in series with the second foot of the rectifier bridge DB2, and a varistor RU1 is connected in series between the resistor R1 and the second foot of the rectifier bridge DB2; the third and fourth feet of the rectifier bridge DB2 are connected in series with the anode and cathode of the photocoupler OC2 respectively; the emitter of the photocoupler OC2 is connected to the AC terminal, and the collector of the photocoupler OC2 is grounded; the resistor R3 and the capacitor C1 are connected in parallel between the third and fourth feet of the rectifier bridge DB2; one end of the resistor R4 is connected in parallel with the collector of the photocoupler OC2, and the other end of the resistor R4 is connected to the VCC+5C terminal; the emitter of the photocoupler OC2 is grounded;
[0007] The second sub-control circuit includes a rectifier bridge DB1, the first foot of which is connected to the AC15VL terminal; the second foot of which is connected to the ACVN terminal; the fourth foot of which is grounded; the third foot of which is connected to the Vin terminal of the voltage regulator VR1 through a wire 1, the GND terminal of the voltage regulator VR1 is grounded, and the Vout terminal of the voltage regulator VR1 is connected to the VCC+5V terminal; after the resistor R5 is connected in series with the light-emitting diode LED, one end is connected in parallel with the Vout terminal of the voltage regulator VR1, and the other end is connected in parallel with the wire 2; one end of the radio capacitor CE1, the capacitor C2, the radio capacitor CE2, and the capacitor C3 are respectively connected in parallel with the wire 1, and one end of the radio capacitor CE1, the capacitor C2, the radio capacitor CE2, and the capacitor C3 are connected in parallel with the wire 2;
[0008] The sub-control circuit three includes a photocoupler OC1, the anode of the photocoupler OC1 is connected in series with a resistor R8, and the other end of the resistor R8 is connected to the VCC+5V terminal; the cathode of the photocoupler OC1 is connected to the collector of the transistor Q1, the emitter of the transistor Q1 is grounded, the base of the transistor Q1 is connected in series with a resistor R6, and the other end of the resistor R6 is connected to the OUT terminal; after the resistor R7 is connected in series with the light-emitting diode LED2, it is connected in parallel between the resistor R8 and the cathode terminal of the photocoupler OC1; the collector and emitter of the photocoupler OC1 are respectively connected to the 1st and 2nd ports of the wiring port P2; the 3rd and 4th ports of the wiring port P2 are respectively connected to the AC15VN terminal and the AC15VL terminal;
[0009] The sub-control circuit 4 includes a connection port P3, the first pin of the connection port P3 is connected to the VCC+5V terminal, the second pin of the connection port P3 is connected to the TDIO terminal, the third pin of the connection port P3 is grounded, and the fourth pin of the connection port P3 is connected to the TCK terminal.
[0010] Furthermore, the U1 unit of the main control circuit is a Saiyuan microcontroller of model SC92F7250.
[0011] Furthermore, the rectifier bridge DB2 in the sub-control circuit 1 is a bridge rectifier of model MB6S2.
[0012] Furthermore, the photoelectric coupler OC1 and the photoelectric coupler OC2 are photoelectric couplers of model PC817.
[0013] Furthermore, the rectifier bridge DB1 of the second sub-control circuit is a rectifier bridge stack of model 2W10.
[0014] Furthermore, the voltage regulator VR1 in the second sub-control circuit is a voltage regulator of model 78M05.
[0015] Furthermore, the connection port P3 of the sub-control circuit 4 is an ICSP interface.
[0016] The invention has the following beneficial effects: the isolated single-chip microcomputer AC zero-crossing signal detection circuit of the invention synchronously and real-time collects 50-265V sinusoidal AC voltage zero-crossing signals, has high impedance input, consumes less than 1mA, has no inductor device at the input end, and has optocoupler isolation of the thermoelectric part, thereby improving the stability and anti-interference performance of the system. The zero-crossing signal is processed by single-chip microcomputer shaping, digital filtering, etc., and has a delayed output function for different output devices, thereby ensuring that slow devices can successfully read the signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present application, but do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 is a topological schematic diagram of the present invention;
[0019] Figure 2 It is a schematic diagram of the main control circuit structure of the present invention;
[0020] Figure 3 It is a structural schematic diagram of a sub-control circuit of the present invention;
[0021] Figure 4 It is a structural schematic diagram of the second sub-control circuit of the present invention;
[0022] Figure 5 It is a schematic diagram of the structure of the sub-control circuit of the present invention;
[0023] Figure 6 2 is a schematic diagram of the structure of the sub-control circuit of the present invention. DETAILED DESCRIPTION
[0024] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments, wherein the illustrative embodiments and descriptions are only used to explain the present invention but are not intended to limit the present invention.
[0025] like Figure 1 As shown, an isolated single-chip microcomputer AC zero-crossing signal detection circuit described in this specific implementation manner includes a main control circuit, a sub-control circuit 1, a sub-control circuit 2, a sub-control circuit 3 and a sub-control circuit 4;
[0026] like Figure 2As shown, the main control circuit includes a U1 unit, the first pin of the U1 unit is grounded, and the second to fourth pins of the U1 unit are connected to the TCK terminal, the TDIO terminal, and the AC terminal respectively; one end of the capacitor C5 is grounded, and the other end of the capacitor C5 is connected in parallel with the fourth pin of the U1 unit; the fifth pin of the U1 unit is connected to the OUT terminal, and the eighth pin of the U1 unit is connected to the VCC+5V terminal; the capacitor C4 is connected in parallel between the first and eighth pins of the U1 unit;
[0027] like Figure 3 As shown, the sub-control circuit 1 includes a rectifier bridge DB2, the first foot of the rectifier bridge DB2 is connected in series with a resistor R1, the other end of the resistor R1 is connected to the third foot of the wiring port P1, the first foot of the wiring port P1 is connected in series with the second foot of the rectifier bridge DB2, and the varistor RU1 is connected in series between the resistor R1 and the second foot of the rectifier bridge DB2; the third and fourth feet of the rectifier bridge DB2 are respectively connected in series with the anode and cathode of the photocoupler OC2; the emitter of the photocoupler OC2 is connected to the AC terminal, and the collector of the photocoupler OC2 is grounded; the resistor R3 and the capacitor C1 are connected in parallel between the third and fourth feet of the rectifier bridge DB2; one end of the resistor R4 is connected in parallel with the collector of the photocoupler OC2, and the other end of the resistor R4 is connected to the VCC+5C terminal; the emitter of the photocoupler OC2 is grounded;
[0028] like Figure 4 As shown, the sub-control circuit 2 includes a rectifier bridge DB1, the first foot of the rectifier bridge DB1 is connected to the AC15VL terminal; the second foot of the rectifier bridge DB1 is connected to the ACVN terminal; the fourth foot of the rectifier bridge DB1 is grounded; the third foot of the rectifier bridge DB1 is connected to the Vin terminal of the voltage regulator VR1 through a wire 1, the GND terminal of the voltage regulator VR1 is grounded, and the Vout terminal of the voltage regulator VR1 is connected to the VCC+5V terminal; after the resistor R5 is connected in series with the light-emitting diode LED, one end is connected in parallel with the Vout terminal of the voltage regulator VR1, and the other end is connected in parallel with the wire 2; one end of the radio capacitor CE1, the capacitor C2, the radio capacitor CE2, and the capacitor C3 are respectively connected in parallel with the wire 1, and one end of the radio capacitor CE1, the capacitor C2, the radio capacitor CE2, and the capacitor C3 are connected in parallel with the wire 2;
[0029] like Figure 5As shown, the sub-control circuit three includes a photocoupler OC1, the anode of the photocoupler OC1 is connected in series with a resistor R8, and the other end of the resistor R8 is connected to the VCC+5V terminal; the cathode of the photocoupler OC1 is connected to the collector of the transistor Q1, the emitter of the transistor Q1 is grounded, the base of the transistor Q1 is connected in series with a resistor R6, and the other end of the resistor R6 is connected to the OUT terminal; after the resistor R7 is connected in series with the light-emitting diode LED2, it is connected in parallel between the resistor R8 and the cathode terminal of the photocoupler OC1; the collector and emitter of the photocoupler OC1 are respectively connected to the 1st and 2nd ports of the wiring port P2; the 3rd and 4th ports of the wiring port P2 are respectively connected to the AC15VN terminal and the AC15VL terminal;
[0030] like Figure 6 As shown, the sub-control circuit four includes a connection port P3, the first pin of the connection port P3 is connected to the VCC+5V terminal, the second pin of the connection port P3 is connected to the TDIO terminal, the third pin of the connection port P3 is grounded, and the fourth pin of the connection port P3 is connected to the TCK terminal.
[0031] Furthermore, the U1 unit of the main control circuit is a Saiyuan microcontroller of model SC92F7250.
[0032] Furthermore, the rectifier bridge DB2 in the sub-control circuit 1 is a bridge rectifier of model MB6S2. In this design, the bridge rectifier is the most commonly used circuit that uses the unidirectional conductivity of a diode for rectification, and is often used to convert alternating current into direct current. MB6S2 is the model of the rectifier bridge, package SOP-4.
[0033] Furthermore, the photocoupler OC1 and the photocoupler OC2 are photocouplers of model PC817. PC817 photocouplers are widely used in computer terminals, thyristor system equipment, measuring instruments, photocopiers, automatic ticket vending machines, household appliances, such as fans, heaters, etc., for signal transmission between circuits, so that the front end is completely isolated from the load, with the purpose of increasing safety, reducing circuit interference, and simplifying circuit design. PC817 is a commonly used linear photocoupler, which is often used as a coupling device in various functional circuits that require relatively precision. It has the function of completely isolating the upper and lower circuits without affecting each other.
[0034] Ordinary photocouplers can only transmit digital signals (switching signals) and are not suitable for transmitting analog signals. Linear photocouplers are a new type of photoelectric isolation device that can transmit continuously changing analog voltage or current signals. As the strength of the input signal changes, a corresponding light signal will be generated, which will cause the conduction degree of the phototransistor to be different, and the output voltage or current will also be different.
[0035] Furthermore, the rectifier bridge DB1 of the second sub-control circuit is a rectifier bridge stack of model 2W10.
[0036] Its working principle is: the rectifier bridge is mainly composed of four diodes to realize the conversion of input AC voltage into output DC voltage. In each working cycle of the rectifier bridge, only two diodes work at the same time, and the unidirectional conduction function of the diodes converts the AC into a unidirectional DC pulsating voltage.
[0037] If we dissect the commonly used low-power rectifier bridge (such as RS2501M of RECTRON SEMICONDUCTOR), we will find that its internal structure is as follows: Figure 2 As shown in the figure, the full-wave rectifier bridge adopts a plastic packaging structure (most of the low-power rectifier bridges adopt this packaging form). The four main heat-generating components in the bridge - diodes are divided into two groups and placed on the DC output pin copper plates. There are two connecting copper plates between the DC output pin copper plates, which are connected to the input pins (AC input wires) respectively, forming a full-wave rectifier bridge with four external connection pins that we see in appearance.
[0038] Since this series of rectifier bridges all use plastic packaging structures, the above-mentioned diodes, pin copper plates, connecting copper plates and connecting wires are filled with epoxy resin as an insulating and heat-conducting skeleton filling material. However, the thermal conductivity of epoxy resin is relatively low (generally 0.35℃W / m, up to 2.5℃W / m), so the junction-to-case thermal resistance of the rectifier bridge is generally relatively large (usually 1.0~10℃ / W). Usually, in the relevant parameter table of components, manufacturers will provide the junction-to-ambient thermal resistance (Rja) of the device under natural cooling and the junction-to-case thermal resistance (Rjc) when the component comes with a heat sink and the device is cooled through the heat sink.
[0039] Furthermore, the voltage regulator VR1 in the second sub-control circuit is a voltage regulator of model 78M05. 78M05 is a three-port current positive fixed voltage regulator with a protection function of shutting down in case of overcurrent and overheating, with a maximum output current of 500mA, an input bias current of 3.2mA, and a maximum input voltage of 35V.
[0040] Furthermore, the connection port P3 of the sub-control circuit 4 is an ICSP interface, and the ICSP interface is a 6-pin interface that uses the SPI protocol for communication.
[0041] The working principle of the present invention is as follows:
[0042] In this design, the AC sinusoidal voltage is connected through the P1 port, and the parallel RU1 varistor and the series R1 winding resistor play a protective role to prevent surge breakdown and burnout of the circuit.
[0043] In this design, the AC power is rectified by DB2 bridge, and the signal becomes 100HZ pulsating DC power. It is limited by R2, R3, and C1, and then divided and filtered. Then it goes to the positive pole of the primary side of the optocoupler PC817, and the zero-crossing signal is transmitted to the secondary side through the optocoupler. The secondary side of the optocoupler reads the voltage value through the AD port of the single-chip microcomputer. The size of the voltage value can accurately measure the zero-crossing signal of the AC power and the electrical parameters of the AC power.
[0044] In this design, the P2 port is a 4P terminal. The AC15V AC voltage is rectified, filtered, and stabilized to provide the system with a 5V accurate DC voltage for the microcontroller to work. After the measured AC zero-crossing signal is calculated by the microcontroller, the OX port outputs a pulse signal, which is also transmitted to the next-level device through the optoelectronic device. The lower-level industrial control device PLC collects the signal through interrupts or fast ports.
[0045] The functions of the present invention are as follows: This design synchronously and in real time collects 50-265V sinusoidal AC voltage zero-crossing signals, has high impedance input, power consumption is less than 1mA, there is no inductor at the input end, and the thermoelectric part is optically isolated, which improves the stability and anti-interference performance of the system. The zero-crossing signal is processed by single-chip microcomputer shaping, digital filtering, etc., and has a delayed output function for different output devices to ensure that slow devices can successfully read the signal. The signal output is a TTL level driven photoelectric device (NPN type), and the PLC and other devices can read the signal in real time and do related processing.
[0046] The functional board of this design uses 12-15V AC or DC to power the entire system, and has rectification, filtering, and voltage stabilization circuits on board to ensure a wide range of power input.
[0047] The above description is only a preferred embodiment of the present invention, so all equivalent changes or modifications made according to the features and principles described in the scope of the patent application of the present invention are included in the scope of the patent application of the present invention.
Claims
1. An isolated single-chip microcomputer AC zero-crossing signal detection circuit, characterized in that: It includes a main control circuit, a sub-control circuit 1, a sub-control circuit 2, a sub-control circuit 3 and a sub-control circuit 4; The main control circuit includes a U1 unit, wherein the first pin of the U1 unit is grounded, and the second to fourth pins of the U1 unit are connected to the TCK terminal, the TDIO terminal, and the AC terminal, respectively; one end of a capacitor C5 is grounded, and the other end of the capacitor C5 is connected in parallel with the fourth pin of the U1 unit; the fifth pin of the U1 unit is connected to the OUT terminal, and the eighth pin of the U1 unit is connected to the VCC+5V terminal; a capacitor C4 is connected in parallel between the first and eighth pins of the U1 unit; The sub-control circuit 1 includes a rectifier bridge DB2, wherein the first foot of the rectifier bridge DB2 is connected in series with a resistor R1, the other end of the resistor R1 is connected to the third foot of the wiring port P1, the first foot of the wiring port P1 is connected in series with the second foot of the rectifier bridge DB2, and a varistor RU1 is connected in series between the resistor R1 and the second foot of the rectifier bridge DB2; the third and fourth feet of the rectifier bridge DB2 are connected in series with the anode and cathode of the photocoupler OC2 respectively; the emitter of the photocoupler OC2 is connected to the AC terminal, and the collector of the photocoupler OC2 is grounded; the resistor R3 and the capacitor C1 are connected in parallel between the third and fourth feet of the rectifier bridge DB2; one end of the resistor R4 is connected in parallel with the collector of the photocoupler OC2, and the other end of the resistor R4 is connected to the VCC+5C terminal; the emitter of the photocoupler OC2 is grounded; The second sub-control circuit includes a rectifier bridge DB1, the first foot of which is connected to the AC15VL terminal; the second foot of which is connected to the ACVN terminal; the fourth foot of which is grounded; the third foot of which is connected to the Vin terminal of the voltage regulator VR1 through a wire 1, the GND terminal of the voltage regulator VR1 is grounded, and the Vout terminal of the voltage regulator VR1 is connected to the VCC+5V terminal; after the resistor R5 is connected in series with the light-emitting diode LED, one end is connected in parallel with the Vout terminal of the voltage regulator VR1, and the other end is connected in parallel with the wire 2; one end of the radio capacitor CE1, the capacitor C2, the radio capacitor CE2, and the capacitor C3 are respectively connected in parallel with the wire 1, and one end of the radio capacitor CE1, the capacitor C2, the radio capacitor CE2, and the capacitor C3 are connected in parallel with the wire 2; The sub-control circuit three includes a photocoupler OC1, the anode of the photocoupler OC1 is connected in series with a resistor R8, and the other end of the resistor R8 is connected to the VCC+5V terminal; the cathode of the photocoupler OC1 is connected to the collector of the transistor Q1, the emitter of the transistor Q1 is grounded, the base of the transistor Q1 is connected in series with a resistor R6, and the other end of the resistor R6 is connected to the OUT terminal; after the resistor R7 is connected in series with the light-emitting diode LED2, it is connected in parallel between the resistor R8 and the cathode terminal of the photocoupler OC1; the collector and emitter of the photocoupler OC1 are respectively connected to the 1st and 2nd ports of the wiring port P2; the 3rd and 4th ports of the wiring port P2 are respectively connected to the AC15VN terminal and the AC15VL terminal; The sub-control circuit 4 includes a connection port P3, the first pin of the connection port P3 is connected to the VCC+5V terminal, the second pin of the connection port P3 is connected to the TDIO terminal, the third pin of the connection port P3 is grounded, and the fourth pin of the connection port P3 is connected to the TCK terminal.
2. The isolated single-chip microcomputer AC zero-crossing signal detection circuit according to claim 1, characterized in that: The U1 unit of the main control circuit is a Saiyuan microcontroller of model SC92F7250.
3. The isolated single-chip microcomputer AC zero-crossing signal detection circuit according to claim 1, characterized in that: The rectifier bridge DB2 in the sub-control circuit 1 is a bridge rectifier of model MB6S2.
4. The isolated single-chip microcomputer AC zero-crossing signal detection circuit according to claim 1, characterized in that: The photoelectric coupler OC1 and the photoelectric coupler OC2 are photoelectric couplers of model PC817.
5. The isolated single-chip microcomputer AC zero-crossing signal detection circuit according to claim 1, characterized in that: The rectifier bridge DB1 of the second sub-control circuit is a rectifier bridge stack of model 2W10.
6. The isolated single-chip microcomputer AC zero-crossing signal detection circuit according to claim 1, characterized in that: The voltage regulator VR1 in the second sub-control circuit is a voltage regulator of model 78M05.
7. The isolated single-chip microcomputer AC zero-crossing signal detection circuit according to claim 1, characterized in that: The connection port P3 of the sub-control circuit 4 is an ICSP interface.
Citation Information
Patent Citations
Alternating current zero-crossing signal detection circuit of isolated single-chip microcomputer
CN214201589U