Photoelectric switch power supply protection circuit

By using an optoelectronic switching power supply protection circuit, the LM393 comparator and transistor interlock structure are used to achieve real-time detection and seamless power supply path switching of the power system. This solves the shortcomings of existing power protection circuits in terms of integration, intelligence and response speed, and improves the reliability and adaptability of the power system.

CN121813650APending Publication Date: 2026-04-07INNER MONGOLIA NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511652664.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing power protection circuits still need improvement in terms of integration, intelligence, and response speed to transient voltages, and are also insufficient in multi-function integration such as multi-path power supply switching and fan control.

Method used

The photoelectric switching power supply protection circuit is composed of a voltage detection module, a temperature detection module, a power switching module, a heat dissipation module, a main power supply path, a backup power supply path, a transient voltage suppression diode (TVS), and an STM32 microcontroller. It achieves real-time detection and seamless power supply path switching through an LM393 comparator and a transistor interlock structure, combined with software redundancy protection of the microcontroller.

Benefits of technology

It achieves high sensitivity, fast response and intelligent control of the power supply system, reduces circuit complexity and power consumption, improves the reliability and adaptability of the power supply system, and extends the service life of the fan and power module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121813650A_ABST
    Figure CN121813650A_ABST
Patent Text Reader

Abstract

The invention provides a protection circuit for a switching power supply of a photoelectric device. The protection circuit comprises a voltage detection module, a temperature detection module, a fan control module, a TVS diode, a voltage comparator LM393, a power supply path module and a path switching module, voltage and temperature signals are detected and then input into the LM393, and after comparison with reference voltage, control signals are output to the path switching module, so that main / standby power supply path switching is realized; a temperature signal is output to the fan control module to be automatically turned on and turned off, the TVS suppresses transient voltage, and the stability and safety of the system are improved. According to the invention, efficient power path switching and overvoltage and overheating protection can be realized, and the stability and reliability of a power system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power management technology, and more specifically, to a photoelectric switching power supply protection circuit. Background Technology

[0002] Existing power protection circuits typically include basic functions such as voltage detection, temperature monitoring, and overvoltage protection to ensure the stability and safety of the power system. These circuits monitor power supply voltage and temperature, and when abnormal conditions are detected, they control switching elements to switch the power supply path or trigger protection mechanisms to prevent equipment damage. However, with the increasing complexity and integration of electronic devices, the requirements for power protection circuits are also becoming more stringent. They not only require higher sensitivity and response speed but also more intelligent control strategies to adapt to different operating conditions.

[0003] Traditional power protection circuits often employ simple analog comparators and discrete components to achieve protection functions. This not only results in complex and bulky circuits but also makes precise control and flexible configuration difficult. Furthermore, these circuits suffer from slow response times and unsatisfactory protection effects when handling transient voltage spikes. With the development of microcontrollers and digital signal processing technologies, more and more power protection circuits are adopting digital and intelligent design methods to improve system reliability and adaptability.

[0004] In implementing the embodiments of the present invention, the prior art has at least the following problems or defects: the existing power protection circuit still needs to be improved in terms of integration, intelligence level and response speed to transient voltage, and it also has shortcomings in multi-function integration such as multi-path power supply switching and fan control. Summary of the Invention

[0005] This application provides a photoelectric switching power supply protection circuit, including: Voltage detection module, temperature detection module, power switching module, heat dissipation module, main power supply path, backup power supply path, transient voltage suppressor diode (TVS), microcontroller (STM32); The input terminal of the voltage detection module is connected to the power supply, and the output terminal is connected to the first non-inverting input terminal of the voltage comparator LM393. The input terminal of the temperature detection module is connected to the power supply, and the output terminal is connected to the second non-inverting input terminal of the voltage comparator LM393. Both the first and second inverting inputs of the voltage comparator LM393 are connected to the reference power supply. The input terminal of the power switching module is connected to the first and second output terminals of the voltage comparator LM393. The first output terminal of the power switching module is connected to the control terminal of the main power supply path, and the second output terminal of the power switching module is connected to the control terminal of the backup power supply path. The input terminals of both the main power supply path and the backup power supply path are connected to the power supply, and the output terminals of both the main power supply path and the backup power supply path are connected to the subsequent circuit. The input terminal of the heat dissipation module is connected to the first output terminal of the voltage comparator LM393, and the output terminal of the heat dissipation module is connected to the fan. The negative terminal of the transient voltage suppressor diode (TVS) is connected to the power supply, and the positive terminal of the TVS is grounded. The STM32 microcontroller's ADC1 pin is connected to the power supply through the first voltage divider network, the ADC2 pin is connected to the power supply through the second voltage divider network, the P1 pin is connected to the controlled terminal of the power switching module, and the P2 pin is connected to the controlled terminal of the backup power supply path.

