Software on-off circuit based on toggle switch

By using a software power on/off circuit based on a toggle switch and combining hardware and software control modules, the problem of untimely power off in the prior art is solved, and precise power control and stable system operation are achieved.

CN223377627UActive Publication Date: 2025-09-23GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202422565557.1
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-09-23
Estimated Expiration
2034-10-23

AI Technical Summary

Technical Problem

Existing software power-on and power-off circuits lack accurate detection and control of system status, resulting in untimely power shutdown and affecting the safe operation of the system.

Method used

A software power on/off circuit based on a toggle switch is adopted, combined with a hardware control module and a software control module. Power management is achieved through a MOS tube switch control module, including a power input module, a hardware control module, a signal detection module, and a software control module to ensure stable power switching.

Benefits of technology

It achieves precise control and stable management of power supply, prevents data loss caused by sudden power outages, and improves the operational stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223377627U_ABST
    Figure CN223377627U_ABST
Patent Text Reader

Abstract

According to the software on-off circuit based on the toggle switch, the hardware control module is arranged in the circuit, and the on-off state of the circuit is manually controlled through the toggle switch. And meanwhile, intelligent software control is realized through an MCU (Microprogrammed Control Unit) in the software control module, and the flexibility and operability of the circuit are enhanced by combining two modes of hardware operation and intelligent control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model relates to the technical field of electronic circuits, in particular to a software on / off circuit based on a toggle switch. Background Art

[0002] With the widespread use of electronic devices, power management and control have become key design issues. In many electronic devices, power on / off control can be achieved through either physical switches or software control. Traditional power switching circuits mostly rely on mechanical switches, which have certain drawbacks, such as physical wear and low reliability. However, with the prevalence of smart devices, software-controlled power on / off is gaining popularity. Combining software and hardware to implement power on / off control not only improves switch lifespan but also enables more complex logic control through intelligent modules such as microcontrollers (MCUs).

[0003] Currently, most software-based power-on / off circuits on the market only implement simple power-on / off functions, lacking precise detection and control of system status. For example, during a shutdown operation, there is typically no detection or feedback of the shutdown signal, which can lead to delayed power shutoff, thus affecting the safe operation of the system.

[0004] In summary, the problems existing in the prior art need to be solved urgently. Utility Model Content

[0005] The utility model provides a software on / off circuit based on a toggle switch, which is used to solve the defects in the prior art and ensure the stability of system operation.

[0006] The utility model provides a software power on / off circuit based on a toggle switch, comprising:

[0007] Power supply input module, hardware control module, software control module, signal detection module and MOS tube switch control module;

[0008] The power input module is used to provide power input;

[0009] The hardware control module is used to control the working state of the MOS transistor switch control module according to a first control signal, and the first control signal is generated by a toggle switch;

[0010] The signal detection module is used to detect the first control signal and send the first control signal to the software control module;

[0011] The software control module is used to generate a second control signal according to the first control signal to control the working state of the MOS tube switch control module;

[0012] The MOS tube switch control module is used to output power to the subsequent load;

[0013] The output end of the power supply input module is connected to the first input end of the MOS tube switch control module; the output end of the MOS tube switch control module is connected to the subsequent load; the toggle switch is connected to the input end of the hardware control module; the output end of the hardware control module is connected to the second input end of the MOS tube switch control module; the toggle switch is connected to the input end of the signal detection module; the signal detection module is connected to the input end of the software control module; and the software control module is connected to the third input end of the MOS tube switch control module.

[0014] According to a software power on / off circuit based on a toggle switch provided by the present invention, the hardware control module includes a timing circuit, a first resistor and a first capacitor, and the timing circuit is used to generate the first control signal according to the state of the toggle switch.

[0015] According to a software power on / off circuit based on a toggle switch provided by the utility model, the MOS tube switch control module includes a second triode, a second resistor and a control switching circuit.

[0016] According to a software power on / off circuit based on a toggle switch provided by the utility model, the control switching circuit includes a third transistor and a fifth transistor. The third transistor is used to control the MOS tube switch control module in a hardware control mode, and the fifth transistor is used to control the MOS tube switch control module in a software control mode.

