CN117277539A - Power supply switching circuit and method based on power supply insertion detection - Google Patents

Power supply switching circuit and method based on power supply insertion detection Download PDF

Info

Publication number
CN117277539A
CN117277539A CN202311248235.8A CN202311248235A CN117277539A CN 117277539 A CN117277539 A CN 117277539A CN 202311248235 A CN202311248235 A CN 202311248235A CN 117277539 A CN117277539 A CN 117277539A
Authority
CN
China
Prior art keywords
power supply
mos tube
resistor
singlechip
capacitor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311248235.8A
Other languages
Chinese (zh)
Inventor
谢龙悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong New Generation Information Industry Technology Research Institute Co Ltd
Original Assignee
Shandong New Generation Information Industry Technology Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong New Generation Information Industry Technology Research Institute Co Ltd filed Critical Shandong New Generation Information Industry Technology Research Institute Co Ltd
Priority to CN202311248235.8A priority Critical patent/CN117277539A/en
Publication of CN117277539A publication Critical patent/CN117277539A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J9/00Circuit arrangements for emergency or stand-by power supply, e.g. for emergency lighting
    • H02J9/04Circuit arrangements for emergency or stand-by power supply, e.g. for emergency lighting in which the distribution system is disconnected from the normal source and connected to a standby source
    • H02J9/06Circuit arrangements for emergency or stand-by power supply, e.g. for emergency lighting in which the distribution system is disconnected from the normal source and connected to a standby source with automatic change-over, e.g. UPS systems
    • H02J9/068Electronic means for switching from one power supply to another power supply, e.g. to avoid parallel connection
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors

Abstract

The invention discloses a power supply switching circuit and a power supply switching method based on power supply insertion detection, belongs to the technical field of power supply switching, and aims to solve the technical problem of how to realize stable power supply switching. The power supply comprises a singlechip, a power supply insertion detection circuit and a power supply switching circuit; the power supply insertion detection circuit is a triode switch circuit, and the singlechip is used for detecting whether an external power supply is inserted or not through the power supply insertion detection circuit; the power supply switching circuit is composed of an MOS tube, a resistor and a capacitor, and the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.

Description