[0006] Furthermore, the voltage detection module includes resistors R8 and R9. One end of resistor R8 is connected to the power supply, and the other end of resistor R8 is connected to one end of resistor R9 to form the output terminal of the voltage detection module. The other end of resistor R9 is grounded.

[0007] Furthermore, the temperature detection module includes a negative temperature coefficient thermistor (NTC) and a resistor (R7). One end of the NTC is connected to the power supply, and the other end of the NTC is connected to one end of the resistor (R7) to form the output terminal of the temperature detection module. The other end of the resistor (R7) is grounded.

[0008] Furthermore, the power switching module includes transistor Q5, transistor Q6, resistors R4, R3, R1, and R2; The base of transistor Q5 is connected to the first output terminal of voltage comparator LM393, the collector of transistor Q5 is connected to one end of resistor R4 and the gate of MOSFET Q3 in the main power supply path, and the emitter of transistor Q5 is grounded. The other end of resistor R4 is connected to the power supply; The base of transistor Q6 is connected to the second output terminal of voltage comparator LM393, the collector of transistor Q6 is connected to one end of resistor R3 and the gate of MOSFET Q4 in the backup power supply path, and the emitter of transistor Q6 is grounded. The other end of resistor R3 is connected to the power supply; One end of resistor R1 is connected to the gate of MOSFET Q3, and the other end of resistor R1 is connected to the power supply. One end of resistor R2 is connected to the gate of MOSFET Q4, and the other end of resistor R2 is connected to the power supply.

[0009] Furthermore, the main power supply path includes MOSFET Q3, resistor R1, and resistor R3. The source of MOSFET Q3 is connected to the power supply, the drain of MOSFET Q3 is connected to the subsequent circuit, one end of resistor R1 is connected to the gate of MOSFET Q3, the other end of resistor R1 is connected to one end of resistor R3, and the other end of resistor R3 is connected to the power supply.

[0010] Furthermore, the backup power supply path includes MOSFET Q4, diode D3, diode D4, diode D5, resistor R2, and resistor R4; The source of MOSFET Q4 is connected to the power supply, and the drain of MOSFET Q4 is connected to the anodes of diodes D3, D4, and D5. The cathodes of diodes D3, D4, and D5 together form the output terminal of the backup power supply path. One end of resistor R2 is connected to the gate of MOSFET Q4, and the other end of resistor R2 is connected to the power supply. One end of resistor R4 is connected to the gate of MOSFET Q4, and the other end of resistor R4 is connected to the output of the power switching module.

[0011] Furthermore, the heat dissipation module includes an NMOS transistor Q7, a resistor R12, a resettable fuse PTC, a Zener diode D8, and a fan; One end of resistor R12 is connected to the first output terminal of voltage comparator LM393, and the other end of resistor R12 is connected to the gate of NMOS transistor Q7. The source of NMOS transistor Q7 is connected to the negative terminal of the fan and the positive terminal of Zener diode D8, and the drain of NMOS transistor Q7 is grounded. The negative terminal of the Zener diode D8 is connected to the negative terminal of the fan; One end of the resettable PTC fuse is connected to the power supply, and the other end of the resettable PTC fuse is connected to the positive terminal of the fan.

[0012] Furthermore, the first voltage divider network includes resistors RB1 and RB2. One end of resistor RB1 is connected to the power supply, and the other end of resistor RB1 is connected to one end of resistor RB2 and together connected to the ADC1 pin of the microcontroller STM32. The other end of resistor RB2 is grounded.