[0017] According to a software power on / off circuit based on a toggle switch provided by the utility model, the software control module includes an MCU and a fourth transistor. The MCU communicates with an external intelligent device and is used to control the state of the MOS tube switch control module according to external instructions.

[0018] According to a software power-on / off circuit based on a toggle switch provided by the utility model, the signal detection module includes a first transistor and a second resistor. The first transistor is used to detect a shutdown signal when the toggle switch is closed. When the shutdown signal is detected, the signal detection module sends a signal to the MCU to control the MOS tube switch control module to disconnect the power supply.

[0019] This utility model provides a toggle switch-based software on / off circuit. By including a hardware control module in the circuit, the circuit's on / off state can be manually controlled by toggle switching. Furthermore, the MCU in the software control module implements intelligent software control, combining hardware operation with intelligent control to enhance the circuit's flexibility and operability. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 This is a module diagram of a software power on / off circuit based on a toggle switch provided by the present invention;

[0022] Figure 2 This is a specific circuit diagram of a software power on / off circuit based on a toggle switch provided by the utility model. DETAILED DESCRIPTION

[0023] To make the purpose, technical solutions, and advantages of the present invention more clear, the following will be combined with the accompanying drawings to clearly and completely describe the technical solutions of the present invention. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0024] In order to solve the problems in the prior art, the present invention proposes a software power on / off circuit based on a toggle switch to ensure the stability of the system operation. The software power on / off circuit based on a toggle switch is described below. Figure 1 As shown, including but not limited to the following modules:

[0025] Power supply input module: The power supply input module is used to provide power input to ensure the reliability of subsequent circuit operation. The output end of the power supply input module is connected to the first input end of the MOS tube switch control module to provide it with a stable operating voltage.

[0026] Hardware Control Module: This module is used to implement initial power-on control for the circuit. It includes a toggle switch, a timing circuit, a first resistor, and a first capacitor. The toggle switch is the physical interface between the user and the circuit, allowing the user to control the power-on state. When the toggle switch is turned on, the timing circuit begins operating, generating a first control signal based on the charge and discharge times of the first resistor and first capacitor. This signal is transmitted through the hardware control module to the MOS transistor switch control module, which in turn controls the power output of the downstream load, achieving the initial power-on operation.

[0027] MOS transistor switch control module: This module is the actual switching component of the circuit. It includes MOS transistors, control switching circuitry, and associated resistors. Upon receiving a first control signal from the hardware control module, the MOS transistors conduct, outputting power to the downstream loads. When the hardware control signal is removed, the MOS transistors turn off, ceasing power supply to the downstream loads.

[0028] Signal Detection Module: This module detects the state of the toggle switch in real time and generates a corresponding control signal. This module, which includes a second MOS transistor and associated resistors, detects the on / off state of the toggle switch. When the toggle switch is turned off, the signal detection module generates a shutdown signal and transmits it to the software control module.

[0029] Software Control Module: The software control module is the intelligent control center of the entire circuit, responsible for taking over the MOSFET switching control after the hardware is initially powered on. This module includes an MCU (microcontroller unit) and a first transistor connected to the MCU. When the MCU detects the power-on signal, it generates a second control signal, which drives the transistor to turn the MOSFET on and off, ensuring continuous power output. During shutdown, the MCU first saves data to prevent data loss, then generates a control signal to shut down the MOSFET, ultimately stopping power supply.

[0030] In a specific implementation, when the toggle switch is turned on, the timing circuit generates a first control signal, the MOS transistor switch control module turns on, and the MCU starts up and takes over control of the MOS transistor, achieving stable power output. When shutting down, the toggle switch is turned off. The signal detection module detects this state and transmits a shutdown signal to the MCU. The MCU executes the shutdown program and controls the MOS transistor to power off.

[0031] Specific working principle:

[0032] Power-on process: When the user flips the switch to the on position, the timing circuit generates a first control signal, turning on the MOS transistor and supplying power to the load. Simultaneously, the MCU starts up and, based on the detected signal, takes over control, ensuring continuous power supply to the load.

