Relay fault detection circuit
The relay fault detection circuit controlled by a microcontroller (MCU) automatically detects the status of reed relays, solving the problems of misjudgment or missed judgment in traditional methods. It achieves efficient and accurate fault judgment and timely response, improving the safety and intelligence of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2026-03-13
AI Technical Summary
Traditional methods are difficult to accurately detect the performance changes of reed relays under dynamic operating conditions, which can easily lead to misjudgments or omissions, affecting the safe operation of the system.
A relay fault detection circuit was designed, which uses a microcontroller (MCU) to control the relay control module, automatically send test signals and receive feedback signals for comparison and judgment. The circuit includes a power supply unit, an alarm unit and a test unit, to realize the status monitoring and fault determination of reed relays.
It improves detection efficiency and accuracy, enables timely response to fault situations, enhances the system's security and intelligence, and avoids misjudgment or missed judgment.
Smart Images

Figure CN223992951U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of relay technology, and in particular to a relay fault detection circuit. Background Technology
[0002] In industrial control, automation systems, and electronic equipment, reed relays are critical control components whose performance and reliability directly affect the stable operation of the entire system. Relays on circuit boards typically lack fault detection, meaning that when a relay malfunctions, the system may not recognize it, leading to system failure and severely impacting safe operation.
[0003] However, traditional methods for testing reed relays often use basic instruments such as multimeters and oscilloscopes for offline measurements. This approach struggles to accurately capture the relay's performance changes under dynamic operating conditions, making it prone to misjudgments or missed detections.
[0004] In view of this, it is indeed necessary to propose a relay fault detection circuit to solve the above problems. Utility Model Content
[0005] To achieve the above objectives, the present invention provides a relay fault detection circuit capable of detecting relay faults.
[0006] To address this issue, the present invention provides a relay fault detection circuit, comprising: a power supply unit, an alarm unit, and a test unit. The power supply unit is configured to supply power to the test unit and the alarm unit. The test unit includes a microcontroller (MCU) and a relay control module and a relay feedback module connected to the MCU. The alarm unit is signal-connected to the MCU. The relay control module controls the state of the reed relay K1. One port of the MCU sends a test signal to the relay control module to drive the reed relay K1, and sends a feedback signal to the other port of the MCU through the relay feedback module. The MCU compares the received feedback signal with the test signal at a set time to determine the state of the reed relay K1. If the feedback signal and the test signal received by the MCU are consistent, the reed relay K1 is considered normal. If the feedback signal and the test signal are inconsistent, the reed relay K1 is considered faulty, and the MCU sends an H signal to the alarm unit to activate the alarm unit.
[0007] Optionally, the test signal is a 10Hz square wave with a duration of 50ms for both H and L levels. The microcontroller (MCU) sends the test signal for 30ms and then starts the feedback signal detection, with a detection period of 20ms.
[0008] Optionally, the relay control module includes resistor R4, resistor R5, MOSFET Q1, diode D1, and JP3 connector. One end of resistor R4 is connected to the P0.0 port of the microcontroller MCU, and the other end of resistor R4 is connected to the gate (G) of MOSFET Q1 and resistor R5. The source (S) of MOSFET Q1 is grounded, and the drain (D) of MOSFET Q1 is connected to JP3 connector through diode D1. JP3 connector is connected in parallel across diode D1 for connecting the coil of reed relay K1 externally.
[0009] Optionally, the relay feedback module includes a JP4 connector, resistor R6, and resistor R7. The JP4 connector is connected to the reed switch of the reed relay K1 and is connected to the P0.1 port of the microcontroller MCU through resistor R6. One end of resistor R7 is connected to the JP4 connector, and the other end is grounded, forming a voltage divider detection circuit for the feedback signal.
[0010] Optionally, the alarm unit includes a resistor R9 and an alarm LS1, a MOSFET Q2, and a resistor R8 connected in series. The gate of the MOSFET is connected to the P0.2 port of the microcontroller MCU through the resistor R8. The drain of the MOSFET Q2 is connected to the alarm LS1, and the source of the MOSFET Q2 is grounded. The resistor R9 is connected in parallel between the source and gate of the MOSFET Q2 for electrostatic discharge.
[0011] Optionally, the power supply terminal of the alarm LS1 is connected to the output terminal of the power supply unit, and the drain of the MOSFET Q2 is connected in series with the alarm LS1 to form a drive circuit.
[0012] Optionally, the power supply unit includes a JP1 connector, a capacitor C1, a three-terminal voltage regulator V1, and a capacitor C2. The capacitor C1 is connected in parallel across the two ends of the JP1 connector, the three-terminal voltage regulator V1 is connected in parallel across the two ends of the capacitor C1, the ground terminal of the three-terminal voltage regulator V1 is grounded, the output terminal of the three-terminal voltage regulator V1 is connected to the positive terminal of the capacitor C2, and the negative terminal of the capacitor C2 is grounded.
[0013] Optionally, the power supply unit also includes a switch SW1, a resistor R3, a capacitor C3, and a light-emitting diode LED1. The switch SW1 is connected in series between the output terminal of the three-terminal regulator V1 and the resistor R3. The other end of the resistor R3 is connected to the positive terminal of the light-emitting diode LED1. One end of the capacitor C3 is connected to the series node of the resistor R3 and the light-emitting diode LED1, and the other end of the capacitor C3 is grounded.
[0014] Optionally, the power supply unit also includes a JP2 connector, which is connected to an external power supply and outputs power that matches the operating voltage of the reed relay K1. The relay control module includes a JP3 connector, and the JP2 connector and the JP3 connector are electrically connected.
[0015] Optionally, it also includes a program burning unit, which includes a USB communication interface connected to the microcontroller MCU. Pin 1 of the USB communication interface is electrically connected to the power supply unit. A capacitor C4 is connected in series with pin 1 of the USB communication interface, and capacitor C4 is grounded. Pin 2 of the USB communication interface is connected in series with a resistor R1, and resistor R1 is connected to the input terminal RXD of the microcontroller MCU. Pin 3 of the USB communication interface is connected in series with a resistor R2, and resistor R2 is connected to the output terminal TXD of the microcontroller MCU. Pin 4 of the USB communication interface is grounded.
[0016] Compared with the prior art, the technical solution of the embodiments of this utility model has the following beneficial effects:
[0017] This invention's relay fault detection circuit uses a microcontroller (MCU) to control the relay control module, automatically sending test signals to drive the reed relay K1 and comparing the feedback signals returned by the relay feedback module. This eliminates the need for manual intervention, improving detection efficiency and accuracy. The MCU compares the received feedback signal with the test signal at set intervals, avoiding misjudgments or missed detections caused by improper timing in traditional methods. When a fault is detected in the reed relay K1, the MCU promptly sends an H signal to the alarm unit to activate the alarm, quickly responding to the fault and facilitating timely intervention, thus improving system safety. Utilizing the intelligent control function of the MCU, precise control and status monitoring of the reed relay K1 are achieved, enhancing the intelligence level of the detection process. Attached Figure Description
[0018] Figure 1 This is a circuit diagram of a relay fault detection circuit conforming to a preferred embodiment of the present utility model;
[0019] Figure 2 yes Figure 1 A partial view of the test unit;
[0020] Figure 3 This is a flowchart of the relay fault detection circuit conforming to a preferred embodiment of the present utility model. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this utility model clearer, the present utility model will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] It should be noted that, in order to avoid obscuring the present invention with unnecessary details, only the structures and / or processing steps closely related to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0023] Additionally, it should be noted that the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0024] Please see Figures 1 to 3 As shown, an embodiment of this utility model provides a relay fault detection circuit for detecting whether a relay is faulty. The relay fault detection circuit includes a power supply unit, a programming unit, an alarm unit, and a testing unit. The power supply unit supplies power to the testing unit, the programming unit, and the alarm unit.
[0025] The power supply unit is connected to an external power source. In this embodiment, the power supply unit is connected to a 12V DC power source. In other embodiments, the power supply unit can also be connected to a 5V DC power source. The power supply unit includes a JP1 connector, a capacitor C1, a three-terminal voltage regulator V1, and a capacitor C2. The JP1 connector is connected to a 12V DC power source to supply power to the power supply unit. Capacitor C1 is connected in parallel across the two ends of the JP1 connector, and the three-terminal voltage regulator V1 is connected in parallel across the two ends of capacitor C1. The ground terminal of the three-terminal voltage regulator V1 is grounded for easy voltage adjustment. The three-terminal voltage regulator V1 outputs a 5V positive voltage. The negative terminal of capacitor C1 is grounded, which acts as a filter, effectively reducing power fluctuations and interference, providing stable power to the test unit and alarm unit, and ensuring the normal operation and accuracy of the detection circuit. The output terminal of the three-terminal voltage regulator V1 is connected to the positive terminal of capacitor C2, and the negative terminal of capacitor C2 is grounded. The power supply unit effectively suppresses power fluctuations and high-frequency noise through a multi-stage filtering design using a three-terminal regulator V1 and capacitors C1 and C2, providing a stable 5V power supply to the test unit and alarm unit, significantly improving the anti-interference capability of the detection circuit and ensuring the accuracy of fault diagnosis.
[0026] The power supply unit also includes a switch SW1, a capacitor C3, a resistor R3, and a light-emitting diode (LED1). The output of a three-terminal regulator V1 is connected to switch SW1, which is connected in series with resistor R3 and LED1. The negative terminal of LED1 is grounded. The indicator circuit composed of resistor R3 and LED1 can visually display the operating status of the power supply unit. When the output voltage of the three-terminal regulator V1 is normal, LED1 lights up, allowing users to quickly determine whether the circuit is powered, facilitating troubleshooting and routine maintenance. Resistor R3, connected in series in the LED1 circuit, limits the current, preventing damage to LED1 due to excessive current, extending the lifespan of LED1, and also providing some overcurrent protection, improving circuit safety. The other end of resistor R3 is connected to capacitor C3, one end of which is grounded. Capacitor C3 further filters out high-frequency noise in the power supply, working in conjunction with capacitors C1 and C2 to more precisely ensure a pure and stable output power supply, providing more reliable power support for loads such as test units and alarm units, and reducing the potential impact of power supply noise on detection accuracy.
[0027] The power supply unit also includes a JP2 connector, which is connected to an external power source. One end of the JP2 connector is grounded, and the other end outputs the same voltage as the operating voltage of the reed relay K1. This allows it to directly provide a suitable operating voltage for the reed relay K1 without the need for an additional power converter, simplifying circuit design and improving power supply efficiency. The JP2 connector connects to the JP3 connector and diode D1 in the test unit. The diode D1 prevents reverse current flow, avoiding damage to other components in the circuit and providing protection.
[0028] The test unit controls the on / off state of reed relay K1. The test unit includes a microcontroller (MCU) and a relay control module and a relay feedback module connected to the MCU. The power supply unit supplies power to the MCU. The MCU's VCC interface (I / O port) is connected to the power supply unit. The MCU's VCC interface is connected to capacitor C3. Capacitor C3 is 0.1uF and can filter out high-frequency noise from the power supply unit circuit, providing a cleaner and more stable power supply to the MCU.
[0029] The relay control module controls the state of reed relay K1. One port of the microcontroller (MCU) sends a test signal to the relay control module, which drives the reed relay K1. Then, a feedback signal is sent to the other port of the MCU via the relay feedback module. The MCU compares the received feedback signal with the test signal at a set time to determine if the reed relay K1 is faulty. In this embodiment, the MCU's signal transmission frequency is set to 10Hz, and the duration of each H / L signal is 50ms. The MCU starts detecting the received signal 30ms after sending the test signal, with a detection period of 20ms. If the feedback signal and test signal received by the MCU match, the reed relay K1 is considered normal. If the feedback signal and test signal do not match, the reed relay K1 is considered faulty. After determining that the reed relay K1 is faulty, the MCU can promptly send an H signal to the alarm unit to activate the alarm unit and quickly respond to the fault. The test unit automatically controls the sending and receiving of test signals through a microcontroller (MCU), thereby automatically detecting the state of the reed relay K1 and improving detection efficiency and accuracy.
[0030] The relay control module includes resistors R4 and R5, a MOSFET Q1, a diode D1, and a JP3 connector. One end of resistor R4 is connected to the P0.0 port (I / O port) of the microcontroller (MCU), and the other end of resistor R4 is connected to the gate (G) of MOSFET Q1 and resistor R5. The source (S) of MOSFET Q1 is grounded. Resistor R4 limits current in the circuit, effectively preventing damage to MOSFET Q1 due to excessive current. Resistor R5 effectively prevents false triggering of MOSFET Q1 caused by parasitic capacitance in the circuit. The drain (D) of MOSFET Q1 is connected to the JP3 connector through diode D1, with the JP3 connector connected in parallel across diode D1. Diode D1 prevents reverse current from damaging MOSFET Q1 and also speeds up the circuit's response, ensuring timely relay control. The JP3 connector is used to connect to the reed relay K1. Connect the JP2 connector to the JP3 connector, and the external power supply powers the reed relay K1 through the JP2 connector.
[0031] The P0.0 port (I / O port) outputs H and L signals, which control the DS-S of MOSFET Q1 to turn on and off respectively, enabling precise power-on and power-off control of the reed relay K1, ensuring the relay operates as needed during testing. Specifically, when the P0.0 port outputs the H signal, the DS-S of MOSFET Q1 is turned on, thus powering on the reed relay K1 under test. When the P0.0 port outputs the L signal, the DS-S of MOSFET Q1 is turned off, thus powering off the reed relay K1.
[0032] After the reed relay K1 is de-energized, the current in the coil of the reed relay K1 will be quickly discharged through the diode D1 to prevent current accumulation from damaging the reed relay K1 and the circuit.
[0033] The relay feedback module includes a JP4 connector, resistors R6 and R7. The power supply unit provides DC power to the JP4 connector, which is connected to the reed relay K1. The P0.1 port of the microcontroller (MCU) is connected to resistor R6, the other end of which is connected to the JP4 connector. The other end of the JP4 connector is connected to resistor R7, which is grounded. Resistors R6 and R7 are connected in series. The setting of resistor R6 effectively limits the current, preventing damage to the MCU's P0.1 (I / O port) due to excessive current. Grounding resistor R7 provides a definite voltage value for the P0.1 port, avoiding uncertainty in the port voltage when the relay is not working, ensuring signal stability and detection accuracy. The relay coil is connected via a JP3 connector, and the relay's reed switch is connected via a JP4 connector, externally connecting to the reed relay K1 for testing. The design of the JP4 connector allows this feedback module to adapt to various relay specifications; simple connections via the connector are all that's needed to test external relays. By connecting the reed relay K1 to the JP4 connector, the feedback module can monitor the relay's operating status in real time and accurately transmit the status information to the microcontroller MCU, thus achieving precise feedback on the relay's status.
[0034] Signal detection principle: When the reed relay K1 is not conducting, the P0.1 port is pulled down to 0V by resistor R7, and the P0.1 port receives a stable L signal, avoiding misjudgment caused by signal drift. When the reed relay K1 is conducting, and an external power supply is connected to power the reed relay K1, resistor R7 will be pulled up to 5V, and the test signal received by the P0.1 port is the H signal.
[0035] After the microcontroller (MCU) sends a test signal via port P0.0 for 30ms, port P0.1 begins detecting the received feedback signal, with a detection period of 20ms. That is, from 31ms to 50ms after the test signal is sent via port P0.0, port P0.1 continuously detects the feedback signal. This precise timing control ensures accurate determination of whether the reed relay K1 is functioning correctly, guaranteeing the reliability of the detection results and avoiding misjudgments or missed judgments caused by improper detection timing in traditional methods. It also effectively prevents missed judgments due to a single detection. If the feedback signal received by the MCU matches the test signal, the reed relay K1 is considered normal. At this point, another set of feedback signals can be sent to continue the cyclical detection, allowing for the detection of other faults in the reed relay K1. Detectable faults of the reed relay K1 include it not working and slow response time. The reed relay K1 failing to open or close properly is considered not working. If the signal received by the microcontroller (MCU) is inconsistent with the test signal, the reed relay K1 is determined to be faulty. After determining that the reed relay K1 is faulty, the MCU can promptly send an H signal to the alarm unit to activate the alarm unit and quickly respond to the fault situation.
[0036] The alarm unit is connected to the microcontroller (MCU) for signal transmission. The alarm unit includes resistor R9 and an alarm LS1, MOSFET Q2, and resistor R8 connected in series. The drain (D) of MOSFET Q2 is connected to alarm LS1, and the source (S) of MOSFET Q2 is grounded. MOSFET Q2 conducts when it receives the H signal from port P0.2 of the MCU, and alarm LS1 emits an alarm sound, enabling rapid response to fault conditions and timely alerting the user. In other embodiments, alarm LS1 can also emit light to alert the user. One end of resistor R8 is connected to port P0.2 of the MCU, and the other end is connected to the gate (G) of MOSFET Q2. Resistor R8 limits the current flowing into the gate of MOSFET Q2, preventing damage due to excessive current. Resistor R9 is connected in parallel with MOSFET Q2. Resistor R9, connected in parallel across the source and gate of MOSFET Q2, serves to limit current and clamp voltage, preventing damage to MOSFET Q2 due to overvoltage or overcurrent. The power supply unit supplies power to alarm LS1.
[0037] The relay fault detection circuit also includes a programming unit. This programming unit provides a hardware USB communication interface, primarily for allowing for the modification of the microcontroller's internal parameters at any time. Specific parameters can be set according to the reed relay model K1. Pin 1 of the USB communication interface is electrically connected to the auxiliary power supply, and capacitor C4 is connected in series with pin 1, with C4 grounded. Pin 2 of the USB communication interface is connected in series with resistor R1, which is connected to the microcontroller's MCU input terminal RXD. Resistor R1 is 22Ω to prevent inrush current damage to the microcontroller during programming. Pin 3 of the USB communication interface is connected in series with resistor R2, which is connected to the microcontroller's MCU output terminal TXD. Resistor R2 is also 22Ω to prevent inrush current damage to the microcontroller during programming. Pin 4 of the USB communication interface is grounded.
[0038] In summary, the relay fault detection circuit of this invention uses a microcontroller (MCU) to control the relay control module, automatically sending test signals to drive the reed relay K1 and receiving feedback signals from the relay feedback module for comparison and judgment. This eliminates the need for manual intervention, improving detection efficiency and accuracy. When a fault is detected in the reed relay K1, the MCU promptly sends an H signal to the alarm unit to activate the alarm, quickly responding to the fault and facilitating timely intervention, thus improving system safety. Utilizing the intelligent control function of the MCU, precise control and status monitoring of the reed relay K1 are achieved, enhancing the intelligence level of the detection process.
[0039] The above embodiments are only used to illustrate the technical solutions of this utility model and are not intended to limit it. Although this utility model has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this utility model without departing from the spirit and scope of the technical solutions of this utility model.
Claims
1. A relay fault detection circuit, characterized by comprising: The utility model relates to a kind of relay testing device, including: Power supply unit, alarm unit and test unit, the power supply unit is configured to power the test unit and the alarm unit, the test unit includes single-chip microcontroller MCU and relay control module and relay feedback module connected with the single-chip microcontroller MCU, the alarm unit is signal connected with the single-chip microcontroller MCU, the relay control module is used to control the state of Reed relay K1, one port of the single-chip microcontroller MCU sends test signal to the relay control module, to drive the Reed relay K1, and feedback signal is transported to the other port of the single-chip microcontroller MCU by the relay feedback module, the single-chip microcontroller MCU compares according to the feedback signal received with test signal in set time, to determine the state of Reed relay K1; If the feedback signal received by single-chip microcontroller MCU and test signal are consistent, determine that Reed relay K1 is normal; If the feedback signal received by single-chip microcontroller MCU and test signal are not consistent, determine that Reed relay K1 is fault, and the single-chip microcontroller MCU emits H signal to the alarm unit, to start the alarm unit.
2. The relay fault detection circuit according to claim 1, characterized by, Test signal is 10Hz square wave, H / L level duration is each 50ms, the single-chip microcontroller MCU starts feedback signal detection after sending test signal 30ms, and detection period is 20ms.
3. The relay fault detection circuit according to claim 1, characterized by, The relay control module includes resistance R4, resistance R5, MOS tube Q1, diode D1 and JP3 connector, one end of the resistance R4 is connected with the P0.0 port of the single-chip microcontroller MCU, the other end of the resistance R4 is connected with the G pole of the MOS tube Q1, the resistance R5, the S pole of the MOS tube Q1 is grounded, the D pole of the MOS tube Q1 is connected with the JP3 connector through the diode D1, the JP3 connector is connected in parallel on both ends of the diode D1, for external connection of the coil of Reed relay K1.
4. The relay fault detection circuit according to claim 1, characterized by The relay feedback module includes JP4 connector, resistance R6 and resistance R7, the JP4 connector is connected with Reed of Reed relay K1, and P0.1 port of the single-chip microcontroller MCU is connected through the resistance R6;The resistance R7 one end is connected with the JP4 connector, and its other end is grounded, to form the voltage division detection circuit of feedback signal.
5. The relay fault detection circuit of claim 1, wherein, The alarm unit includes resistance R9 and alarm LS1, MOS tube Q2 and resistance R8 connected in series, the G pole of the MOS tube is connected with the P0.2 port of the single-chip microcontroller MCU through the resistance R8, the D pole of the MOS tube Q2 is connected with the alarm LS1, and the S pole of the MOS tube Q2 is grounded;The resistance R9 is connected in parallel between the S pole and the G pole of the MOS tube Q2, for static electricity discharge.
6. The relay fault detection circuit of claim 5, wherein, The power supply end of the alarm LS1 is connected with the output end of the power supply unit, and the D pole of the MOS tube Q2 and the alarm LS1 are connected in series to form a drive circuit.
7. The relay fault detection circuit of claim 1, wherein The power supply unit includes JP1 connector, capacitor C1, three-terminal voltage regulator V1, capacitor C2, the capacitor C1 is connected in parallel across the JP1 connector, the three-terminal voltage regulator V1 is connected in parallel across the capacitor C1, the ground terminal of the three-terminal voltage regulator V1 is grounded, the output terminal of the three-terminal voltage regulator V1 is connected to the positive terminal of the capacitor C2, and the negative terminal of the capacitor C2 is grounded.
8. The relay fault detection circuit of claim 7, wherein, The power supply unit further includes a switch SW1, a resistor R3, a capacitor C3 and a light emitting diode LED1, the switch SW1 is connected in series between the output terminal of the three-terminal voltage regulator V1 and the resistor R3, the other terminal of the resistor R3 is connected to the positive terminal of the light emitting diode LED1; one terminal of the capacitor C3 is connected to the series connection node of the resistor R3 and the light emitting diode LED1, and the other terminal of the capacitor C3 is grounded.
9. The relay fault detection circuit of claim 7, wherein, The power supply unit further includes a JP2 connector, the JP2 connector is connected to an external power supply and outputs a power supply matching the working voltage of the reed relay K1, and the relay control module includes a JP3 connector, the JP2 connector is electrically connected to the JP3 connector.
10. The relay fault detection circuit of claim 1, wherein, It also includes a program burning unit, the program burning unit includes a USB communication interface connected to the single-chip microcomputer MCU, the 1 pin of the USB communication interface is electrically connected to the power supply unit, the 1 pin of the USB communication interface is connected in series with a capacitor C4, and the capacitor C4 is grounded; the 2 pin of the USB communication interface is connected in series with a resistor R1, the resistor R1 is connected to the input terminal RXD of the single-chip microcomputer MCU; the 3 pin of the USB communication interface is connected in series with a resistor R2, the resistor R2 is connected to the output terminal TXD of the single-chip microcomputer MCU; and the 4 pin of the USB communication interface is grounded.