[0013] Furthermore, the second voltage divider network includes resistors RB3 and RB4. One end of resistor RB3 is connected to the power supply, and the other end of resistor RB3 is connected to one end of resistor RB4 and together connected to the ADC2 pin of the STM32 microcontroller. The other end of resistor RB4 is grounded. The STM32 microcontroller outputs a control signal from pin P1 to control the on / off state of MOSFET Q3, and outputs a control signal from pin P2 to control the on / off state of MOSFET Q4.

[0014] Furthermore, the positive power supply pin of the voltage comparator LM393 is connected to the power supply, and the negative power supply pin of the voltage comparator LM393 is grounded.

[0015] The beneficial effects of the various embodiments of the present invention are as follows: 1. The voltage detection module and temperature detection module work synchronously, and are compared in real time through the LM393 comparator. Once the voltage or temperature exceeds the limit, the output will immediately switch. The hardware-level response can complete the detection and trigger the protection in the early stage of the fault, which significantly reduces the risk of damage to the downstream circuit due to overvoltage or overheating and improves the long-term reliability of the power supply system.

[0016] 2. The power switching module adopts a transistor interlock structure to ensure that the main power supply path and the backup power supply path will never be turned on at the same time. The switching action is directly driven by the comparator output without software intervention, realizing a seamless connection between shutdown and turn-on, avoiding load reset or data loss due to power interruption, and ensuring power continuity.

[0017] 3. The heat dissipation module uses the comparator output as the control source, and the fan starts immediately when the temperature exceeds the limit; the resettable fuse automatically limits the current when the current is abnormal and resets itself after the fault is cleared, eliminating the maintenance work of replacing the fuse; the Zener diode suppresses the turn-off spike; the whole heat dissipation solution has zero software dependence and zero maintenance, significantly extending the service life of the fan and power module.

[0018] 4. The microcontroller monitors the power supply voltage only through a high-impedance voltage divider network and does not interfere with the power supply path under normal conditions. Only when a continuous voltage abnormality is detected will the corresponding path be forcibly shut down through hardware lines and logic, forming a software redundancy lock-up. This architecture retains the advantages of fast hardware switching and provides programmable secondary protection, balancing speed, safety and flexibility.

[0019] 5. The comparator is directly powered by the power supply, and the open-drain output can drive the subsequent modules through a single pull-up resistor. The circuit is simple and the number of components is small. Compared with the traditional multi-stage operational amplifier solution, the BOM cost and PCB area are significantly reduced, and the overall power consumption is reduced. It is suitable for photoelectric switch applications that are sensitive to cost, size and power consumption. Attached Figure Description

[0020] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein: Figure 1 This is a schematic diagram of the structure of a photoelectric switching power supply protection circuit provided in an embodiment of the present invention. Detailed Implementation

[0021] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make the invention more thorough and complete, and to fully convey the scope of the invention to those skilled in the art.

[0022] Those skilled in the art will understand that embodiments of the present invention can be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present invention can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0023] It should be noted that the number of any elements in the accompanying drawings is for illustrative purposes only and not as a limitation, and any naming is for distinction only and has no limiting meaning.

[0024] The following is for reference. Figure 1 , Figure 1 This is a schematic diagram of the structure of a photoelectric switching power supply protection circuit provided in an embodiment of the present invention. Figure 1 As shown, a photoelectric switching power supply protection circuit includes: Voltage detection module, temperature detection module, power switching module, heat dissipation module, main power supply path, backup power supply path, transient voltage suppressor diode (TVS), microcontroller (STM32); The input terminal of the voltage detection module is connected to the power supply, and the output terminal is connected to the first non-inverting input terminal of the voltage comparator LM393. The input terminal of the temperature detection module is connected to the power supply, and the output terminal is connected to the second non-inverting input terminal of the voltage comparator LM393. Both the first and second inverting inputs of the voltage comparator LM393 are connected to the reference power supply. The input terminal of the power switching module is connected to the first and second output terminals of the voltage comparator LM393. The first output terminal of the power switching module is connected to the control terminal of the main power supply path, and the second output terminal of the power switching module is connected to the control terminal of the backup power supply path. The input terminals of both the main power supply path and the backup power supply path are connected to the power supply, and the output terminals of both the main power supply path and the backup power supply path are connected to the subsequent circuit. The input terminal of the heat dissipation module is connected to the first output terminal of the voltage comparator LM393, and the output terminal of the heat dissipation module is connected to the fan. The negative terminal of the transient voltage suppressor diode (TVS) is connected to the power supply, and the positive terminal of the TVS is grounded. The STM32 microcontroller's ADC1 pin is connected to the power supply through the first voltage divider network, the ADC2 pin is connected to the power supply through the second voltage divider network, the P1 pin is connected to the controlled terminal of the power switching module, and the P2 pin is connected to the controlled terminal of the backup power supply path.