[0033] Shutdown process: When the user turns the switch to the off position, the signal detection module generates a shutdown signal and transmits it to the MCU. The MCU first saves the data and then generates a control signal to disconnect the MOS tube and stop powering the load.

[0034] For example, in a typical application scenario, the user turns on the power by flipping a toggle switch. The system relies on the hardware control module to start the power supply, and then the MCU takes over to ensure stable power output. When the user turns off the toggle switch, the MCU detects this change through the signal detection module and controls the circuit to shut off the power through software, preventing data loss caused by sudden power outages.

[0035] As a further optional embodiment, the hardware control module includes a timing circuit, a first resistor, and a first capacitor, and the timing circuit is used to generate the first control signal according to the state of the toggle switch.

[0036] In this embodiment, the hardware control module includes a timing circuit, a toggle switch SW1, a first resistor R1 and a first capacitor C1, as shown in the attached figure. Figure 2 The timing circuit is used to generate a first control signal according to the state of the toggle switch, thereby controlling the working state of the MOS tube switch control module.

[0037] The toggle switch SW1 is used to control the opening and closing of the hardware switch. When the user toggles the switch to the “on” position, the circuit starts to supply power.

[0038] The first resistor R1 and the first capacitor C1 form an RC timing circuit. When the toggle switch SW1 is turned to the "on" position, the capacitor C1 begins to charge. This RC timing circuit generates a delay based on the charging time, which plays a timing role.

[0039] The timing circuit generates a first control signal, namely a hardware control signal, through the combination of R1 and C1, and sends the signal to the MOS tube switch control module, thereby realizing hardware control in the initial startup stage.

[0040] As a further optional embodiment, the MOS tube switch control module includes a second transistor, a second resistor and a control switching circuit.

[0041] The second transistor Q3 is used to control the on and off state of the MOS transistor Q2. The base of the second transistor is connected to the hardware control module through the second resistor R3, and receives the first control signal from the hardware control module to control the working state of the transistor.

[0042] The second resistor R3 is located between the hardware control module and the second transistor Q3 and is used to limit the current of the control signal to ensure that the base of the transistor is not damaged by excessive input current.

[0043] The control switching circuit includes the third transistor Q5, the second MOS transistor Q4, and associated resistors R6 and R5. This circuit switches between hardware and software control. When the circuit is initially powered on, the hardware control module turns on MOS transistor Q2. After the MCU boots up, the control switching circuit transfers control to the software control module, which then takes over the remaining MOS transistor control operations.

[0044] Specifically, the circuit works as follows:

[0045] Hardware-controlled startup: When toggle switch SW1 is in the "on" position, the hardware control module generates a first control signal, which is applied to the base of transistor Q3 via resistor R3, turning it on. Once Q3 turns on, MOSFET Q2 also turns on, and power begins to flow to the downstream load.

[0046] Software Control Phase: After the MCU boots up and runs normally, it generates a second control signal through the software control module to control MOSFET Q4 and the third transistor Q5. At this point, the control switching circuit switches control of MOSFET Q2 from hardware control to software control, leaving the MCU responsible for maintaining the MOSFET's conduction.

[0047] Shutdown stage: When the toggle switch is in the "off" position, the MCU detects the shutdown signal and turns off the MOS tube Q2 by controlling the switching circuit, cutting off the power supply of the subsequent load and realizing a soft shutdown operation.

[0048] As a further optional embodiment, the control switching circuit includes a third transistor and a fifth transistor, the third transistor is used to control the MOS tube switch control module in the hardware control mode, and the fifth transistor is used to control the MOS tube switch control module in the software control mode.

[0049] As attached Figure 2 As shown, the specific structure of the control switching circuit includes a third transistor Q3, a fifth transistor Q5 and corresponding resistance elements, which are used to achieve smooth switching between hardware control and software control.

[0050] Transistor Q3: Used to control the conduction of MOS transistor Q2 in hardware control mode. When toggle switch SW1 is turned on, the first control signal generated by the hardware control module is applied to the base of transistor Q3 through resistor R3, turning it on. Once Q3 is turned on, MOS transistor Q2 is also turned on, and power is supplied to the downstream load.