Power supply switching circuit and method based on power supply insertion detection
Technical Field
The invention relates to the technical field of power supply switching, in particular to a power supply switching circuit and a power supply switching method based on power supply insertion detection.
Background
When the power supply automatic switching circuit is used for switching the power supply, a plurality of ms are needed from the closing state to the conduction state of the switch MOS tube, so that the power supply switching time difference occurs, and the system power supply is insufficient, so that the problem occurs. The common solution is to add a capacitor with larger capacitance, the size of the capacitor is related to the factors of the type selection of the MOS tube and the power consumption of the circuit, and when the circuit power is larger, the unstable condition can also occur.
How to realize stable power supply switching is a technical problem to be solved.
Disclosure of Invention
The technical task of the invention is to provide a power supply switching circuit and a power supply switching method based on power supply insertion detection to solve the technical problem of how to realize stable power supply switching.
In a first aspect, the invention provides a power supply switching circuit based on power supply insertion detection, which comprises a singlechip, a power supply insertion detection circuit and a power supply switching circuit;
the power supply insertion detection circuit is a triode switch circuit, and the singlechip is used for detecting whether an external power supply is inserted or not through the power supply insertion detection circuit;
the power supply switching circuit is composed of an MOS tube, a resistor and a capacitor, and the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.
Preferably, the power supply insertion detection circuit includes a transistor Q3, a resistor R1, a resistor R2 and a resistor R3,
the first end of the resistor R1 IS connected with a power supply output voltage, the second end of the resistor R1 IS electrically connected with the collector of the triode Q3, and the collector of the triode Q3 IS electrically connected with an IS_V1_IN pin of the singlechip;
the first end of the resistor R2 is used for being externally connected with a plug-in power supply V1, and the second end of the resistor R2 is electrically connected with the base electrode of the triode Q3;
the first end of the resistor R3 is electrically connected with the second end of the resistor R2 and the base electrode of the triode Q3, and the second end of the resistor R3 and the emitter electrode of the triode Q3 are grounded;
the singlechip is matched with the power supply insertion detection circuit and is used for executing the following detection on whether an external power supply is inserted or not: when the external power supply V1 IS not inserted, the triode Q3 IS IN a high resistance state, the IS_V1_IN pin IS pulled up to the VOUT power supply by the resistor R1, and the IS_V1_IN pin IS IN a high level; when the external power supply V1 IS inserted, the triode Q3 IS turned on, and the triode Q3 and the IS_V1_IN pins are connected to the ground to generate a low-level signal; the singlechip judges whether the power supply of the external power supply V1 IS inserted or not by detecting the level change of the IS_V1_IN pin.
Preferably, the power supply switching circuit comprises an N-type MOS transistor Q2, a P-type MOS transistor Q1, a P-type MOS transistor Q4, a resistor R4, a capacitor C1 and a capacitor C2;
the source electrode of the MOS tube Q1 is used for externally connecting an inserted power supply V1;
the first end of the resistor R4 is connected with the output VOUT, and the second end of the resistor R4 is electrically connected with the grid electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q2;
the grid electrode of the MOS tube Q2 is used for being electrically connected with a GPIO pin of the singlechip and is electrically connected with the grid electrode of the MOS tube Q4;
the source electrode of the MOS tube Q4 is used for externally connecting a power supply V2, and the drain electrode of the MOS tube Q4 is electrically connected with the drain electrode of the MOS tube Q1;
the capacitor C1 and the capacitor C2 are connected in parallel, the first ends of the capacitor C1 and the capacitor C2 are electrically connected with the drain electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q4, and the second ends of the capacitor C1 and the capacitor C2 are grounded;
based on the power supply switching circuit, the singlechip controls power supply conversion of the power supply V2 and the power supply V1 through GPIO pins.
Preferably, the singlechip is matched with the power supply switching circuit and is used for performing power supply switching as follows:
when the GPIO pin is pulled down by the singlechip and the MOS tube Q2 is closed, the grid electrode of the MOS tube Q1 is pulled to be high level by the R4 resistor, the MOS tube Q1 is closed, the GPIO is low level, the MOS tube Q4 is opened, and power is supplied to VOUT through the original power supply V2;
when the GPIO pin is pulled high by the singlechip, the MOS tube Q2 is turned on, the grid electrode of the MOS tube Q1 is pulled low, the MOS tube Q1 is turned on, the power is supplied to VOUT through the external power supply V1, the GPIO is in a high level, the MOS tube Q4 is turned off, and the power supply V2 is cut off;
the singlechip realizes the conversion from V2 to V1 power supply by pulling the GPIO high level high.
In a second aspect, the present invention provides a power supply switching method based on power supply insertion detection, which performs power supply switching by using a power supply switching circuit based on power supply insertion detection as described in any one of the first aspects, the method comprising the steps of:
based on a triode switch circuit serving as a power supply insertion detection circuit, the singlechip detects whether an external power supply is inserted or not through the power supply insertion detection circuit;
based on the power supply switching circuit comprising the MOS tube, the resistor and the capacitor, the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.
Preferably, the power supply insertion detection circuit includes a transistor Q3, a resistor R1, a resistor R2 and a resistor R3,
the first end of the resistor R1 IS connected with a power supply output voltage, the second end of the resistor R1 IS electrically connected with the collector of the triode Q3, and the collector of the triode Q3 IS electrically connected with an IS_V1_IN pin of the singlechip;
the first end of the resistor R2 is used for being externally connected with a plug-in power supply V1, and the second end of the resistor R2 is electrically connected with the base electrode of the triode Q3;
the first end of the resistor R3 is electrically connected with the second end of the resistor R2 and the base electrode of the triode Q3, and the second end of the resistor R3 and the emitter electrode of the triode Q3 are grounded;
the singlechip is matched with the power supply insertion detection circuit and is used for executing the following detection on whether an external power supply is inserted or not: when the external power supply V1 IS not inserted, the triode Q3 IS IN a high resistance state, the IS_V1_IN pin IS pulled up to the VOUT power supply by the resistor R1, and the IS_V1_IN pin IS IN a high level; when the external power supply V1 IS inserted, the triode Q3 IS turned on, and the triode Q3 and the IS_V1_IN pins are connected to the ground to generate a low-level signal; the singlechip judges whether the power supply of the external power supply V1 IS inserted or not by detecting the level change of the IS_V1_IN pin.
Preferably, the power supply switching circuit comprises an N-type MOS transistor Q2, a P-type MOS transistor Q1, a P-type MOS transistor Q4, a resistor R4, a capacitor C1 and a capacitor C2;
the source electrode of the MOS tube Q1 is used for externally connecting an inserted power supply V1;
the first end of the resistor R4 is connected with the output VOUT, and the second end of the resistor R4 is electrically connected with the grid electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q2;
the grid electrode of the MOS tube Q2 is used for being electrically connected with a GPIO pin of the singlechip and is electrically connected with the grid electrode of the MOS tube Q4;
the source electrode of the MOS tube Q4 is used for externally connecting a power supply V2, and the drain electrode of the MOS tube Q4 is electrically connected with the drain electrode of the MOS tube Q1;
the capacitor C1 and the capacitor C2 are connected in parallel, the first ends of the capacitor C1 and the capacitor C2 are electrically connected with the drain electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q4, and the second ends of the capacitor C1 and the capacitor C2 are grounded;
based on the power supply switching circuit, the singlechip controls power supply conversion of the power supply V2 and the power supply V1 through GPIO pins.
As a preferred alternative to this,
the singlechip is matched with the power supply switching circuit and is used for performing power supply switching as follows:
when the GPIO pin is pulled down by the singlechip and the MOS tube Q2 is closed, the grid electrode of the MOS tube Q1 is pulled to be high level by the R4 resistor, the MOS tube Q1 is closed, the GPIO is low level, the MOS tube Q4 is opened, and power is supplied to VOUT through the original power supply V2;
when the GPIO pin is pulled high by the singlechip, the MOS tube Q2 is turned on, the grid electrode of the MOS tube Q1 is pulled low, the MOS tube Q1 is turned on, the power is supplied to VOUT through the external power supply V1, the GPIO is in a high level, the MOS tube Q4 is turned off, and the power supply V2 is cut off;
the singlechip realizes the conversion from V2 to V1 power supply by pulling the GPIO high level high.
The power supply switching circuit and method based on the power supply insertion detection have the following advantages: the singlechip is used for detecting whether the power supply is inserted or not, and then the singlechip is used for controlling each system to sequentially switch the power supply, so that the stable switching of the power supply is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
The invention is further described below with reference to the accompanying drawings.
Fig. 1 is a schematic circuit diagram of a power supply insertion detection circuit in a power supply switching circuit based on power supply insertion detection in embodiment 1;
fig. 2 is a schematic circuit diagram of a power supply switching circuit in a power supply switching circuit based on power supply insertion detection in embodiment 1.
Detailed Description
The invention will be further described with reference to the accompanying drawings and specific examples, so that those skilled in the art can better understand the invention and implement it, but the examples are not meant to limit the invention, and the technical features of the embodiments of the invention and the examples can be combined with each other without conflict.
The embodiment of the invention provides a power supply switching circuit and a power supply switching method based on power supply insertion detection, which are used for solving the technical problem of how to realize stable power supply switching.
Example 1:
the invention relates to a power supply switching circuit based on power supply insertion detection, which comprises a singlechip, a power supply insertion detection circuit and a power supply switching circuit, wherein the power supply insertion detection circuit is a triode switch circuit, and the singlechip is used for detecting whether an external power supply is inserted or not through the power supply insertion detection circuit; the power supply switching circuit is composed of an MOS tube, a resistor and a capacitor, and the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.
The power supply insertion detection circuit comprises a triode Q3, a resistor R1, a resistor R2 and a resistor R3, wherein the first end of the resistor R1 IS used as an output end, the second end of the resistor R1 IS electrically connected with a collector of the triode Q3, and the collector of the triode Q3 IS electrically connected with an IS_V1_IN pin of the singlechip; the first end of the resistor R2 is used for being externally connected with a plug-in power supply V1, and the second end of the resistor R2 is electrically connected with the base electrode of the triode Q3; the first end of the resistor R3 is electrically connected with the second end of the resistor R2 and the base electrode of the triode Q3, and the second end of the resistor R3 and the emitter electrode of the triode Q3 are grounded.
The singlechip is matched with the power supply insertion detection circuit and is used for executing the following detection on whether an external power supply is inserted or not: when the external power supply V1 IS not inserted, the triode Q3 IS IN a high resistance state, the IS_V1_IN pin IS pulled up to the VOUT power supply by the resistor R1, and the IS_V1_IN pin IS IN a high level; when the external power supply V1 IS inserted, the triode Q3 IS turned on, and the triode Q3 and the IS_V1_IN pins are connected to the ground to generate a low-level signal; the singlechip judges whether the power supply of the external power supply V1 IS inserted or not by detecting the level change of the IS_V1_IN pin.
The power supply switching circuit comprises an N-type MOS tube Q2, a P-type MOS tube Q1, a P-type MOS tube Q4, a resistor R4, a capacitor C1 and a capacitor C2; the source electrode of the MOS tube Q1 is used for externally connecting an inserted power supply V1; the first end of the resistor R4 is connected with the output VOUT, and the second end of the resistor R4 is electrically connected with the grid electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q2; the grid electrode of the MOS tube Q2 is used for being electrically connected with a GPIO pin of the singlechip and is electrically connected with the grid electrode of the MOS tube Q4; the source electrode of the MOS tube Q4 is used for externally connecting a power supply V2, and the drain electrode of the MOS tube Q4 is electrically connected with the drain electrode of the MOS tube Q1; the capacitor C1 and the capacitor C2 are connected in parallel, the first ends of the capacitor C1 and the capacitor C2 are electrically connected with the drain electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q4, and the second ends of the capacitor C1 and the capacitor C2 are grounded; based on the power supply switching circuit, the singlechip controls power supply conversion of the power supply V2 and the power supply V1 through GPIO pins.
In this implementation, the singlechip is matched with the power switching power for performing the following power switching:
(1) When the GPIO pin is pulled down by the singlechip and the MOS tube Q2 is closed, the grid electrode of the MOS tube Q1 is pulled to be high level by the R4 resistor, the MO tube Q1 is closed, the GPIO is low level, the MOS tube Q4 is opened, and power is supplied to VOUT through the original power supply V2;
(2) When the GPIO pin is pulled high by the singlechip, the MOS tube Q2 is turned on, the grid electrode of the MOS tube Q1 is pulled low, the MOS tube Q1 is turned on, the power is supplied to VOUT through the external power supply V1, the GPIO is in a high level, the MOS tube Q4 is turned off, and the power supply V2 is cut off;
(3) The singlechip realizes the conversion from V2 to V1 power supply by pulling the GPIO high level high.
When the power supply automatic switching circuit is used for switching the power supply, a plurality of ms are needed from the closing state to the conduction state of the switch MOS tube, so that the power supply switching time difference occurs, and the system power supply is insufficient, so that the problem occurs. The common solution is to add a capacitor with larger capacitance, the size of the capacitor is related to the factors of the type selection of the MOS tube and the power consumption of the circuit, and when the circuit power is larger, the unstable condition can also occur. In the embodiment, the singlechip is used for detecting whether the power supply is inserted or not, and then the singlechip is used for controlling each system to sequentially switch the power supply, so that the stable switching of the power supply is realized.
Example 2:
the invention discloses a power supply switching method based on power supply insertion detection, which is used for switching power supply by the method disclosed in embodiment 1.
The method comprises the following steps:
(1) Based on a triode switch circuit serving as a power supply insertion detection circuit, the singlechip detects whether an external power supply is inserted or not through the power supply insertion detection circuit;
(2) Based on the power supply switching circuit comprising the MOS tube, the resistor and the capacitor, the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.
The power supply insertion detection circuit comprises a triode Q3, a resistor R1, a resistor R2 and a resistor R3, wherein the first end of the resistor R1 IS used as an output end, the second end of the resistor R1 IS electrically connected with a collector of the triode Q3, and the collector of the triode Q3 IS electrically connected with an IS_V1_IN pin of the singlechip; the first end of the resistor R2 is used for being externally connected with a plug-in power supply V1, and the second end of the resistor R2 is electrically connected with the base electrode of the triode Q3; the first end of the resistor R3 is electrically connected with the second end of the resistor R2 and the base electrode of the triode Q3, and the second end of the resistor R3 and the emitter electrode of the triode Q3 are grounded.
The singlechip is matched with the power supply insertion detection circuit to detect whether an external power supply is inserted or not as follows: when the external power supply V1 IS not inserted, the triode Q3 IS IN a high resistance state, the IS_V1_IN pin IS pulled up to the VOUT power supply by the resistor R1, and the IS_V1_IN pin IS IN a high level; when the external power supply V1 IS inserted, the triode Q3 IS turned on, and the triode Q3 and the IS_V1_IN pins are connected to the ground to generate a low-level signal; the singlechip judges whether the power supply of the external power supply V1 IS inserted or not by detecting the level change of the IS_V1_IN pin.
The power supply switching circuit comprises an N-type MOS tube Q2, a P-type MOS tube Q1, a P-type MOS tube Q4, a resistor R4, a capacitor C1 and a capacitor C2; the source electrode of the MOS tube Q1 is used for externally connecting an inserted power supply V1; the first end of the resistor R4 is connected with the output VOUT, and the second end of the resistor R4 is electrically connected with the grid electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q2; the grid electrode of the MOS tube Q2 is used for being electrically connected with a GPIO pin of the singlechip and is electrically connected with the grid electrode of the MOS tube Q4; the source electrode of the MOS tube Q4 is used for externally connecting a power supply V2, and the drain electrode of the MOS tube Q4 is electrically connected with the drain electrode of the MOS tube Q1; the capacitor C1 and the capacitor C2 are connected in parallel, the first ends of the capacitor C1 and the capacitor C2 are electrically connected with the drain electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q4, and the second ends of the capacitor C1 and the capacitor C2 are grounded; based on the power supply switching circuit, the singlechip controls power supply conversion of the power supply V2 and the power supply V1 through GPIO pins.
In this embodiment, the singlechip cooperates with the power supply switching power to perform power supply switching as follows:
(1) When the GPIO pin is pulled down by the singlechip and the MOS tube Q2 is closed, the grid electrode of the MOS tube Q1 is pulled to be high level by the R4 resistor, the MO tube Q1 is closed, the GPIO is low level, the MOS tube Q4 is opened, and power is supplied to VOUT through the original power supply V2;
(2) When the GPIO pin is pulled high by the singlechip, the MOS tube Q2 is turned on, the grid electrode of the MOS tube Q1 is pulled low, the MOS tube Q1 is turned on, the power is supplied to VOUT through the external power supply V1, the GPIO is in a high level, the MOS tube Q4 is turned off, and the power supply V2 is cut off;
(3) The singlechip realizes the conversion from V2 to V1 power supply by pulling the GPIO high level high.
While the invention has been illustrated and described in detail in the drawings and in the preferred embodiments, the invention is not limited to the disclosed embodiments, but it will be apparent to those skilled in the art that many more embodiments of the invention can be made by combining the means of the various embodiments described above and still fall within the scope of the invention.