[0025] The voltage detection module acquires the power supply voltage in real time: resistors R8 and R9 are connected in series between the power supply and ground. The common node of R8 and R9 serves as the voltage sampling point, which is directly fed into the first non-inverting input of the voltage comparator LM393. When the power supply voltage rises to the point where the sampling point voltage is higher than the reference power supply voltage, the first output of LM393 immediately flips, outputting a high-level signal.

[0026] The temperature detection module acquires temperature in real time: a negative temperature coefficient thermistor (NTC) is connected in series with resistor R7 and then bridged between the power supply and ground. The common node of the NTC and R7 serves as the temperature sampling point, which is directly fed into the second non-inverting input of the LM393. When the ambient temperature rises, causing the NTC resistance to decrease and the sampling point voltage to be higher than the reference power supply voltage, the second output of the LM393 immediately flips, outputting a high-level signal.

[0027] The power switching module simultaneously receives two output signals from the LM393: Under normal conditions, both outputs are at a low level, and the power switching module keeps the main power supply path on and the backup power supply path off; once a high level is detected in either output, the power switching module immediately shuts down the main power supply path and turns on the backup power supply path, realizing automatic switching of the power supply path and ensuring that the subsequent circuits continuously receive a stable power supply.

[0028] The input terminal of the heat dissipation module is connected to the first output terminal of the LM393: When the first output terminal of the LM393 flips to a high level due to overheating, the gate of the NMOS transistor Q7 inside the heat dissipation module obtains a high level through the pull-up resistor, Q7 conducts, the fan circuit is closed, and the fan starts to run; after the temperature drops, the first output terminal of the LM393 returns to a low level, Q7 is cut off, the fan stops, and automatic heat dissipation is completed.

[0029] A transient voltage suppressor diode (TVS) is connected in parallel between the power supply and ground to absorb transient high voltages at the power supply terminal, protecting the entire protection circuit and downstream equipment.

[0030] The STM32 microcontroller is used only for power monitoring and path status recording: its ADC1 pin collects the power supply voltage in real time through the first voltage divider network, and its ADC2 pin collects the battery voltage in real time through the second voltage divider network; based on the collection results, the STM32 outputs logic signals through the P1 and P2 pins, which can force the main power supply path or the backup power supply path to be shut down, thereby achieving software-level redundancy protection.

[0031] The voltage detection module consists of resistors R8 and R9. One end of R8 is connected to the power supply, and the other end is connected to R9 to form a sampling point. The other end of R9 is grounded. This sampling point is directly fed into the first non-inverting input of the voltage comparator LM393 to achieve real-time monitoring of the power supply voltage.

[0032] The voltage division ratio is determined based on the power supply rating and the reference power supply terminal voltage, ensuring that when the power supply voltage is at the upper limit of the allowable range, the sampling point voltage is exactly equal to the reference power supply terminal voltage; once the power supply voltage continues to rise, the sampling point voltage immediately exceeds the reference power supply terminal voltage, and the output terminal of LM393 flips to a high level, providing a reliable overvoltage flag signal for subsequent power switching modules.

[0033] Preferably, R8 and R9 are thick-film resistors with 1% accuracy and a temperature coefficient of ±100 ppm / °C. Within the operating temperature range of -40 °C to +85 °C, the voltage divider ratio drift is less than 0.5%, ensuring high stability of the voltage detection threshold. The rated power of the resistors is selected with a margin of twice the power consumption of R8 at the highest power supply voltage to avoid resistance drift or thermal damage caused by long-term high-voltage operation.

[0034] The temperature detection module consists of a negative temperature coefficient thermistor (NTC) and resistor R7. One end of the NTC is connected to the power supply, and the other end is connected to R7 to form a sampling point. The other end of R7 is grounded. This sampling point is directly fed into the second non-inverting input of the voltage comparator LM393 to achieve real-time monitoring of the ambient temperature.

