A relay circuit
Patent Information
- Application Number
- CN202522135697.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2035-10-09
AI Technical Summary
但相关技术中通常依赖于单一的电气驱动机制,控制逻辑较为简单
1.通过微控制单元生成第一开启信号、第二开启信号和第三开启信号,分别控制低端开关电路、第一继电器K1和第二继电器K2的导通或闭合,抑制因单个开关元件发送开路或短路的故障时,导致继电器无法正常切断电路的缺陷,提高了系统的安全性和可靠性;
Smart Images

Figure CN224759345U_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of relay technology, and in particular to a relay circuit. Background Technology
[0002] Relay circuits are key components for controlling the on / off state of circuits and are widely used in industrial automation, smart homes, power systems, and many other fields. With the rapid development of technology, various electronic devices place higher demands on the stability, reliability, and intelligence of circuit control. The performance of relay circuits directly affects the overall system's operational efficiency. On industrial automated production lines, relay circuits are used to control the start-up, shutdown, and operating status of various mechanical equipment; their stability is crucial to production efficiency and product quality.
[0003] Currently, common relay drive circuits typically use transistors as switching elements. A microcontroller outputs high and low level signals through GPIO ports, which drive the switching element to turn on or off via a current-limiting resistor, thereby controlling the energization and de-energization of the relay coil. However, these technologies usually rely on a single electrical drive mechanism, resulting in relatively simple control logic.
[0004] Regarding the aforementioned technologies, when the switching element of the drive circuit experiences an open circuit or short circuit fault, the relay coil may remain continuously energized or de-energized, resulting in a defect where the relay cannot properly disconnect the circuit. Utility Model Content
[0005] In order to suppress the defect that the relay cannot properly cut off the circuit when the switching element of the drive circuit has an open circuit or short circuit, this application provides a relay circuit.
[0006] This application provides a relay circuit, which adopts the following technical solution: A relay circuit, comprising: Power module; The control module, connected to the power module and the drive module, includes a microcontroller unit, which is used to generate a first power-on signal, a second power-on signal and a third power-on signal respectively. A drive module, used to connect to the power module, the control module, and external devices, includes a first relay K1, a second relay K2, a low-side switching circuit, and a high-side switching circuit. The first terminals of both the first relay K1 and the second relay K2 are connected to the first terminal of the low-side switching circuit. The second terminal of the first relay K1 is connected to the first output terminal of the high-side switching circuit, and the second terminal of the second relay K2 is connected to the second output terminal of the high-side switching circuit. The second terminal of the low-side switching circuit is grounded. The first and second power input terminals of the high-side switching circuit are both connected to the power module. The signal input terminal of the low-side switching circuit is connected to the... The microcontroller unit receives the first enable signal; the first signal input terminal of the high-side switching circuit is connected to the microcontroller unit to receive the second enable signal; the second signal input terminal of the high-side switching circuit is connected to the microcontroller unit to receive the third enable signal; wherein, when the signal input terminal of the low-side switching circuit receives the first enable signal, the low-side switching circuit is turned on; when the low-side switching circuit is turned on and the first signal input terminal of the high-side switching circuit receives the second enable signal, the first relay K1 is closed; when the low-side switching circuit is turned on and the second signal input terminal of the high-side switching circuit receives the third enable signal, the second relay K2 is closed.
[0007] By adopting the above technical solution, the microcontroller generates a first turn-on signal, a second turn-on signal, and a third turn-on signal to control the conduction or closure of the low-end switching circuit, the first relay K1, and the second relay K2, respectively. This suppresses the defect that the relay cannot properly cut off the circuit when a single switching element sends an open circuit or short circuit fault, thereby improving the safety and reliability of the system.
[0008] Optionally, the external device is powered on when both the first relay K1 and the second relay K2 are closed; the external device is powered off when either the first relay K1 or the second relay K2 is closed.
[0009] By adopting the above technical solution, even if one relay cannot disconnect due to its own contact sticking or other faults, another relay can still be controlled normally to complete the power-off operation, thus forming a redundant power-off protection mechanism and suppressing the risk of the circuit not being able to be disconnected due to the failure of a single relay.
[0010] Optionally, the control module (200) further includes a watchdog reset unit (220), wherein the watchdog reset unit (220) includes a fourth chip U4, the fourth chip U4 having a timer; the microcontroller unit (210) is configured to generate a pulse signal, the fourth chip U4 receives the pulse signal to reset the timer; when the microcontroller unit (210) stops generating the pulse signal, the fourth chip U4 does not receive the pulse signal to cause the timer to overflow, the fourth chip U4 generates a reset signal, and the microcontroller unit (210) receives the reset signal and restarts.
[0011] By adopting the above technical solution, when the microcontroller experiences a software fault and stops generating pulse signals, the watchdog reset unit can detect and generate the reset signal in a timely manner, causing the microcontroller to automatically restart, thereby restoring the normal operation of the system and enhancing the system's stability and fault tolerance.
[0012] Optionally, the reset signal is also sent to the input terminal of the high-side switching circuit to turn off the high-side switching circuit.
[0013] By adopting the above technical solution, when the watchdog reset unit generates the reset signal, not only does the microcontroller restart, but the high-side switching circuit is also turned off, thereby ensuring that the relay circuit quickly enters a safe state.
[0014] Optionally, the power module further includes: A power input protection unit is connected to the input terminal of the power module; A step-down voltage regulator unit includes a step-down circuit and a voltage regulator circuit, wherein the input terminal of the step-down circuit is connected to the power input protection unit, and the output terminal of the step-down circuit is connected to the input terminal of the voltage regulator circuit.
[0015] By adopting the above technical solution, a stable and safe power supply environment is provided for the entire relay circuit, ensuring that the control module and drive module can work normally and stably, while extending the service life of the circuit and improving the stability of the overall system.
[0016] Optionally, the power module further includes a power detection unit connected to the power input protection unit and the step-down voltage regulator unit. The power detection unit includes: An overvoltage detection circuit generates an overvoltage signal when it detects that the input voltage is greater than an upper limit threshold. An undervoltage detection circuit generates an undervoltage signal when it detects that the input voltage is less than an upper limit threshold.
[0017] By adopting the above technical solution, the power detection unit can monitor the status of the input voltage in real time. When the input voltage exceeds the upper limit threshold or falls below the lower limit threshold, it generates an overvoltage signal or an undervoltage signal respectively, so that the system can cut off the circuit in time and reduce the risk of equipment damage caused by abnormal voltage.
[0018] Optionally, the control module further includes a reset start unit connected to the power module and the microcontroller unit, used to generate a manual reset signal or an automatic reset signal.
[0019] By adopting the above technical solution, the reset and start-up unit provides manual reset and automatic reset functions, allowing users to restart the microcontroller unit by manual operation or automatic system triggering of a reset signal when the system is abnormal, thereby quickly restoring system functions and enhancing the maintainability and operational flexibility of the system.
[0020] Optionally, the control module further includes a function selection unit for connecting to external devices, the power module, and the microcontroller unit. The function selection unit includes a function selection line for receiving external connection status signals.
[0021] By adopting the above technical solution, the function selection unit can automatically switch the working mode of the relay circuit according to the connection status signal of the external device, so that the system can adapt to different application scenarios and external device requirements.
[0022] Optionally, the control module further includes a signal source unit for connecting to external devices, the power module, and the microcontroller unit, wherein the signal source unit is used to output power voltage to external devices.
[0023] By adopting the above technical solution, the signal source unit can provide a stable power voltage output to external devices, thereby enhancing the integration and functionality of the relay circuit.
[0024] Optionally, the control module further includes an input detection unit for connecting to external devices and the microcontroller unit, wherein the input detection unit is used to receive external input signals to determine the signal type of the external device.
[0025] By adopting the above technical solution, the input detection unit can identify the signal type of external devices and process it accordingly, enabling the system to respond correctly to external inputs and improving the compatibility between the system and external devices.
[0026] In summary, this application includes at least one of the following beneficial technical effects: 1. By generating a first turn-on signal, a second turn-on signal, and a third turn-on signal through a microcontroller unit, the system controls the conduction or closure of the low-end switching circuit, the first relay K1, and the second relay K2, respectively. This suppresses the defect that the relays cannot properly cut off the circuit when a single switching element sends an open circuit or short circuit fault, thereby improving the safety and reliability of the system. 2. Even if one relay fails to disconnect due to its own contact sticking or other faults, another relay can still be controlled normally to complete the power-off operation, thus forming a redundant power-off protection mechanism and suppressing the risk of the circuit failing to disconnect due to a single relay failure. 3. When the microcontroller experiences a software fault and stops generating pulse signals, the watchdog reset unit can detect and generate a reset signal in a timely manner, causing the microcontroller to automatically restart, thereby restoring the normal operation of the system and enhancing the system's stability and fault tolerance. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of the relay circuit of Embodiment 1 of this application.
[0028] Figure 2 yes Figure 1 A schematic diagram of the power supply module.
[0029] Figure 3 yes Figure 1 Circuit schematic of the power supply module.
[0030] Figure 4 yes Figure 1 A schematic diagram of the control module.
[0031] Figure 5 yes Figure 4 The circuit schematic of the control module.
[0032] Figure 6 yes Figure 1 A schematic diagram of the drive module.
[0033] Figure 7 yes Figure 6 The circuit schematic of the drive module.
[0034] Figure 8 This is a schematic diagram of the control module in Embodiment 2 of this application.
[0035] Figure 9 yes Figure 8 The circuit diagram of the reset and start-up unit in the middle.
[0036] Figure 10 This is a schematic diagram of the control module in Embodiment 3 of this application.
[0037] Figure 11 yes Figure 10 The circuit diagram of the functional control unit in the middle.
[0038] Figure 12 This is a schematic diagram of the control module in Embodiment 4 of this application.
[0039] Figure 13 yes Figure 12 The circuit schematic of the signal source unit in the diagram.
[0040] Figure 14 yes Figure 12 The circuit schematic of the input detection unit in the diagram.
[0041] Explanation of reference numerals in the attached figures: 100, Power module; 110, Power input protection unit; 120, Buck voltage regulator unit; 121, Buck circuit; 122, Voltage regulator circuit; 130, Power detection unit; 131, Overvoltage detection circuit; 132, Undervoltage detection circuit; 200, Control module; 210, Microcontroller unit; 220, Watchdog reset unit; 230, Reset start unit; 240, Function selection unit; 250, Signal source unit; 251, First signal source circuit; 252, Second signal source circuit; 260, Input detection unit; 261, First input detection circuit; 262, Second input detection circuit; 300, Driver module; 310, Low-side switching circuit; 320, High-side switching circuit. Detailed Implementation
[0042] The following is in conjunction with the appendix Figure 1-14 This application will be described in further detail.
[0043] This application discloses a relay circuit.
[0044] Example 1 Reference Figure 1 The relay circuit includes a power supply module 100, a control module 200, and a drive module 300. The power supply module 100 is connected to both the control module 200 and the drive module 300, providing them with a stable power source. The control module 200 is also connected to the drive module 300, sending control signals to it. The drive module 300 then drives the relay contacts to operate according to the received control signals.
[0045] Reference Figure 2 and Figure 3The power module 100 includes a power input protection unit 110, a step-down voltage regulator unit 120, and a power detection unit 130. The power input protection unit 110 includes a third capacitor C3, a fifth capacitor C5, an eighth capacitor C8, a first fuse F1, a second diode D2, a seventeenth diode D17, and a second resistor C2. The first fuse F1 can be a ceramic fuse, which can melt in time when the circuit current is too high, providing overcurrent protection and preventing circuit damage due to abnormal current. The first fuse F1 can also be replaced by a resettable fuse, which can automatically resume conduction after the fault is cleared. The seventeenth diode D17 can be a transient diode used to absorb surge interference. The second diode D2 can be a common rectifier diode used to prevent incorrect connection of the power supply polarity, providing reverse connection protection. The second resistor R2, the third capacitor C3, and the fifth capacitor C5 form an RC filter circuit, which can filter out high-frequency noise and interference in the input voltage.
[0046] Reference Figure 3 The step-down and voltage-regulating unit 120 includes a step-down circuit 121 and a voltage-regulating circuit 122. The step-down circuit 121 includes a first chip U1, a fourth inductor L4, a fourteenth resistor R14, a twentieth resistor R20, a first capacitor C1, a fourth capacitor C4, and a tenth capacitor C10. The voltage-regulating circuit 122 includes a second chip U2, a sixth capacitor C6, and a fourteenth capacitor C14. The first chip U1 can be a switching power supply chip or a linear regulator chip. The second chip U2 can be a low-dropout linear regulator. The step-down circuit 121 first reduces the input voltage, and the voltage-regulating circuit 122 then stabilizes the stepped-down voltage to ensure a stable operating power supply for the relay circuit.
[0047] Reference Figure 3 The power detection unit 130 includes an overvoltage detection circuit 131 and an undervoltage detection circuit 132. The overvoltage detection circuit 131 includes a tenth transistor Q10, a twentieth diode D20, a fifty-third resistor R53, a fifty-fourth resistor R54, a fifty-fifth resistor R55, and an eleventh capacitor C11. The undervoltage detection circuit 132 includes a ninth transistor Q9, a sixth diode D6, a forty-fourth resistor R44, a fiftieth resistor R50, a fifty-second resistor R52, and a sixteenth capacitor C16. When the overvoltage detection circuit 131 detects that the input voltage is greater than the upper limit threshold (e.g., 30V), the overvoltage detection circuit 131 generates an overvoltage signal and sends the overvoltage detection signal to the microcontroller unit 210. When the undervoltage detection circuit 132 detects that the input voltage is less than the lower limit threshold (e.g., 20V), the undervoltage detection circuit 132 generates an undervoltage signal and sends the undervoltage detection signal to the microcontroller unit 210.
[0048] Reference Figure 4 and Figure 5 The control module 200 includes a microcontroller unit 210 and a watchdog reset unit 220. The microcontroller unit 210 includes a third chip U3, a fourth resistor R4, a first resistor R1, a twenty-fourth capacitor C24, a twenty-fifth capacitor C25, and a connector J3. The third chip U3 can be a microcontroller. The third chip U3 generates a first enable signal, a second enable signal, and a third enable signal and sends them to the driver module 300. The third chip U3 is also connected to an external debugging device via connector J3 to perform data exchange and signal transmission operations. The watchdog reset circuit includes a fourth chip U4, a sixty-second resistor R62, a sixty-fifth resistor R65, a sixty-sixth resistor R66, a nineteenth capacitor C19, a thirty-first capacitor C31, and a nineteenth transistor Q19.
[0049] The third chip U3 is configured to generate pulse signals, and the fourth chip U4 receives the pulse signals and resets its internal timer. When the third chip U3 stops generating pulse signals, the internal timer of the fourth chip U4 overflows, the fourth chip U4 generates a reset signal, and the third chip U3 receives the reset signal and restarts. The reset signal is also sent to the input of the high-side switching circuit 320 to disconnect it. The microcontroller unit 210 is also programmed to periodically execute a self-test program. For example, when the first relay K1 and the second relay K2 should be disconnected, the microcontroller unit 210 conducts the high-side switching circuit 320 and monitors the current or voltage at the low-side switching circuit 310. If an abnormality is detected, it determines that the low-side switching circuit 310 has an open-circuit or short-circuit fault. The microcontroller unit 210 also conducts the low-side switching circuit 310 and monitors the current or voltage at the high-side switching circuit 320. If an abnormality is detected, it determines that the high-side switching circuit 320 has an open-circuit or short-circuit fault.
[0050] Reference Figure 6 and Figure 7The drive module 300 has the first terminal of the first relay K1 and the first terminal of the second relay K2 connected to the first terminal of the low-end switching circuit 310. The second terminal of the first relay K1 is connected to the first output terminal of the high-end switching circuit 320. The second terminal of the second relay K2 is connected to the second output terminal of the high-end switching circuit 320. The second terminal of the low-end switching circuit 310 is grounded. The first power input terminal and the second power input terminal of the high-end switching circuit 320 are connected to the power module 100. The signal input terminal of the low-end switching circuit 310 is connected to the microcontroller unit 210 to receive the first turn-on signal. The first signal input terminal of the high-end switching circuit 320 is connected to the microcontroller unit 210 to receive the second turn-on signal. The second signal input terminal of the high-end switching circuit 320 is connected to the microcontroller unit 210 to receive the third turn-on signal. The low-side switching circuit 310 includes a second capacitor C2, a twenty-seventh resistor R27, a thirty-second resistor R32, and a fourteenth transistor Q14. The high-side switching circuit 320 includes a sixth transistor Q6, a seventh transistor Q7, an eighth transistor Q8, a thirteenth transistor Q13, a twenty-first transistor Q21, a twenty-second transistor Q22, a thirteenth resistor R13, a twenty-third resistor R23, a twenty-eighth resistor R28, a twenty-ninth resistor R29, a thirtieth resistor R30, a thirty-first resistor R31, a fifty-sixth resistor R56, a fifty-seventh resistor R57, a fifty-eighth resistor R58, a fifty-ninth resistor R59, a sixtieth resistor R60, a sixty-first resistor R61, a twelfth capacitor C12, a thirteenth capacitor C13, a seventeenth capacitor C17, and a thirtieth capacitor C30.
[0051] In this circuit, the collector of the fourteenth transistor Q14 is connected to the first terminal of the first relay K1, and the collector of the fourteenth transistor Q14 is also connected to the first terminal of the second relay K2. The base of the fourteenth transistor Q14 is the signal input terminal of the low-side switching circuit 310, and the emitter of the fourteenth transistor Q14 is grounded. The base of the sixth transistor Q6 is connected to the collector of the seventh transistor Q7, the emitter of the sixth transistor Q6 is connected to the power module 100, and the collector of the sixth transistor Q6 is connected to the second terminal of the first relay K1. The collector of the sixth transistor Q6 is the first output terminal of the high-side switching circuit 320. The base of the eighth transistor Q8 is connected to the collector of the thirteenth transistor Q13, the emitter of the eighth transistor Q8 is connected to the power module 100, and the collector of the eighth transistor Q8 is connected to the second terminal of the second relay K2. The collector of the eighth transistor Q8 is the second output terminal of the high-side switching circuit 320. The emitter of the seventh transistor Q7 and the emitter of the thirteenth transistor Q13 are grounded. The base of the seventh transistor Q7 is the first signal input terminal of the high-side switching circuit 320, and the base of the thirteenth transistor Q13 is the second signal input terminal of the high-side switching circuit 320.
[0052] When the signal input terminal of the low-end switching circuit 310 receives a first turn-on signal, and the first signal input terminal of the high-end switching circuit 320 receives a second turn-on signal and the second signal input terminal of the high-end switching circuit 320 receives a third turn-on signal, both the low-end switching circuit 310 and the high-end switching circuit 320 are turned on. The coils of the first relay K1 and the second relay K2 are energized and generate a magnetic field, which drives the contacts of the first relay K1 and the relay K2 to perform a closing action. When one of the low-end switching circuit 310 and the high-end switching circuit 320 is turned off, the coils of the first relay K1 and the second relay K2 are de-energized, and the contacts of the first relay K1 and the second relay K2 perform an opening action.
[0053] The implementation principle of Example 1 is as follows: The power supply module 100 provides a stable power supply to the control module 200, and simultaneously detects and protects the input voltage to prevent abnormal voltage from damaging the circuit. The control module 200 generates corresponding control signals based on the received power detection signal and external signals, and sends them to the drive module 300. The drive module 300 controls the relay contacts to operate according to the control signals, thereby controlling the circuit's on / off state. The watchdog reset unit 220 can reset in a timely manner in the event of a software crash, ensuring reliable circuit operation.
[0054] Example 2 Reference Figure 8 and Figure 9 The difference between this embodiment and embodiment 1 is that the control module 200 of the relay circuit also includes a reset start unit 230.
[0055] The reset start unit 230 is connected to the manual reset button and the power supply. The reset start circuit includes a first transistor Q1, a tenth resistor R10, an eleventh resistor R11, a twelfth resistor R12, and a fifteenth capacitor C15. When the power supply is on, the reset start circuit generates an automatic reset signal and sends it to the microcontroller unit 210. The third chip U3 receives the automatic reset signal and performs a reset action. When the manual reset button is triggered, the reset start circuit also generates a manual reset signal and sends it to the microcontroller unit 210. The third chip U3 receives the manual reset signal and performs a reset action.
[0056] The implementation principle of Example 2 is as follows: A reset start-up unit 230 is added, providing both manual and automatic reset methods. Manual reset allows for manual operation to restore the circuit when needed; automatic reset automatically resets the circuit upon power-up or in the event of an abnormality, without manual intervention. This improves the circuit's ability to resume normal operation in emergency situations and enhances the reliability and stability of the equipment.
[0057] Example 3 Reference Figure 10 and Figure 11 The difference between this embodiment and embodiment 2 is that the control module 200 of the relay circuit also includes a function selection unit 240.
[0058] Reference Figure 11 The function selection unit 240 includes a fifth fuse F5, a twenty-third diode D23, a twenty-fourth diode D24, a twenty-fifth diode D25, a twenty-fourth transistor Q24, a twenty-fifth transistor Q25, a twenty-seventh capacitor C27, a twenty-eighth capacitor C28, a twenty-ninth capacitor C29, a twenty-fourth resistor R24, a thirty-third resistor R33, a thirty-fourth resistor R34, a fortieth resistor R40, and a forty-sixth resistor R46. The function selection unit 240 has a function selection line at its input terminal.
[0059] When the function selection line is floating, both the 24th transistor Q24 and the 25th transistor Q25 are turned on, the first output of the function selection unit 240 is high, and the second output of the function selection unit 240 is also high. The microcontroller unit 210 determines that the function selection line is floating and automatically activates the grating detection function. When the function selection line is connected to the negative terminal of the external power supply, the 25th transistor Q25 is turned on, and the 24th transistor Q24 is turned off. The first output of the function selection unit 240 is high, and the second output of the function selection unit 240 is low. The microcontroller unit 210 determines that the function selection line is connected to the start / stop switch and switches to the start / stop switch detection logic. When the function selection line is connected to the positive terminal of the external power supply, the 24th transistor Q24 is turned on, and the 25th transistor Q25 is turned off. The first output of the function selection unit 240 is low, and the second output of the selectable module is high. The microcontroller unit 210 determines that the function selection line is connected to the two-hand switch and switches to the detection logic.
[0060] The implementation principle of Example 3 is as follows: the function selection unit 240 can flexibly switch the detection logic of the control microcontroller unit 210 according to the external function selection line signal, so that the circuit can be adapted to different types of external devices, thereby improving the applicability and compatibility of the circuit.
[0061] Example 4 Reference Figures 12 to 14 The difference between this embodiment and embodiment 3 is that the control module 200 of the relay circuit also includes a signal source unit 250 and an input detection unit 260.
[0062] Reference Figure 13 The signal source unit 250 includes a first signal source circuit 251 and a second signal source circuit 252. The first signal source circuit 251 includes a third fuse F3, a first diode D1, a seventh diode D7, a second transistor Q2, an eleventh transistor Q11, a twelfth transistor Q12, a third resistor R3, an eighth resistor R8, a fifteenth resistor R15, a sixteenth resistor R16, a seventeenth resistor R17, an eighteenth resistor R18, and a forty-ninth resistor R49. The first signal source circuit 251 receives a control signal from the microcontroller unit 210 via the eleventh transistor Q11, thereby driving the second transistor Q2 to turn on or off. When the second transistor Q2 is on, the power supply voltage is output to an external device via the fiftieth resistor R15 and the seventh diode D17.
[0063] The second signal source circuit 252 includes a second fuse F2, an eighth diode D8, an eighteenth diode D18, a third transistor Q3, a fourth transistor Q4, a fifth transistor Q5, a nineteenth resistor R19, a twenty-first resistor R21, a twenty-second resistor R22, a twenty-fifth resistor R25, a twenty-sixth resistor R26, a fifty-first resistor R51, and a thirty-eighth resistor R38. The second signal source circuit 252 receives a control signal from the microcontroller unit 210 via the fourth transistor Q4, thereby driving the third transistor Q3 to turn on or off. When the third transistor Q3 is on, the power supply voltage is output to the external device via the twenty-second resistor R22 and the eighth diode D8.
[0064] Reference Figure 14 The input detection unit 260 includes a first input detection circuit 261 and a second input detection circuit 262. The first input detection circuit 261 includes a fourth fuse F4, an eleventh diode D11, a twelfth diode D12, a thirteenth diode D13, a seventh capacitor C7, a twenty-second capacitor C22, a twenty-sixth capacitor C26, a thirty-fifth resistor R35, a thirty-sixth resistor R36, a thirty-seventh resistor R37, a thirty-ninth resistor R39, a forty-seventh resistor R47, a fifteenth transistor Q15, and a sixteenth transistor Q16. When an external device (such as an NPN type grating) sends a low-level input signal to the input terminal of the first input detection circuit 261, the sixteenth transistor Q16 is turned on, the first output terminal of the first input detection circuit 261 is low, and the second output terminal of the first input detection circuit 261 is high. When an external device (such as a PNP type grating, start / stop switch, or two-hand switch) sends a high-level input signal to the input terminal of the first input detection circuit 261, the fifteenth transistor Q15 is turned on, the first output terminal of the first input detection circuit 261 is at a high level, and the second output terminal of the first input detection circuit 261 is at a low level. When the first output terminal is at a low level, the microcontroller unit 210 detects that the external input signal is an NPN type signal; when the second output terminal is at a low level, the microcontroller unit 210 detects that the external input signal is a PNP type signal.
[0065] The second input detection circuit 262 includes a sixth fuse F6, a fourteenth diode D14, a fifteenth diode D15, a sixteenth diode D16, a ninth capacitor C9, a twentieth capacitor C20, a twenty-first capacitor C21, a forty-first resistor R41, a forty-second resistor R42, a forty-third resistor R43, a forty-fifth resistor R45, a forty-eighth resistor R48, a seventeenth transistor Q17, and an eighteenth transistor Q18. When an external device sends a low-level input signal to the input terminal of the second input detection circuit 262, the eighteenth transistor Q18 is turned on, the first output terminal of the second input detection circuit 262 is low, and the second output terminal of the second input detection circuit 262 is high. When an external device sends a high-level input signal to the input terminal of the second input detection circuit 262, the seventeenth transistor Q17 is turned on, the first output terminal of the second input detection circuit 262 is high, and the second output terminal of the second input detection circuit 262 is low. When the second output terminal of the second input detection circuit 262 is low, the microcontroller unit 210 detects that the external input signal is an NPN type signal; when the second output terminal of the second input detection circuit 262 is low, the microcontroller unit 210 detects that the external input signal is a PNP type signal.
[0066] The implementation principle of Example 4 is as follows: The signal source unit 250 can provide a suitable signal source for external devices to meet the needs of different devices. The input detection unit 260 can accurately identify the type of external input signal, enabling the microcontroller unit 210 to better interact and control external devices, further improving the compatibility and adaptability of the circuit and perfecting the circuit's function.
[0067] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A relay circuit, characterized in that, include: Power module (100); The control module (200), connected to the power module (100) and the drive module (300), includes a microcontroller unit (210), which is used to generate a first turn-on signal, a second turn-on signal and a third turn-on signal respectively; A drive module (300) is used to connect to the power module (100), the control module (200), and external devices. It includes a first relay K1, a second relay K2, a low-side switching circuit (310), and a high-side switching circuit (320). The first terminal of the first relay K1 and the first terminal of the second relay K2 are both connected to the first terminal of the low-side switching circuit (310). The second terminal of the first relay K1 is connected to the first output terminal of the high-side switching circuit (320), and the second terminal of the second relay K2 is connected to the second output terminal of the high-side switching circuit (320). The second terminal of the low-side switching circuit (310) is grounded. The first power input terminal and the second power input terminal of the high-side switching circuit (320) are both connected to… Connected to the power module (100), the signal input terminal of the low-end switching circuit (310) is connected to the microcontroller unit (210) to receive the first turn-on signal, the first signal input terminal of the high-end switching circuit (320) is connected to the microcontroller unit (210) to receive the second turn-on signal, and the second signal input terminal of the high-end switching circuit (320) is connected to the microcontroller unit (210) to receive the third turn-on signal; wherein, when the signal input terminal of the low-end switching circuit (310) receives the first turn-on signal, the low-end switching circuit (310) is turned on; when the low-end switching circuit (310) is turned on and the first signal input terminal of the high-end switching circuit (320) receives the second turn-on signal, the first relay K1 is closed; When the low-end switching circuit (310) is turned on, and when the second signal input terminal of the high-end switching circuit (320) receives the third turn-on signal, the second relay K2 is closed.
2. The relay circuit according to claim 1, characterized in that, When both the first relay K1 and the second relay K2 are closed, the external device is powered on; when either the first relay K1 or the second relay K2 is closed, the external device is powered off.
3. The relay circuit according to claim 1, characterized in that, The control module (200) further includes a watchdog reset unit (220), wherein the watchdog reset unit (220) includes a fourth chip U4, the fourth chip U4 having a timer; the microcontroller unit (210) is configured to generate a pulse signal, the fourth chip U4 receives the pulse signal to reset the timer; when the microcontroller unit (210) stops generating the pulse signal, the fourth chip U4 does not receive the pulse signal to cause the timer to overflow, the fourth chip U4 generates a reset signal, the microcontroller unit (210) receives the reset signal and restarts.
4. The relay circuit according to claim 3, characterized in that, The reset signal is also sent to the input of the high-side switching circuit (320) to turn off the high-side switching circuit (320).
5. The relay circuit according to claim 1, characterized in that, The power module also includes: A power input protection unit (110) is connected to the input terminal of the power module (100); The step-down voltage regulator unit (120) includes a step-down circuit (121) and a voltage regulator circuit (122), wherein the input terminal of the step-down circuit (121) is connected to the power input protection unit (110), and the output terminal of the step-down circuit (121) is connected to the input terminal of the voltage regulator circuit (122).
6. The relay circuit according to claim 5, characterized in that, It also includes a power detection unit (130), connected to the power input protection unit (110) and the step-down voltage regulator unit (120), the power detection unit (130) comprising: The overvoltage detection circuit (131) generates an overvoltage signal when it detects that the input voltage is greater than the upper limit threshold. The undervoltage detection circuit (132) generates an undervoltage signal when it detects that the input voltage is less than the upper limit threshold.
7. The relay circuit according to claim 1, characterized in that, The control module (200) also includes a reset start unit (230), which is connected to the power module (100) and the microcontroller unit (210) and is used to generate a manual reset signal or an automatic reset signal.
8. The relay circuit according to claim 1, characterized in that, It also includes a function selection unit (240) for connecting to external devices, the power module (100) and the microcontroller unit (210), the function selection unit (240) including a function selection line for receiving external connection status signals.
9. The relay circuit according to claim 1, characterized in that, It also includes a signal source unit (250) for connecting to external devices, the power module (100) and the microcontroller unit (210), the signal source unit (250) for outputting power voltage to external devices.
10. The relay circuit according to claim 1, characterized in that, It also includes an input detection unit (260) for connecting to an external device and the microcontroller unit (210), the input detection unit (260) for receiving external input signals to determine the signal type of the external device.