Claims (8)

1. The power supply switching circuit based on the power supply insertion detection is characterized by comprising a singlechip, a power supply insertion detection circuit and a power supply switching circuit;
the power supply insertion detection circuit is a triode switch circuit, and the singlechip is used for detecting whether an external power supply is inserted or not through the power supply insertion detection circuit;
the power supply switching circuit is composed of an MOS tube, a resistor and a capacitor, and the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.
2. The power supply switching circuit based on power supply insertion detection according to claim 1, wherein the power supply insertion detection circuit includes a transistor Q3, a resistor R1, a resistor R2, and a resistor R3,
the first end of the resistor R1 IS connected with a power supply output voltage, the second end of the resistor R1 IS electrically connected with the collector of the triode Q3, and the collector of the triode Q3 IS electrically connected with an IS_V1_IN pin of the singlechip;
the first end of the resistor R2 is used for being externally connected with a plug-in power supply V1, and the second end of the resistor R2 is electrically connected with the base electrode of the triode Q3;
the first end of the resistor R3 is electrically connected with the second end of the resistor R2 and the base electrode of the triode Q3, and the second end of the resistor R3 and the emitter electrode of the triode Q3 are grounded;
the singlechip is matched with the power supply insertion detection circuit and is used for executing the following detection on whether an external power supply is inserted or not: when the external power supply V1 IS not inserted, the triode Q3 IS IN a high resistance state, the IS_V1_IN pin IS pulled up to the VOUT power supply by the resistor R1, and the IS_V1_IN pin IS IN a high level; when the external power supply V1 IS inserted, the triode Q3 IS turned on, and the triode Q3 and the IS_V1_IN pins are connected to the ground to generate a low-level signal; the singlechip judges whether the power supply of the external power supply V1 IS inserted or not by detecting the level change of the IS_V1_IN pin.
3. The power supply switching circuit based on power supply insertion detection according to claim 1, wherein the power supply switching circuit comprises an N-type MOS transistor Q2, a P-type MOS transistor Q1, a P-type MOS transistor Q4, a resistor R4, a capacitor C1 and a capacitor C2;
the source electrode of the MOS tube Q1 is used for externally connecting an inserted power supply V1;
the first end of the resistor R4 is connected with the output VOUT, and the second end of the resistor R4 is electrically connected with the grid electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q2;
the grid electrode of the MOS tube Q2 is used for being electrically connected with a GPIO pin of the singlechip and is electrically connected with the grid electrode of the MOS tube Q4;
the source electrode of the MOS tube Q4 is used for externally connecting a power supply V2, and the drain electrode of the MOS tube Q4 is electrically connected with the drain electrode of the MOS tube Q1;
the capacitor C1 and the capacitor C2 are connected in parallel, the first ends of the capacitor C1 and the capacitor C2 are electrically connected with the drain electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q4, and the second ends of the capacitor C1 and the capacitor C2 are grounded;
based on the power supply switching circuit, the singlechip controls power supply conversion of the power supply V2 and the power supply V1 through GPIO pins.
4. The power supply switching circuit based on power supply insertion detection as claimed in claim 3, wherein the single-chip microcomputer is matched with the power supply switching circuit for performing power supply switching as follows:
when the GPIO pin is pulled down by the singlechip and the MOS tube Q2 is closed, the grid electrode of the MOS tube Q1 is pulled to be high level by the R4 resistor, the MOS tube Q1 is closed, the GPIO is low level, the MOS tube Q4 is opened, and power is supplied to VOUT through the original power supply V2;
when the GPIO pin is pulled high by the singlechip, the MOS tube Q2 is turned on, the grid electrode of the MOS tube Q1 is pulled low, the MOS tube Q1 is turned on, the power is supplied to VOUT through the external power supply V1, the GPIO is in a high level, the MOS tube Q4 is turned off, and the power supply V2 is cut off;
the singlechip realizes the conversion from V2 to V1 power supply by pulling the GPIO high level high.
5. A power supply switching method based on power supply insertion detection, characterized in that power supply switching is performed by a power supply switching circuit based on power supply insertion detection as claimed in any one of claims 1 to 4, the method comprising the steps of:
based on a triode switch circuit serving as a power supply insertion detection circuit, the singlechip detects whether an external power supply is inserted or not through the power supply insertion detection circuit;
based on the power supply switching circuit comprising the MOS tube, the resistor and the capacitor, the singlechip is used for carrying out power supply switching through the power supply switching circuit, and the power supply switching flow is as follows: the power supply of the external equipment is switched firstly, and then the power supply of the singlechip is switched.
6. The power supply switching method based on the power supply insertion detection as claimed in claim 5, wherein the power supply insertion detection circuit includes a transistor Q3, a resistor R1, a resistor R2, and a resistor R3,
the first end of the resistor R1 IS connected with a power supply output voltage, the second end of the resistor R1 IS electrically connected with the collector of the triode Q3, and the collector of the triode Q3 IS electrically connected with an IS_V1_IN pin of the singlechip;
the first end of the resistor R2 is used for being externally connected with a plug-in power supply V1, and the second end of the resistor R2 is electrically connected with the base electrode of the triode Q3;
the first end of the resistor R3 is electrically connected with the second end of the resistor R2 and the base electrode of the triode Q3, and the second end of the resistor R3 and the emitter electrode of the triode Q3 are grounded;
the singlechip is matched with the power supply insertion detection circuit and is used for executing the following detection on whether an external power supply is inserted or not: when the external power supply V1 IS not inserted, the triode Q3 IS IN a high resistance state, the IS_V1_IN pin IS pulled up to the VOUT power supply by the resistor R1, and the IS_V1_IN pin IS IN a high level; when the external power supply V1 IS inserted, the triode Q3 IS turned on, and the triode Q3 and the IS_V1_IN pins are connected to the ground to generate a low-level signal; the singlechip judges whether the power supply of the external power supply V1 IS inserted or not by detecting the level change of the IS_V1_IN pin.
7. The power supply switching method based on power supply insertion detection according to claim 5, wherein the power supply switching circuit comprises an N-type MOS transistor Q2, a P-type MOS transistor Q1, a P-type MOS transistor Q4, a resistor R4, a capacitor C1 and a capacitor C2;
the source electrode of the MOS tube Q1 is used for externally connecting an inserted power supply V1;
the first end of the resistor R4 is connected with the output VOUT, and the second end of the resistor R4 is electrically connected with the grid electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q2;
the grid electrode of the MOS tube Q2 is used for being electrically connected with a GPIO pin of the singlechip and is electrically connected with the grid electrode of the MOS tube Q4;
the source electrode of the MOS tube Q4 is used for externally connecting a power supply V2, and the drain electrode of the MOS tube Q4 is electrically connected with the drain electrode of the MOS tube Q1;
the capacitor C1 and the capacitor C2 are connected in parallel, the first ends of the capacitor C1 and the capacitor C2 are electrically connected with the drain electrode of the MOS tube Q1 and the drain electrode of the MOS tube Q4, and the second ends of the capacitor C1 and the capacitor C2 are grounded;
based on the power supply switching circuit, the singlechip controls power supply conversion of the power supply V2 and the power supply V1 through GPIO pins.
8. The power supply switching method based on power supply insertion detection according to claim 5, wherein the singlechip is matched with the power supply switching circuit and is used for performing power supply switching as follows:
when the GPIO pin is pulled down by the singlechip and the MOS tube Q2 is closed, the grid electrode of the MOS tube Q1 is pulled to be high level by the R4 resistor, the MOS tube Q1 is closed, the GPIO is low level, the MOS tube Q4 is opened, and power is supplied to VOUT through the original power supply V2;
when the GPIO pin is pulled high by the singlechip, the MOS tube Q2 is turned on, the grid electrode of the MOS tube Q1 is pulled low, the MOS tube Q1 is turned on, the power is supplied to VOUT through the external power supply V1, the GPIO is in a high level, the MOS tube Q4 is turned off, and the power supply V2 is cut off;
the singlechip realizes the conversion from V2 to V1 power supply by pulling the GPIO high level high.
CN202311248235.8A 2023-09-26 2023-09-26 Power supply switching circuit and method based on power supply insertion detection Pending CN117277539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311248235.8A CN117277539A (en) 2023-09-26 2023-09-26 Power supply switching circuit and method based on power supply insertion detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311248235.8A CN117277539A (en) 2023-09-26 2023-09-26 Power supply switching circuit and method based on power supply insertion detection