[0035] The NTC can be a 10 kΩ surface-mount thermistor with a B value of 3950 K at 25 °C, forming a voltage divider with R7 (10 kΩ, 1% accuracy). At 25 °C, the sampling point voltage is half of the power supply voltage; as the temperature rises, the NTC resistance decreases, and the sampling point voltage rises accordingly. Once the temperature reaches the set threshold (e.g., 70 °C), the sampling point voltage is exactly equal to the reference power supply voltage, and the second output of the LM393 immediately flips to a high level, providing a reliable overheat warning signal to the power switching module and the heat dissipation module.

[0036] R7 can be a precision resistor with a temperature coefficient of ±100 ppm / °C, ensuring that the voltage division ratio drift is less than 0.3% over a wide temperature range; the pads of NTC and R7 are arranged far away from the heat-generating components and use Kelvin connection to eliminate the influence of copper foil resistance on temperature sampling, ensuring high accuracy and high repeatability of temperature detection.

[0037] The power switching module consists of transistors Q5 and Q6, resistors R4, R3, R1, and R2. The base of Q5 is connected to the first output terminal of the LM393, and the base of Q6 is connected to the second output terminal of the LM393. The emitters of both Q5 and Q6 are grounded. One end of R4 is connected to the collector of Q5, and the other end is connected to the base of Q6. One end of R3 is connected to the collector of Q6, and the other end is connected to the gate of MOSFET Q4 in the backup power supply path. R1 and R2 provide pull-up resistors to the gates of the MOSFETs in the main and backup power supply paths, respectively, to ensure that the MOSFETs are turned off by default when there is no signal.

[0038] Specifically, the working process is as follows: 1. Under normal conditions, both outputs of LM393 are at low level, Q5 and Q6 are cut off, the MOSFET Q3 in the main power supply path is turned on under the pull-up action of R1, and the MOSFET Q4 in the backup power supply path is cut off under the pull-up action of R2. Only the main path supplies power to the subsequent stage.

[0039] 2. When the output terminal of LM393 flips to high due to overvoltage, Q5 turns on, pulling the gate of Q3 low and immediately turning off the main path; at the same time, the low level of the collector of Q5 is sent to the base of Q6 through R4, keeping Q6 off, ensuring that the gate of Q4 is still pulled up by R2 and continues to be turned off, realizing the interlock of "main path is turned off first, backup path is not turned on".

[0040] 3. When the second output terminal of LM393 flips to high due to overheating, Q6 turns on, pulling the gate of Q4 low and turning on the backup path; the low level of the collector of Q6 is fed back to the base of Q5 through R3, keeping Q5 off, thereby preventing the main path from turning on at the same time, realizing "main and backup mutual exclusion".

[0041] R1 and R2 are rated at 10 kΩ to ensure fast charging of the MOSFET gate and reliable pull-down by Q5 or Q6 under abnormal conditions; R3 and R4 are rated at 4.7 kΩ to limit base current and accelerate turn-off speed. The entire module consumes almost zero power when there is no signal, and the switching delay is less than 200 ns, meeting the requirements for fast power path switching.

[0042] In some embodiments, the main power supply path consists of MOSFET Q3, resistors R1 and R3, with the connection relationship completely consistent with claim 5: the source of Q3 is connected to the power supply, and the drain is connected to the subsequent circuit; one end of R1 is connected to the gate of Q3, and the other end is connected to R3; the other end of R3 is connected to the power supply. This structure utilizes the low on-resistance characteristic of the MOSFET to achieve main path power supply, and R1 and R3 provide bias and turn-off pull-up for the gate. Specifically, the working process is as follows: 1. Under normal conditions, the power switching module makes the gate of Q3 high, Q3 is fully turned on, and the main power supply path outputs a potential close to the power supply voltage to the next stage. The voltage drop depends only on the on-resistance of Q3 and the load current.

[0043] 2. When the power switching module detects an abnormality and pulls the gate of Q3 low, Q3 is immediately turned off, the main path stops supplying power, and the subsequent circuit seamlessly switches to the backup power supply path.

[0044] R1 is set to 10 kΩ, ensuring both rapid gate charging and reliable pull-down by the power switching module transistor during turn-off. R3 is set to 100 kΩ, providing static bias to ensure the gate remains high when there is no switching signal. MOSFET Q3 is a 30V / 20A P-channel device with an 8 mΩ on-resistance. Under 12V, 5A load conditions, the path voltage drop is less than 40 mV, and the power consumption is less than 200 mW, meeting the requirements for high efficiency and low temperature rise in the main power supply path.

[0045] In some embodiments, the backup power supply path consists of MOSFET Q4, diodes D3, D4, and D5, and resistors R2 and R4. The source of Q4 is directly connected to the power supply, and the drain is connected to the anodes of the three diodes. The cathodes are connected in parallel as the output path. The gate is connected to the power supply via R2 to maintain normal off-state. One end of R4 is also connected to the power supply, and the other end is driven by the power switching module. Under normal conditions, Q4 is off. When the second output terminal of LM393 goes high due to overheating, the power switching module pulls down the gate of Q4, and Q4 turns on. Current flows through Q4 to supply power to the subsequent stage. The diode has a low voltage drop of 0.35 V to reduce losses. R2 is 100 kΩ to ensure static off-state. R4 is 10 kΩ to limit the gate current and make the off-state time less than 150 ns. The three transistors are connected in parallel to share the current, with each transistor not exceeding 2 A. The temperature rise is controlled within 10 °C. The path voltage drop is about 0.35 V under a 5 A load. The power consumption of 3.5 W can be met by natural heat dissipation through the copper foil on the aluminum substrate.

[0046] In some embodiments, the heat dissipation module uses an NMOS transistor Q7 as a switch. Its gate is connected to the output terminal of an LM393 via resistor R12, its source is connected to the negative terminal of the fan and the positive terminal of a Zener diode D8, and its drain is grounded. A PTC is connected in series between the power supply and the positive terminal of the fan. At room temperature, the output terminal of LM393 is low, Q7 is off, and the fan stops. Once an overvoltage is detected, the output terminal goes high, driving Q7 to conduct via R12, and the fan starts to dissipate heat. The PTC is a 16 V / 2 A resettable fuse, maintaining a low resistance of 50 mΩ at a rated current of 0.35 A. If the stall current exceeds 1.2 A (within 200 ms), it switches to high resistance and automatically recovers after the fault is cleared. D8 is a 13 V / 1 W Zener diode to suppress turn-off spikes and protect the drain-source voltage of Q7 from exceeding 30 V of the rated voltage. R12 is 4.7 kΩ to ensure a gate charging current of approximately 1 mA. The turn-on time of Q7 is 100 ns. The fan start and stop are entirely controlled by a hardware comparator, achieving automatic heat dissipation without software intervention.

[0047] In some embodiments, the microcontroller STM32 undertakes the power monitoring task, and its ADC1 and ADC2 pins are connected to the power supply through the first voltage divider network RB1-RB2 and the second voltage divider network RB3-RB4, respectively. The two voltage divider networks have the same structure.

[0048] Preferably, one end of the 100 kΩ upper arm resistor is connected to the power supply, and the other end is connected to the 10 kΩ lower arm and leads out the sampling point. The other end of the lower arm is grounded. The 10:1 voltage divider maps the 0–16 V voltage to 0–1.6 V, which falls entirely within the 0–3.3 V range of the STM32 ADC, with a resolution of approximately 1.6 mV. The STM32 polls at a frequency of 10 Hz. When it detects that the power supply voltage is continuously lower than 10.5 V or higher than 15.5 V for 200 ms, it immediately outputs a low level through the P1 and P2 pins to force the shutdown of the main or backup path, providing software redundancy protection. In the normal range, it maintains high impedance and is automatically switched by hardware.

[0049] In some embodiments, the P1 and P2 pins of the STM32 are directly connected to the base drive nodes of Q5 and Q6 in the power switching module. P1 controls the main path MOSFET Q3, and P2 controls the backup path MOSFET Q4. Under normal conditions, P1 and P2 maintain high impedance, and the path is determined by the LM393 hardware signal. When the software determines that the voltage is abnormal and forced intervention is required, the corresponding pin outputs a low level, pulling down the base of Q5 or Q6, turning off Q3 or Q4, and achieving lockout. The intervention signal is ANDed with the output line of the hardware comparator. Either low level can shut down the path, ensuring dual protection.

[0050] In some embodiments, the positive power supply pin of the LM393 voltage comparator is directly connected to the power supply, and the negative power supply pin is grounded. As an example, the chip operates at a voltage of 3–36 V. This circuit is powered by a 16 V supply at its rated center, with a quiescent current of less than 1 mA and a power consumption of less than 16 mW. The two internal comparators independently receive voltage and temperature sampling signals, compare them with a 2.5 V reference source, and the open-drain output is pulled up to the power supply via a 10 kΩ resistor to form a high-active-high logic, which can directly drive subsequent modules without level conversion.

[0051] The beneficial effects of the various embodiments of the present invention are as follows: 1. The voltage detection module and temperature detection module work synchronously, and are compared in real time through the LM393 comparator. Once the voltage or temperature exceeds the limit, the output will immediately switch. The hardware-level response can complete the detection and trigger the protection in the early stage of the fault, which significantly reduces the risk of damage to the downstream circuit due to overvoltage or overheating and improves the long-term reliability of the power supply system.

[0052] 2. The power switching module adopts a transistor interlock structure to ensure that the main power supply path and the backup power supply path will never be turned on at the same time. The switching action is directly driven by the comparator output without software intervention, realizing a seamless connection between shutdown and turn-on, avoiding load reset or data loss due to power interruption, and ensuring power continuity.

[0053] 3. The heat dissipation module uses the comparator output as the control source, and the fan starts immediately when the temperature exceeds the limit; the resettable fuse automatically limits the current when the current is abnormal and resets itself after the fault is cleared, eliminating the maintenance work of replacing the fuse; the Zener diode suppresses the turn-off spike; the whole heat dissipation solution has zero software dependence and zero maintenance, significantly extending the service life of the fan and power module.

[0054] 4. The microcontroller monitors the power supply voltage only through a high-impedance voltage divider network and does not interfere with the power supply path under normal conditions. Only when a continuous voltage abnormality is detected will the corresponding path be forcibly shut down through hardware lines and logic, forming a software redundancy lock-up. This architecture retains the advantages of fast hardware switching and provides programmable secondary protection, balancing speed, safety and flexibility.

[0055] 5. The comparator is directly powered by the power supply, and the open-drain output can drive the subsequent modules through a single pull-up resistor. The circuit is simple and the number of components is small. Compared with the traditional multi-stage operational amplifier solution, the BOM cost and PCB area are significantly reduced, and the overall power consumption is reduced. It is suitable for photoelectric switch applications that are sensitive to cost, size and power consumption.

[0056] Furthermore, the storage medium in the embodiments of this application stores program instructions capable of implementing all the above methods. These program instructions can be stored in the storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.

[0057] The above description is merely an explanation of some preferred embodiments of the present invention and the technical principles employed. Those skilled in the art should understand that the scope of the invention as described in the embodiments of the present invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present invention.

Claims

1. A photoelectric switching power supply protection circuit, characterized in that, include: Voltage detection module, temperature detection module, power switching module, heat dissipation module, main power supply path, backup power supply path, transient voltage suppressor diode (TVS), microcontroller (STM32); The voltage detection module's input is connected to the power supply, and its output is connected to the first non-inverting input of the LM393 voltage comparator. The temperature detection module's input is connected to the power supply, and its output is connected to the second non-inverting input of the LM393 voltage comparator. Both the first and second inverting inputs of the LM393 voltage comparator are connected to the reference power supply. The power switching module's input is connected to the first and second outputs of the LM393 voltage comparator. The first output of the power switching module is connected to the control terminal of the main power supply path, and the second output is connected to the control terminal of the backup power supply path. The main power supply path's input... The input terminals of both the main power supply path and the backup power supply path are connected to the power supply. The output terminals of both the main power supply path and the backup power supply path are connected to the subsequent circuit. The input terminal of the heat dissipation module is connected to the first output terminal of the voltage comparator LM393, and the output terminal of the heat dissipation module is connected to the fan. The negative terminal of the transient voltage suppressor diode TVS is connected to the power supply, and the positive terminal of the transient voltage suppressor diode TVS is grounded. The ADC1 pin of the microcontroller STM32 is connected to the power supply through the first voltage divider network, the ADC2 pin is connected to the power supply through the second voltage divider network, the P1 pin is connected to the controlled terminal of the power switching module, and the P2 pin is connected to the controlled terminal of the backup power supply path.

2. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The voltage detection module includes resistors R8 and R9. One end of resistor R8 is connected to the power supply, and the other end of resistor R8 is connected to one end of resistor R9 to form the output terminal of the voltage detection module. The other end of resistor R9 is grounded.

3. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The temperature detection module includes a negative temperature coefficient thermistor (NTC) and a resistor (R7). One end of the NTC is connected to the power supply, and the other end of the NTC is connected to one end of the resistor (R7) to form the output terminal of the temperature detection module. The other end of the resistor (R7) is grounded.

4. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The power switching module includes transistors Q5 and Q6, and resistors R4, R3, R1, and R2. The base of transistor Q5 is connected to the first output terminal of the voltage comparator LM393, and the collector of transistor Q5 is connected to one end of resistor R4 and the gate of MOSFET Q3 in the main power supply path. The emitter of transistor Q5 is grounded. The other end of resistor R4 is connected to the power supply. The base of transistor Q6 is connected to the second output terminal of the voltage comparator LM393, and the collector of transistor Q6 is connected to one end of resistor R3 and the gate of MOSFET Q4 in the backup power supply path. The emitter of transistor Q6 is grounded. The other end of resistor R3 is connected to the power supply. One end of resistor R1 is connected to the gate of MOSFET Q3, and the other end is connected to the power supply. One end of resistor R2 is connected to the gate of MOSFET Q4, and the other end is connected to the power supply.

5. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The main power supply path includes MOSFET Q3, resistor R1, and resistor R3. The source of MOSFET Q3 is connected to the power supply, and the drain of MOSFET Q3 is connected to the subsequent circuit. One end of resistor R1 is connected to the gate of MOSFET Q3, and the other end of resistor R1 is connected to one end of resistor R3. The other end of resistor R3 is connected to the power supply.

6. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The backup power supply path includes MOSFET Q4, diodes D3, D4, and D5, and resistors R2 and R4. The source of MOSFET Q4 is connected to the power supply, and the drain of MOSFET Q4 is connected to the anodes of diodes D3, D4, and D5. The cathodes of diodes D3, D4, and D5 together constitute the output terminal of the backup power supply path. One end of resistor R2 is connected to the gate of MOSFET Q4, and the other end of resistor R2 is connected to the power supply. One end of resistor R4 is connected to the gate of MOSFET Q4, and the other end of resistor R4 is connected to the output terminal of the power switching module.

7. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The heat dissipation module includes an NMOS transistor Q7, a resistor R12, a resettable fuse PTC, a Zener diode D8, and a fan. One end of the resistor R12 is connected to the first output terminal of the voltage comparator LM393, and the other end of the resistor R12 is connected to the gate of the NMOS transistor Q7. The source of the NMOS transistor Q7 is connected to the negative terminal of the fan and the positive terminal of the Zener diode D8, and the drain of the NMOS transistor Q7 is grounded. The negative terminal of the Zener diode D8 is connected to the negative terminal of the fan. One end of the resettable fuse PTC is connected to the power supply, and the other end of the resettable fuse PTC is connected to the positive terminal of the fan.

8. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The first voltage divider network includes resistors RB1 and RB2. One end of resistor RB1 is connected to the power supply, and the other end of resistor RB1 is connected to one end of resistor RB2 and together they are connected to the ADC1 pin of the STM32 microcontroller. The other end of resistor RB2 is grounded.

9. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The second voltage divider network includes resistors RB3 and RB4. One end of resistor RB3 is connected to the power supply, and the other end of resistor RB3 is connected to one end of resistor RB4 and together they are connected to the ADC2 pin of the STM32 microcontroller. The other end of resistor RB4 is grounded. The STM32 microcontroller outputs a control signal from pin P1 to control the on / off state of MOSFET Q3, and outputs a control signal from pin P2 to control the on / off state of MOSFET Q4.

10. The photoelectric switching power supply protection circuit according to claim 1, characterized in that, The positive power supply pin of the voltage comparator LM393 is connected to the power supply, and the negative power supply pin of the voltage comparator LM393 is grounded.