[0051] Transistor Q5 controls the conduction of MOSFET Q2 in software-controlled mode. After the MCU boots up and detects the power-on signal, the software control module generates a second control signal to turn on transistor Q5. At this point, MOSFET Q2 switches to software control and continues to provide power to downstream loads.

[0052] Control switching process:

[0053] Hardware Control Mode: When the toggle switch SW1 is switched to the "on" state, transistor Q3 turns on, and MOS transistor Q2 is turned on by the hardware control module, and the downstream load receives power. In this stage, the hardware circuit mainly ensures the startup of the circuit.

[0054] Software Control Mode: After the MCU boots up, the software control module controls the base voltage of transistor Q5, turning it on. This switches control of MOS transistor Q2 from Q3 to Q5, and the circuit enters software control. At this point, the MCU can implement more flexible power management functions as needed.

[0055] Shutdown operation:

[0056] When toggle switch SW1 is closed, the software control module detects the shutdown signal and controls transistor Q5 to turn off MOSFET Q2, stopping power to the downstream load. The hardware control module also ensures hardware shutdown of the MOSFET through transistor Q3 to prevent leakage or incomplete shutdown.

[0057] As a further optional embodiment, the software control module includes an MCU and a fourth transistor, and the MCU communicates with an external intelligent device and is used to control the state of the MOS tube switch control module according to external instructions.

[0058] The structure of the software control module includes an MCU and a fourth transistor Q4. The MCU can exchange data with external intelligent devices through a communication interface and manage the working status of the circuit according to the received control instructions.

[0059] MCU communicates with the outside world:

[0060] The MCU communicates with external smart devices (such as mobile phones, tablets, computers, etc.) through I / O interfaces. The communication method can be wired (such as UART, I2C, SPI) or wireless (such as Bluetooth, Wi-Fi).

[0061] The fourth transistor Q4 controls:

[0062] Under software control, the MCU controls the on / off switching of transistor Q4 based on external instructions. When power is turned on, the MCU outputs a high-level signal to the base of Q4, turning it on. This in turn drives the MOS switch control module to turn on, providing power to the downstream load.

[0063] When receiving a shutdown or power-saving instruction, the MCU controls Q4 to turn off, thereby turning off the MOS tube and cutting off the power output.

[0064] Circuit function description:

[0065] Power-on process: The external device sends a power-on command. After receiving the signal, the MCU controls the fourth transistor Q4 to turn on, the MOS tube Q2 to turn on, and the subsequent load starts to supply power.

[0066] Shutdown process: The external device sends a shutdown command, the MCU controls Q4 to be cut off, the MOS tube Q2 is turned off, and the power supply to the subsequent load is cut off to avoid unnecessary power consumption.

[0067] Intelligent power saving mode: External devices can send instructions to the MCU to implement intelligent power saving functions by timing or detecting the power status of the load, such as automatically turning off the power after the device is idle for a long time.

[0068] As a further optional embodiment, the signal detection module includes a first transistor and a second resistor, and the first transistor is used to detect a shutdown signal when the toggle switch is turned off. When the shutdown signal is detected, the signal detection module sends a signal to the MCU to control the MOS tube switch control module to disconnect the power supply.

[0069] The signal detection module mainly consists of the first transistor Q1, the second resistor R7 and other related components. When the toggle switch is closed, the signal detection module detects the shutdown signal by the conduction or cutoff of Q1 and sends the signal to the MCU for processing.

[0070] Shutdown signal detection:

[0071] When the toggle switch (SW1) is in the off state, the signal detection module detects this state change through the first transistor Q1.

[0072] Specifically, the base of Q1 is connected to the switch via the second resistor R7. When the toggle switch is closed, the voltage of the circuit changes, causing Q1 to turn on, thereby generating a shutdown signal.

[0073] Signal transmission to MCU:

[0074] After detecting the shutdown signal, Q1 is turned on and the signal is transmitted to the input port of the MCU (H1 interface as shown in the figure) through its emitter.

[0075] After receiving the shutdown signal from the signal detection module, the MCU will perform the corresponding logical operation, enter the software control mode, and prepare to disconnect the MOS tube switch control module.

[0076] MCU shutdown control:

[0077] After receiving the shutdown signal, the MCU will first perform pre-processing operations such as data saving and task completion to prevent data loss or system abnormalities caused by sudden power failure.

[0078] After completing all tasks, the MCU will output a control signal to the MOS tube switch control module, which will control the fourth transistor Q4 or the fifth transistor Q5 to turn off the MOS tube (Q2), disconnect the subsequent power output, and complete the shutdown operation.

[0079] Circuit function description:

[0080] When booting:

[0081] When the toggle switch is turned on, the signal detection module will not generate a shutdown signal, the MCU continues to control the MOS tube switch control module, and the circuit is powered normally.

[0082] When shutting down:

[0083] When the toggle switch is turned off, the signal detection module detects the shutdown signal through the first transistor Q1 and transmits the signal to the MCU. The MCU then controls the MOS tube to disconnect the downstream power supply, completing the shutdown operation.

[0084] advantage:

[0085] Accurate shutdown detection: The state of the toggle switch can be accurately detected by the conduction of the first transistor Q1, ensuring that the shutdown signal is accurately transmitted to the MCU.

[0086] Safe power off: The signal detection module works in conjunction with the MCU to ensure data preservation and pre-processing operations before shutdown, preventing risks caused by sudden power off of the system.

[0087] Low power design: The signal detection module has a relatively simple design and low power consumption, making it suitable for portable devices or applications that require long standby times.

[0088] Through the description of the above embodiments, the present invention realizes a high-efficiency power management circuit based on a toggle switch and intelligent control, which is stable, intelligent and convenient.

[0089] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A software power on / off circuit based on a toggle switch, characterized in that: include: Power supply input module, hardware control module, software control module, signal detection module and MOS tube switch control module; The power input module is used to provide power input; The hardware control module is used to control the working state of the MOS transistor switch control module according to a first control signal, and the first control signal is generated by a toggle switch; The signal detection module is used to detect the first control signal and send the first control signal to the software control module; The software control module is used to generate a second control signal according to the first control signal to control the working state of the MOS tube switch control module; The MOS tube switch control module is used to output power to the subsequent load; The output end of the power supply input module is connected to the first input end of the MOS tube switch control module; the output end of the MOS tube switch control module is connected to the subsequent load; the toggle switch is connected to the input end of the hardware control module; the output end of the hardware control module is connected to the second input end of the MOS tube switch control module; the toggle switch is connected to the input end of the signal detection module; the signal detection module is connected to the input end of the software control module; and the software control module is connected to the third input end of the MOS tube switch control module.

2. The software power on / off circuit based on a toggle switch according to claim 1, characterized in that: The hardware control module includes a timing circuit, a first resistor, and a first capacitor. The timing circuit is configured to generate the first control signal according to a state of the toggle switch.

3. The software power on / off circuit based on a toggle switch according to claim 1, characterized in that: The MOS tube switch control module includes a second triode, a second resistor and a control switching circuit.

4. The software power on / off circuit based on a toggle switch according to claim 3, characterized in that: The control switching circuit includes a third transistor and a fifth transistor. The third transistor is used to control the MOS tube switch control module in a hardware control mode, and the fifth transistor is used to control the MOS tube switch control module in a software control mode.

5. The software power on / off circuit based on a toggle switch according to claim 1, characterized in that: The software control module includes an MCU and a fourth transistor. The MCU communicates with an external intelligent device and is used to control the state of the MOS tube switch control module according to external instructions.

6. The software power on / off circuit based on a toggle switch according to claim 5, characterized in that: The signal detection module includes a first transistor and a second resistor. The first transistor is used to detect a shutdown signal when the toggle switch is turned off. When the shutdown signal is detected, the signal detection module sends a signal to the MCU to control the MOS tube switch control module to disconnect the power supply.