Control circuit of relay
Through the relay control circuit integrating controller, relay drive circuit, detection circuit and watchdog logic circuit, the problem of relay detection and control is solved, efficient and accurate relay control is achieved, and the stability and safety of the system are improved to prevent power theft.
Patent Information
- Application Number
- CN202422710241.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2034-11-06
AI Technical Summary
In the prior art, the detection and real-time control of relays are difficult to ensure their normal working state, and potential faults cannot be handled in time in abnormal situations, which may lead to circuit failures or safety accidents.
A relay control circuit is designed, including a controller, relay drive circuit, relay detection circuit and logic circuit with a watchdog. By integrating these components, the relay can be efficient, precise and reliable control, ensuring its normal operation and quickly resume normal operation in abnormal situations.
It improves the stability and safety of the system, reduces the risk of misoperation, enhances the system's adaptability in abnormal situations, ensures the consistency between actual power consumption and metering, and prevents power theft.
Smart Images

Figure CN223273180U_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electric power technology, and in particular to a control circuit of a relay. Background Art
[0002] A relay is an electrical control device primarily used to control high-current, high-power circuits while operating at low current and power. Its operating principle is based on electromagnetic induction: when power is applied to the relay's coil, the generated magnetic field attracts the armature, causing the contacts to close or open, thereby controlling the connection or disconnection of an external circuit. Relays typically consist of a coil, armature, contacts, and springs, and are widely used in automation control, power systems, communications equipment, and other fields.
[0003] Detection and real-time control of relays are crucial. First, detection ensures the proper functioning of the relays, allowing for the timely detection and resolution of potential faults, thereby preventing circuit failures or safety incidents caused by relay malfunction. Second, if the controller malfunctions, such as a damaged microprocessor, a damaged or missing clock crystal circuit, or a power failure, disconnection, or short circuit, the logic circuit's watchdog detects the controller anomaly and outputs a corresponding logic signal to the relay driver circuit, thereby controlling the relay's closing or opening. Utility Model Content
[0004] In view of this, an embodiment of the present application provides a control circuit for a relay.
[0005] In a first aspect, an embodiment of the present application provides a control circuit for a relay, comprising a controller, a relay drive circuit, a relay detection circuit, and a logic circuit with a watchdog;
[0006] The output end of the relay driving circuit is connected to the control end of the relay; the input end of the relay driving circuit is connected to the output end of the logic circuit; the input end of the logic circuit is connected to the signal output end of the controller;
[0007] The first detection end of the relay detection circuit is connected to the front end of the relay, and the second detection end of the relay detection circuit is connected to the rear end of the relay; the output end of the relay detection circuit is connected to the input end of the controller.
[0008] In a possible implementation, the relay drive circuit includes a relay drive chip, a first capacitor, and a second capacitor;
[0009] The first pin of the relay driver chip is connected to the second control pin of the relay; the second pin of the relay driver circuit is grounded; the third pin of the relay driver circuit is connected to the first output end of the logic circuit; the fourth pin of the relay driver chip is connected to the first control pin of the relay; the fifth pin of the relay driver chip is connected to one end of the first capacitor and a DC power supply, the sixth pin of the relay driver chip is connected to one end of the second capacitor, and the sixth pin of the relay driver chip is also connected to the second output end of the logic circuit;
[0010] The other end of the first capacitor and the other end of the second capacitor are both grounded.
[0011] In one possible implementation, the relay detection circuit includes a first diode and an optocoupler;
[0012] The first pin of the optocoupler is connected to the input end of the relay through a current-limiting resistor, the second pin of the optocoupler is connected to the output end of the relay through a current-limiting resistor, the third pin of the optocoupler is grounded, and the fourth pin of the optocoupler is connected to a DC power supply and the input end of the controller;
[0013] The anode of the first diode is connected to the second pin of the optocoupler; and the cathode of the first diode is connected to the first pin of the optocoupler.
[0014] In a possible implementation, the logic circuit includes a watchdog logic chip and a fifth capacitor;
[0015] The first pin of the watchdog logic chip is connected to one end of the fifth capacitor and the DC power supply; the third pin of the watchdog logic chip is connected to the first signal output end of the controller; the fifth pin of the watchdog logic chip is grounded; the sixth pin of the watchdog logic chip is connected to the first input end of the relay drive circuit; the seventh pin of the watchdog logic chip is connected to the second input end of the relay drive circuit; and the eighth pin of the watchdog logic chip is connected to the second signal output end of the controller.
[0016] In a possible implementation, the relay drive circuit further includes a third capacitor, a first resistor, a second resistor, a third resistor, and a fourth resistor;
[0017] The third pin of the relay drive circuit is connected to one end of the third capacitor and one end of the first resistor, the third pin of the relay drive circuit is connected to one end of the fourth resistor, the other end of the fourth resistor and the other end of the third capacitor are both grounded; the other end of the first resistor is connected to the first output end of the logic circuit;
[0018] The sixth pin of the relay drive circuit is connected to one end of the second resistor and one end of the fourth resistor; the other end of the second resistor is connected to the second output end of the logic circuit, and the other end of the fourth resistor is grounded.
[0019] In a possible implementation, the relay detection circuit further includes a fourth capacitor, one end of the fourth capacitor is connected to the fourth pin of the optocoupler, and the other end of the fourth capacitor is grounded.
[0020] In a possible implementation, the relay detection circuit further includes a fifth resistor, a sixth resistor, a seventh resistor, and an eighth resistor;
[0021] One end of the eighth resistor is connected to the first pin of the optocoupler and the cathode of the first diode, the other end of the eighth resistor is connected to one end of the seventh resistor, and the other end of the seventh resistor is connected to the input end of the relay;
[0022] One end of the sixth resistor is connected to the second pin of the optocoupler and the anode of the first diode, the other end of the sixth resistor is connected to one end of the fifth resistor, and the other end of the fifth resistor is connected to the output end of the relay.
[0023] In a possible implementation, the relay detection circuit further includes a ninth resistor;
[0024] The fourth pin of the optocoupler is connected to a DC power supply through the ninth resistor.
[0025] In a possible implementation, the logic circuit further includes a tenth resistor and an eleventh resistor;
[0026] The third pin of the watchdog logic chip is connected to the first signal output end of the controller through the eleventh resistor; the eighth pin of the watchdog logic chip is connected to the second signal output end of the controller through the tenth resistor.
[0027] In a possible implementation, the circuit further includes a power supply circuit, and the power supply circuit includes a second diode and an electrolytic capacitor;
[0028] The anode of the second diode is connected to a DC power supply, the cathode of the second diode is connected to the positive electrode of the electrolytic capacitor and the power supply end of the logic circuit, and the negative electrode of the electrolytic capacitor is grounded.
[0029] An embodiment of the present application provides a control circuit for a relay. The controller first processes the detection signal input by the relay detection circuit to determine whether it is necessary to control the switching of the relay. When the controller sends a first control signal, the logic circuit receives the first control signal and performs logic processing, sends a second control signal to the relay drive circuit, and converts the second control signal into a current signal for driving the relay through the relay drive circuit, thereby controlling the switching of the external load. In addition, the relay detection circuit continuously monitors the working status of the relay to ensure that it operates normally, and feeds back information to the controller, which helps to achieve closed-loop control and improve the safety and reliability of the system. The logic circuit with a watchdog enhances the self-protection mechanism of the system to ensure that normal operation is quickly restored under abnormal circumstances. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the following briefly introduces the drawings required for use in the embodiment or the prior art description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 A schematic diagram of the structure of a control circuit provided in an embodiment of the present application;
[0032] Figure 2 A schematic structural diagram of a relay drive circuit provided in an embodiment of the present application;
[0033] Figure 3 A schematic structural diagram of another relay drive circuit provided in an embodiment of the present application;
[0034] Figure 4 A schematic structural diagram of a relay detection circuit provided in an embodiment of the present application;
[0035] Figure 5 A schematic structural diagram of another relay detection circuit provided in an embodiment of the present application;
[0036] Figure 6 A schematic structural diagram of another relay detection circuit provided in an embodiment of the present application;
[0037] Figure 7 A schematic structural diagram of another relay detection circuit provided in an embodiment of the present application;
[0038] Figure 8 A schematic structural diagram of a relay detection circuit provided in an embodiment of the present application;
[0039] Figure 9A schematic diagram of the structure of a logic circuit provided in an embodiment of the present application;
[0040] Figure 10 A schematic diagram of the structure of another logic circuit provided in an embodiment of the present application;
[0041] Figure 11 A schematic diagram of the structure of a power supply circuit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] Obviously, the embodiments described in this application are only a part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0043] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application.
[0044] See also Figure 1 , Figure 1 A structural diagram of a control circuit provided in an embodiment of the present application, wherein the control circuit includes a controller, a relay drive circuit, a relay detection circuit, and a logic circuit with a watchdog;
[0045] The output end of the relay driving circuit is connected to the control end of the relay; the input end of the relay driving circuit is connected to the output end of the logic circuit; the input end of the logic circuit is connected to the signal output end of the controller;
[0046] The first detection end of the relay detection circuit is connected to the front end of the relay, the second detection end of the relay detection circuit is connected to the rear end of the relay; the output end of the relay detection circuit is connected to the input end of the controller.
[0047] In the above Figure 1 In the control circuit shown, the controller is the core component of the entire control circuit. It receives detection signals from the relay detection circuit and generates a corresponding first control signal based on the detection signals. The controller, which can be a microcontroller unit (MCU) or a programmable logic controller (PLC), determines whether the relay needs to be activated based on the detection signals and the relay control logic. The controller outputs the generated first control signal to the logic circuit to determine the operating state of the relay drive circuit.
[0048] The relay detection circuit's primary function is to monitor the relay's operating status, ensuring proper operation and preventing malfunctions. The relay detection circuit has two detection terminals: the first connected to the front end of the relay, and the second connected to the back end. The relay detection circuit monitors in real time whether the relay is properly connected or disconnected. If an abnormal condition is detected (such as a relay not operating as expected), the detection circuit transmits this status information to the controller via a detection signal, triggering appropriate action.
[0049] A logic circuit with a watchdog function (hereinafter referred to as the logic circuit) acts as an intermediary between the controller and the relay drive circuit, responsible for processing the logical operations and integration of the first control signal. The logic circuit input receives the signal output from the controller and operates on the first control signal according to a preset logical relationship to output a corresponding second control signal to the relay drive circuit. At the same time, this logic circuit is equipped with a watchdog function to monitor the normal operation of the system. If the logic circuit malfunctions or stops responding, the watchdog function fails, and the corresponding second control signal is output to the relay drive circuit, which then outputs a drive signal to the relay, causing the relay to shut down and prevent power theft.
[0050] The relay driver circuit's input is connected to the logic circuit's output and receives a second control signal. The relay driver circuit's primary function is to control the relay's on / off state based on the second control signal. For example, the relay driver circuit drives the relay to open or close based on the state of the second control signal. The relay's output is connected to an external load to control the load's on / off state.
[0051] This control circuit integrates a controller, relay driver circuit, relay detection circuit, and logic circuit with a watchdog timer to achieve efficient, precise, and reliable control of the relays, significantly improving the overall stability and safety of the system. The controller, acting as the central control, receives relay detection circuit detection results and flexibly controls the logic circuit's operating state based on these results, ensuring that the relay driver circuit activates the relay at the appropriate time. The relay driver circuit responds to the controller's control signals, quickly and accurately transmitting current to the relay's control terminal, enabling the relay to quickly switch the external circuit. This not only improves response speed but also reduces the risk of misoperation. The relay detection circuit acts as the "eyes" of the control circuit, monitoring the relay's front-end and back-end status in real time and providing feedback to the controller via output signals, enabling real-time monitoring of the relay's operating status. This closed-loop control mechanism significantly mitigates potential risks associated with relay failure. Furthermore, the logic circuit with a watchdog timer enhances the system's self-detection and correction capabilities. If a system anomaly occurs, the watchdog timer quickly responds and resets the logic circuit, ensuring the continuity and accuracy of the control process. In summary, the protection circuit not only improves the system's control accuracy over the relay through a multi-level control and detection mechanism, but also enhances the system's adaptability under abnormal conditions, ensuring that actual power consumption is consistent with the metered power and preventing electricity theft.
[0052] In one possible implementation, the relay drive circuit may be as follows: Figure 2 As shown, the relay drive circuit includes a relay drive chip U8, a first capacitor C66 and a second capacitor C67;
[0053] The first pin OB of the relay driver chip U8 is connected to the second control pin of the relay; the second pin GND of the relay driver circuit is grounded; the third pin A of the relay driver circuit is connected to the first output end of the logic circuit; the fourth pin OA of the relay driver chip U8 is connected to the first control pin of the relay; the fifth pin VIN of the relay driver chip U8 is connected to one end of the first capacitor C66, and the sixth pin B of the relay driver chip U8 is connected to one end of the second capacitor C67. The sixth pin B of the relay driver chip U8 is also connected to the second output end of the logic circuit;
[0054] The other end of the first capacitor C66 and the other end of the second capacitor C67 are both grounded.
[0055] The second control signal output by the logic circuit to the relay driver circuit includes RELAY_A and RELAY_B. In the above-mentioned relay driver circuit, the third pin A of the relay driver chip U8 receives RELAY_A output by the logic circuit, and the sixth pin B of the relay driver chip U8 receives RELAY_B output by the logic circuit. When the internal logic of the relay driver chip U8 determines that the relay needs to be turned on or off, the corresponding control signal is sent to the relay through the third pin A and the sixth pin B. The power supply of the relay driver chip U8 is +12V_METER. The signals output by the relay driver chip U8 to the relay include RELON and RELOFF. The second pin GND is connected to the ground wire, providing a reference potential for the relay driver chip U8 to ensure its normal operation. The fifth pin VIN is connected to the +12V power supply and is connected to one end of the first capacitor C66, providing power management functions to ensure that the chip can operate stably and reliably. The sixth pin B is connected to one end of the second capacitor C67 and simultaneously receives the second output terminal (RELAY_B) of the logic circuit.
[0056] In another possible implementation, the relay drive circuit can also be Figure 3 As shown, the relay drive circuit further includes a third capacitor C68, a first resistor R95, a second resistor R96, a third resistor R97 and a fourth resistor R98;
[0057] The third pin of the relay driver chip U8 is connected to one end of the third capacitor C68 and one end of the first resistor R95. The third pin of the relay driver chip U8 is connected to one end of the fourth resistor R97. The other end of the fourth resistor R97 and the other end of the third capacitor C68 are both grounded. The other end of the first resistor R95 is connected to the first output end of the logic circuit.
[0058] The sixth pin of the relay driver chip U8 is connected to one end of the second resistor R96 and one end of the fourth resistor R97; the other end of the second resistor R96 is connected to the second output end of the logic circuit, and the other end of the fourth resistor R98 is grounded.
[0059] exist Figure 3In the relay driver circuit shown, the first resistor R95 and the second resistor R96 are input series resistors that protect the relay driver chip U8. In the event of a power-on sequence anomaly (for example, the control voltages for RELAY_A and RELAY_B appear before +12V_METER), these first and second resistors R95 and R96 reduce the current that flows back through the electrostatic discharge (ESD) diodes within the relay driver chip U8 to +12V_METER. Excessive backflow can easily cause the relay driver chip U8 to enter a latched state. The third capacitor C68 provides filtering. Before the controller power-on reset is complete or the port is not configured as an output, the I / O port has a weak pull-up. In this case, the I / O port may generate an invalid high level before the controller reset is complete or the program is running, causing the relay to malfunction. In this case, the third resistor R97 and the fourth resistor R98 are required to pull down for protection.
[0060] The control truth table of the third pin A and the sixth pin B of the relay driver chip U8 is as follows:
[0061] A B OA OB Relay Action 1 0 +12V_METER 0V Turn On 0 1 0V +12V_METER Turn On 0 0 High Z High Z No Change 1 1 High Z High Z No Change
[0062] When RELAY_A and RELAY_B are both high or low (RELAY_A and RELAY_B are both 1 or both 0), the fourth pin OA and the first pin OB of the relay driver chip U8 output Hight Z, and the relay is in the hold state with no action (NoChange).
[0063] When RELAY_A=1, RELAY_B=0, and the pulse width of RELAY_A and RELAY_B, that is, the driving duration, is at least 100ms, the fourth pin OA of the relay driver chip U8 outputs REL_ON=OA=+12V_METER, and the first pin OB of the relay driver chip U8 outputs REL_OFF=OB=0V, and the relay is closed.
[0064] When RELAY_A=0, RELAY_B=1, and the pulse width of RELAY_A and RELAY_B, i.e., the driving duration, is at least 100ms, the fourth pin OA of the relay driver chip U8 outputs REL_ON=OA=0V, and the first pin OB of the relay driver chip U8 outputs REL_OFF=OB=+12V_METER, and the relay is disconnected.
[0065] In one possible implementation, the relay detection circuit can be as follows Figure 4 As shown, the relay detection circuit includes a first diode DE2 and an optical coupler PE1;
[0066] The first pin of the optocoupler is connected to the input end of the relay, the second pin of the optocoupler is connected to the output end of the relay, the third pin of the optocoupler is grounded, and the fourth pin of the optocoupler is connected to the DC power supply DVDD and the input end of the controller;
[0067] The cathode of the first diode DE2 is connected to the first pin of the optocoupler; the anode of the first diode DE2 is connected to the second pin of the optocoupler.
[0068] In one possible implementation, the relay drive circuit can also drive two relays simultaneously. The fourth pin OA of the relay drive circuit is connected to the control pin REL_ON1 of the first relay and the control pin REL_OFF2 of the second relay. The first pin OB of the relay drive circuit is connected to the control pin REL_OFF1 of the first relay and the control pin REL_ON2 of the second relay.
[0069] exist Figure 4 In the relay detection circuit shown, optocoupler PE1 and first diode DE2 enable reliable detection of the relay status. This design not only effectively detects the relay's operating status but also provides electrical isolation through the optocoupler, improving system safety and anti-interference capabilities.
[0070] An optocoupler (also known as a photocoupler) is a device that transmits electrical signals via light. It provides electrical isolation between input and output, protecting sensitive circuits from high voltage or noise. In this circuit, the first pin of optocoupler PE1 (the anode of the input-side LED) is connected to the relay input. This pin receives the signal from the relay input and converts it into an optical signal via the LED within the optocoupler. The second pin of optocoupler PE1 (the cathode of the input-side LED) is connected to the relay output. This connection with the relay output forms a current loop, causing the LED to illuminate. The third pin of optocoupler PE1 (the emitter of the output-side photodiode) is grounded, forming a current path for the output. The fourth pin of optocoupler PE1 (the collector of the output-side photodiode) is connected to the DC power supply DVDD and the controller input. This pin outputs the electrical signal after photoelectric conversion (i.e., the detection signal REL_CHEK1) for the controller to detect the relay status.
[0071] When the relay is in operation, current flows through the LED on the input side of the optocoupler PE1, causing it to illuminate. This light signal is detected by the phototransistor within the optocoupler, generating a corresponding electrical signal (i.e., detection signal REL_CHEK1) on the output side. This detection signal REL_CHEK1 is transmitted to the controller, which uses it to determine the relay's operating status.
[0072] In another possible implementation, the relay detection circuit can also be as follows Figure 5As shown, the relay detection circuit further includes a fourth capacitor CN10, one end of the fourth capacitor CN10 is connected to the fourth pin of the optocoupler, and the other end of the fourth capacitor CN10 is grounded.
[0073] The relay detection circuit further optimizes the circuit design by adding the fourth capacitor CN10, improving the stability and anti-interference ability of the system. One end of the fourth capacitor CN10 is connected to the fourth pin of the optocoupler PE1, that is, the collector of the phototransistor on the output side of the optocoupler. The other end of the fourth capacitor CN10 is grounded. The fourth capacitor CN10 can absorb and smooth high-frequency noise and transient interference in the electrical signal, making the electrical signal output by the optocoupler PE1 purer and more stable. When there is a slight fluctuation in the output signal of the optocoupler PE1, the fourth capacitor CN10 can provide a stable power supply for the phototransistor by storing and releasing charges, maintaining the continuity and stability of its output signal. Oscillations or instability may occur on the output side of the optocoupler PE1. By adding the fourth capacitor CN10, these transient energies can be effectively absorbed to avoid the generation of oscillations.
[0074] In another possible implementation, the relay detection circuit can also be as follows Figure 6 As shown, the relay detection circuit further includes a fifth resistor RE1, a sixth resistor RE2, a seventh resistor RE3 and an eighth resistor RE4;
[0075] One end of the eighth resistor RE4 is connected to the first pin of the optocoupler PE1 and the cathode of the first diode DE2, the other end of the eighth resistor RE4 is connected to one end of the seventh resistor RE3, and the other end of the seventh resistor RE3 is connected to the input end of the relay;
[0076] One end of the sixth resistor RE2 is connected to the second pin of the optocoupler PE1 and the anode of the first diode DE2 , the other end of the sixth resistor RE2 is connected to one end of the fifth resistor RE1 , and the other end of the fifth resistor RE1 is connected to the output end of the relay.
[0077] exist Figure 6 The relay detection circuit shown in the figure further optimizes the circuit's signal processing and protection mechanisms by adding the fifth resistor RE1, the sixth resistor RE2, the seventh resistor RE3, and the eighth resistor RE4. When the voltage at the relay input is high, the eighth resistor RE4 and the seventh resistor RE3 share some of the voltage, reducing the voltage input to the first pin of the optocoupler PE1 and preventing damage to the optocoupler PE1 due to excessive voltage. When the relay is disconnected, the eighth resistor RE4 provides a current path, preventing the first pin of the optocoupler PE1 from floating, thereby reducing false triggering caused by static electricity or noise.
[0078] Similarly, when the voltage at the relay output is high, the sixth resistor RE2 and the fifth resistor RE1 share some of the voltage, reducing the voltage input to the second pin of the optocoupler PE1 and preventing damage to the optocoupler PE1 due to excessive voltage. When the relay is disconnected, the sixth resistor RE2 provides a current path, preventing the second pin of the optocoupler PE1 from floating, thereby reducing false triggering caused by static electricity or noise.
[0079] In another possible implementation, the relay detection circuit can also be as follows Figure 7 As shown, the relay detection circuit further includes a ninth resistor R19;
[0080] The fourth pin of the optocoupler PE1 is connected to the DC power supply DVDD via a ninth resistor R19.
[0081] The ninth resistor R19 is used to limit the current passing through the phototransistor on the output side of the optocoupler PE1, protecting the optocoupler PE1 and subsequent circuits (such as the controller) from the impact of excessive current. When the phototransistor on the output side of the optocoupler PE1 is cut off, the fourth pin level of the optocoupler PE1 is pulled up to the DC power supply voltage to ensure that the controller can detect a clear high-level signal. When the relay is closed, the front end of the optocoupler PE1 passes through an AC signal. When the optocoupler PE1 is turned on, the phototransistor will pull down the fourth pin level. When the optocoupler PE1 is cut off, the fourth pin is high, and the controller detects a square wave signal. The ninth resistor R19 helps stabilize the output signal of the optocoupler PE1, ensuring that the controller can receive a stable and reliable electrical signal, avoiding signal distortion or damage to components due to excessive current or fluctuations.
[0082] In addition, the embodiment of the present application further provides a relay detection circuit, specifically Figure 8 As shown, Figure 8 The relay detection circuit shown has Figure 5-7 The relay shown detects all effects of the circuit.
[0083] In one possible implementation, the logic circuit may be as follows Figure 9 As shown, the logic circuit includes a watchdog logic chip and a fifth capacitor C30;
[0084] The first pin of the watchdog logic chip U9 is connected to one end of the fifth capacitor C30 and the DC power supply VDD3.3; the third pin of the watchdog logic chip U9 is connected to the first signal output end of the controller; the fifth pin of the watchdog logic chip U9 is grounded; the sixth pin of the watchdog logic chip U9 is connected to the first input end of the relay drive circuit; the seventh pin of the watchdog logic chip U9 is connected to the second input end of the relay drive circuit; the eighth pin of the watchdog logic chip U9 is connected to the second signal output end of the controller.
[0085] The first control signal sent by the controller to the logic circuit includes the watchdog signal WD_IN and the relay control signal REL_CON_IN.
[0086] The third pin of the watchdog logic chip U9 is connected to the first signal output of the controller to receive the watchdog signal WD_IN. The eighth pin (second control signal input) of the watchdog logic chip U9 is connected to the second signal output of the controller to receive the relay control signal REL_CON_IN. The sixth pin of the watchdog logic chip U9 is connected to the first input of the relay driver circuit to send the RELAY_A signal to the relay driver circuit. The seventh pin of the watchdog logic chip U9 is connected to the second input of the relay driver circuit to send the RELAY_B signal to the relay driver circuit.
[0087] One end of the fifth capacitor C30 is connected to the first pin of the watchdog logic chip U9 and the DC power supply VDD3.3, and the other end of the fifth capacitor C30 is grounded. The fifth capacitor C30 can absorb and smooth the high-frequency noise and transient interference in the DC power supply VDD3.3, ensuring that the power supply voltage provided to the watchdog logic chip U9 is purer and more stable. When there are slight fluctuations in the power supply voltage, the fifth capacitor C30 provides a stable power supply for the watchdog logic chip U9 by storing and releasing charges, maintaining the continuity and stability of its operation. Slight fluctuations in the power supply voltage may cause oscillations. The fifth capacitor C30 avoids the generation of oscillations by absorbing these fluctuation energies, thereby ensuring the stable operation of the watchdog logic chip U9.
[0088] The controller controls the logic circuit in such a way that: the controller continuously outputs a dog feeding signal WD_IN to the watchdog logic chip U9 (for example, the dog feeding timeout is 10 seconds, and the dog feeding is performed at a high level). In some abnormal situations (such as controller abnormality), the controller does not provide the dog feeding signal WD_IN, and the watchdog logic chip U9 outputs RELAY_A = 0 and RELAY_B = 1, and the relay is in the disconnected state, thus realizing the relay disconnection control.
[0089] When the relay is to be controlled to close, in addition to the controller feeding the watchdog logic chip U9 the dog signal WD_IN every preset time, the controller also needs to output REL_CON_IN=1 to the watchdog logic chip U9. Then the watchdog logic chip U9 outputs RELAY_A=1 and RELAY_B=0, and the pulse width of RELAY_A and RELAY_B, that is, the driving duration, is at least 100ms.
[0090] When the relay is to be controlled to disconnect, in addition to the dog feeding signal WD_IN given by the controller to the watchdog logic chip U9 every preset time, the controller also needs to output REL_CON_IN=0 to the watchdog logic chip U9. Then the watchdog logic chip U9 outputs RELAY_A=0 and RELAY_B=1, and the pulse width of RELAY_A and RELAY_B, that is, the driving duration, is at least 100ms.
[0091] In a possible implementation, the logic circuit can also be as follows Figure 10 As shown, the logic circuit further includes a tenth resistor R93 and an eleventh resistor R94;
[0092] The third pin of the watchdog logic chip U9 is connected to the first signal output end of the controller through the eleventh resistor R94; the eighth pin of the watchdog logic chip U9 is connected to the second signal output end of the controller through the tenth resistor R93.
[0093] The eleventh resistor R94 is used to prevent excessive signals from flowing into the watchdog logic chip, protecting the chip from damage. The tenth resistor R93 also provides a current limiting function to ensure safe signal transmission between the controller and the watchdog.
[0094] In a possible implementation, the circuit further includes a power supply circuit, such as Figure 11 As shown, the power supply circuit includes a second diode D3 and an electrolytic capacitor CP1;
[0095] The anode of the second diode D3 is connected to the DC power supply DVDD, the cathode of the second diode D3 is connected to the positive electrode of the electrolytic capacitor CP1 and the power supply end of the logic circuit, and the negative electrode of the electrolytic capacitor CP1 is grounded.
[0096] The power supply circuit is responsible for providing a stable and reliable power supply to the logic circuit, ensuring the stability and reliability of the power supply. The second diode D3 ensures that the current can only flow in one direction, preventing the current from returning to the power supply, and outputting a stable DC power supply to the subsequent circuit. The electrolytic capacitor CP1 is used to smooth the supply voltage, absorb high-frequency noise and short-term voltage fluctuations in the DC power supply, and provide a more stable power supply to the logic circuit. The power supply circuit is used to provide a separate power supply for the logic circuit to ensure that in the event of a controller malfunction, such as controller damage or power supply anomalies, this circuit can also be used to disconnect the relay in real time, control the user's actual power consumption, and prevent electricity theft.
[0097] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0098] The "multiple" involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first" and "second" are only used for the purpose of distinguishing the description and cannot be understood as indicating or implying relative importance or order.
[0099] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. The above description is only an exemplary embodiment of the present application and is not intended to limit the scope of protection of this application.
Claims
1. A control circuit of a relay, characterized in that: It includes a controller, a relay driving circuit, a relay detection circuit and a logic circuit with a watchdog; The output end of the relay driving circuit is connected to the control end of the relay; the input end of the relay driving circuit is connected to the output end of the logic circuit; the input end of the logic circuit is connected to the signal output end of the controller; The first detection end of the relay detection circuit is connected to the front end of the relay, and the second detection end of the relay detection circuit is connected to the rear end of the relay; the output end of the relay detection circuit is connected to the input end of the controller.
2. The circuit according to claim 1, wherein: The relay drive circuit includes a relay drive chip, a first capacitor and a second capacitor; The first pin of the relay driver chip is connected to the second control pin of the relay; the second pin of the relay driver circuit is grounded; The third pin of the relay drive circuit is connected to the first output end of the logic circuit; the fourth pin of the relay drive chip is connected to the first control pin of the relay; the fifth pin of the relay drive chip is connected to one end of the first capacitor and a DC power supply, the sixth pin of the relay drive chip is connected to one end of the second capacitor, and the sixth pin of the relay drive chip is also connected to the second output end of the logic circuit; The other end of the first capacitor and the other end of the second capacitor are both grounded.
3. The circuit according to claim 1, wherein: The relay detection circuit includes a first diode and an optical coupler; The first pin of the optocoupler is connected to the input end of the relay, the second pin of the optocoupler is connected to the output end of the relay, the third pin of the optocoupler is grounded, and the fourth pin of the optocoupler is connected to a DC power supply and the input end of the controller; The anode of the first diode is connected to the second pin of the optocoupler; and the cathode of the first diode is connected to the first pin of the optocoupler.
4. The circuit according to claim 1, wherein: The logic circuit includes a watchdog logic chip and a fifth capacitor; The first pin of the watchdog logic chip is connected to one end of the fifth capacitor and the DC power supply; the third pin of the watchdog logic chip is connected to the first signal output end of the controller; The fifth pin of the watchdog logic chip is grounded; the sixth pin of the watchdog logic chip is connected to the first input end of the relay drive circuit; the seventh pin of the watchdog logic chip is connected to the second input end of the relay drive circuit; and the eighth pin of the watchdog logic chip is connected to the second signal output end of the controller.
5. The circuit according to claim 2, characterized in that The relay drive circuit further includes a third capacitor, a first resistor, a second resistor, a third resistor and a fourth resistor; The third pin of the relay driver chip is connected to one end of the third capacitor and one end of the first resistor, the third pin of the relay driver chip is connected to one end of the fourth resistor, the other end of the fourth resistor and the other end of the third capacitor are both grounded; the other end of the first resistor is connected to the first output end of the logic circuit; The sixth pin of the relay driver chip is connected to one end of the second resistor and one end of the fourth resistor; the other end of the second resistor is connected to the second output end of the logic circuit, and the other end of the fourth resistor is grounded.
6. The circuit according to claim 3, characterized in that The relay detection circuit further includes a fourth capacitor, one end of the fourth capacitor is connected to the fourth pin of the optocoupler, and the other end of the fourth capacitor is grounded.
7. The circuit according to claim 3, characterized in that The relay detection circuit further includes a fifth resistor, a sixth resistor, a seventh resistor and an eighth resistor; One end of the eighth resistor is connected to the first pin of the optocoupler and the cathode of the first diode, the other end of the eighth resistor is connected to one end of the seventh resistor, and the other end of the seventh resistor is connected to the input end of the relay; One end of the sixth resistor is connected to the second pin of the optocoupler and the anode of the first diode, the other end of the sixth resistor is connected to one end of the fifth resistor, and the other end of the fifth resistor RE1 is connected to the output end of the relay.
8. The circuit according to claim 3, characterized in that The relay detection circuit further includes a ninth resistor; The fourth pin of the optocoupler is connected to a DC power supply through the ninth resistor.
9. The circuit according to claim 4, characterized in that The logic circuit further includes a tenth resistor and an eleventh resistor; The third pin of the watchdog logic chip is connected to the first signal output end of the controller through the eleventh resistor; the eighth pin of the watchdog logic chip is connected to the second signal output end of the controller through the tenth resistor.
10. The circuit according to claim 4, characterized in that The circuit further includes a power supply circuit, wherein the power supply circuit includes a second diode and an electrolytic capacitor; The anode of the second diode is connected to a DC power supply, the cathode of the second diode is connected to the positive electrode of the electrolytic capacitor and the power supply end of the logic circuit, and the negative electrode of the electrolytic capacitor is grounded.