Publications (1)

Publication Number Publication Date
CN117277539A true CN117277539A (en) 2023-12-22

Family

ID=89200426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311248235.8A Pending CN117277539A (en) 2023-09-26 2023-09-26 Power supply switching circuit and method based on power supply insertion detection

Country Status (1)

Country Link
CN (1) CN117277539A (en)

Similar Documents

Publication Publication Date Title
CN102780199A (en) Overcurrent protection circuit and lamp
CN101860188A (en) Switch power supply circuit
CN204189161U (en) A kind of hot plug-pull control system
CN204794681U (en) Reduce DC -DC circuit that restarts repeatedly when falling electricity
CN208353213U (en) A kind of Switching Power Supply start-up circuit
CN204928783U (en) Switch control circuit
CN105897240A (en) Single-button soft on-off circuit with hardware forced power-off function
CN207265995U (en) It is a kind of to use the key switch electromechanics road with ena-bung function linear voltage regulator
CN201025702Y (en) Delay circuit
CN206270863U (en) Cmos data remove device and computer
CN210780130U (en) Power-off control circuit
CN103108081B (en) Subscriber identity module (SIM) card detection control device of mobile terminal
CN210835664U (en) Switching on and switching off circuit and control system
CN117277539A (en) Power supply switching circuit and method based on power supply insertion detection
CN204859144U (en) Auto -lock switch circuit
CN205232185U (en) Power supply switch control circuit
CN203537357U (en) Simple time delay switching circuit
CN201004206Y (en) Hard disk power control circuit
CN101739378B (en) Driving circuit of EIB (European installation bus) bus transmitting device
CN207490898U (en) The logic level transition device and amplifying circuit of dual power supply amplifier
CN203813867U (en) Reset circuit and television set
CN108900081A (en) A kind of circuit of control negative pressure output
CN206099293U (en) High voltage input protection circuit
CN208707613U (en) One-key switch electromechanics road and electric terminal equipment
CN207530796U (en) A kind of automatic reset circuit for controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination