CN110912224B - Charging device and charging device control method - Google Patents

Charging device and charging device control method Download PDF

Info

Publication number
CN110912224B
CN110912224B CN201911107550.2A CN201911107550A CN110912224B CN 110912224 B CN110912224 B CN 110912224B CN 201911107550 A CN201911107550 A CN 201911107550A CN 110912224 B CN110912224 B CN 110912224B
Authority
CN
China
Prior art keywords
charging
voltage
control module
usb interface
detection circuit
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.)
Active
Application number
CN201911107550.2A
Other languages
Chinese (zh)
Other versions
CN110912224A (en
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.)
Ningbo Gongniu Digital Technology Co Ltd
Original Assignee
Ningbo Gongniu Digital Technology 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 Ningbo Gongniu Digital Technology Co Ltd filed Critical Ningbo Gongniu Digital Technology Co Ltd
Priority to CN201911107550.2A priority Critical patent/CN110912224B/en
Publication of CN110912224A publication Critical patent/CN110912224A/en
Application granted granted Critical
Publication of CN110912224B publication Critical patent/CN110912224B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0029Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
    • H02J7/0036Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits using connection detecting circuits
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0013Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries acting upon several batteries simultaneously or sequentially
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The invention is suitable for the technical field of charging, and provides a charging device and a charging device control method, wherein the charging device comprises: the device comprises a power supply, a voltage output circuit, a control module and a USB interface; the detection circuit comprises a plugging detection circuit and an MOS tube connected with the plugging detection circuit in parallel; when the MOS tube is in a disconnected state, the control module detects that the voltage at two ends of the plug detection circuit is greater than a first preset value, the control module judges that the charging equipment is inserted into the USB interface and controls the MOS tube to be conducted, and the USB interface outputs the charging voltage to charge the charging equipment; when the MOS tube is in a conducting state, the control module controls the MOS tube to reduce the driving voltage at preset time intervals, and when the control module detects that the voltage at two ends of the plugging detection circuit is smaller than a second preset value, the control module judges that the charging equipment is plugged out of the USB interface and controls the MOS tube to be disconnected, and stops the USB interface from outputting the charging voltage. The charging device can accurately detect whether the charging equipment is plugged into or pulled out of the USB interface, has high detection accuracy, and effectively avoids the occurrence of misjudgment.

Description

Charging device and charging device control method
Technical Field
The invention relates to the technical field of charging, in particular to a charging device and a charging device control method.
Background
Along with the continuous development of electronic equipment, the function of electronic equipment is also perfect, and electronic equipment can supply the function that the user used more and more, but electronic equipment's power consumption is also increasing constantly, and the user can often meet the problem that battery power is not enough in the in-process of using electronic equipment, consequently more and more people need charge electronic equipment with the help of charging device.
In the prior art, a charging device on the market usually has one or more USB interfaces for charging a charging device, and when the charging device detects that the charging device is plugged in, the charging device outputs a charging voltage to the USB interfaces for charging the charging device, and when the charging device detects that the USB interface is plugged out, the charging device stops outputting the charging voltage from the USB interfaces. However, the conventional charging device usually detects whether the charging device is plugged into or unplugged from the USB interface by using a voltage drop method when the charging device is plugged into the USB interface, and when a Lightning data line (an apple-phone data line) of a built-in chip is plugged into the USB interface, the charging device is also dropped by the voltage drop method and is erroneously determined that the charging device is plugged into the USB interface; and when the apple mobile phone is charged, if the apple mobile phone is only pulled out but the data line of the apple mobile phone is not pulled out, the charging equipment is still judged to be in a charging state by mistake, the charging voltage is output to the data line for a long time, the data line is easy to damage, and energy is wasted. Therefore, the charging device in the prior art has low detection accuracy for plugging or unplugging the USB interface into or from the charging device, and is prone to causing misjudgment.
Disclosure of Invention
The invention provides a charging device, and aims to solve the problem that the charging device in the prior art is low in detection accuracy when a USB interface is plugged into or pulled out of a charging device, and is prone to causing misjudgment.
The present invention is achieved as described above, and a charging device includes: the device comprises a power supply, a voltage output circuit connected with the power supply, a control module electrically connected with the power supply, a detection circuit connected with the voltage output circuit and the control module, and a USB interface connected with the detection circuit;
the detection circuit comprises a plug detection circuit connected with the voltage output circuit and the USB interface, and an MOS (metal oxide semiconductor) tube which is connected with the plug detection circuit in parallel and is used for switching on or off the voltage output circuit and the USB interface, the MOS tube is connected with the control module, and the plug detection circuit forms loop current when charging equipment is inserted into the USB interface and generates voltage at two ends of the plug detection circuit;
when the MOS tube is in a disconnected state, when the control module detects that the voltage at two ends of the plugging detection circuit is greater than a first preset value, the control module judges that a charging device is plugged into the USB interface and controls the MOS tube to be conducted so that the USB interface outputs a charging voltage to charge the charging device;
when the MOS tube is in a conducting state, the control module controls the MOS tube to reduce the driving voltage at intervals of preset time and detects the voltage at two ends of the plug detection circuit, and when the control module detects that the voltage at two ends of the plug detection circuit is smaller than a second preset value, the control module judges that the charging equipment is plugged out of the USB interface and controls the MOS tube to be kept disconnected, so that the USB interface stops outputting the charging voltage.
Preferably, the number of the USB interfaces and the number of the detection circuits are at least two, and each USB interface is correspondingly connected with one detection circuit.
Preferably, the charging device further comprises a charging protocol module respectively connected to the voltage output circuit and the control module, and the charging protocol module is simultaneously connected to each USB interface;
when the control module detects that the charging equipment is inserted into one USB interface, the control module sends a first control signal to the charging protocol module, and the charging protocol module receives the first control signal and controls the voltage output circuit to output charging voltage corresponding to the charging equipment to the USB interface according to the charging voltage of the charging equipment;
when the control module detects that two or more than two USB interfaces are inserted into the charging device, the control module sends a second control signal to the charging protocol module, and the charging protocol module receives the second control signal and controls the voltage output circuit to output a preset charging voltage to the USB interfaces.
Preferably, the plug detection circuit comprises a detection resistor connected with the MOS tube in parallel, one end of the detection resistor is connected with the USB interface and the source electrode of the MOS tube, the other end of the detection resistor is grounded and connected with the drain electrode of the MOS tube, and the grid electrode of the MOS tube is connected with the control module.
Preferably, the voltage output circuit includes a resistor R7 and a resistor R8, one end of the resistor R7 is connected to the power supply, the other end of the resistor R8 is connected to one end of the resistor R7, the other end of the resistor R8 is grounded, and the pin FB of the charging protocol module is connected between the resistor R7 and the resistor R8.
Preferably, the charging device further comprises a voltage stabilizing module, and the control module is connected with the power supply through the voltage stabilizing module.
Preferably, the MOS transistor is connected to the control module through a current-limiting resistor.
The invention also provides a charging device control method, which is applied to the charging device and comprises the following steps:
when the MOS tube is in a disconnected state, the control module detects the voltage at two ends of the plugging detection circuit;
the control module judges whether the voltage at two ends of the plugging detection circuit is greater than a first preset value or not; if yes, entering the next step; if not, returning to the previous step;
the control module judges that a charging device is inserted into the USB interface and controls the MOS tube to be conducted so that the USB interface outputs charging voltage to charge the charging device;
when the MOS tube is in a conducting state, the control module controls the MOS tube to reduce the driving voltage and detects the voltage at two ends of the plugging detection circuit at preset time intervals;
the control module judges whether the voltage at the two ends of the plugging detection circuit is smaller than a second preset value; if yes, entering the next step; if not, returning to the previous step;
the control module judges that the charging equipment is pulled out of the USB interface and controls the MOS tube to be kept disconnected, so that the USB interface stops outputting the charging voltage.
Preferably, the number of the USB interfaces and the number of the detection circuits are at least two, and each USB interface is correspondingly connected with one detection circuit.
Preferably, the charging device further comprises a charging protocol module respectively connected to the voltage output circuit and the control module, and the charging protocol module is simultaneously connected to each USB interface; the control module judges that a charging device is inserted into the USB interface and controls the MOS tube to be conducted, so that the USB interface outputs charging voltage to charge the charging device, and the control module comprises:
when the control module judges that the charging equipment is inserted into one USB interface, the control module sends a first control signal to the charging protocol module, and the charging protocol module receives the first control signal and controls the voltage output circuit to output charging voltage corresponding to the charging equipment to the USB interface according to the charging voltage of the charging equipment;
when the control module judges that two or more than two USB interfaces are inserted into the charging device, the control module sends a second control signal to the charging protocol module, and the charging protocol module receives the second control signal and controls the voltage output circuit to output a preset charging voltage to the USB interfaces.
According to the charging device, the plug detection circuit connected with the voltage output circuit and the USB interface and the MOS tube connected with the plug detection circuit in parallel and used for conducting or disconnecting the voltage output circuit and the USB interface are arranged, the principle that the plug detection circuit forms loop current when the charging device is plugged into the USB interface and generates voltage at two ends of the plug detection circuit is utilized, the control module detects whether the voltage at two ends of the plug detection circuit is larger than a first preset value when the MOS tube is in a disconnected state, and then whether the charging device is plugged into the USB interface can be judged, so that the situation that only a Lightning data line of a built-in chip is plugged into the USB interface and is judged by mistake as the charging device is plugged into the USB interface is avoided, and the accuracy of detecting whether the charging device is plugged into the USB interface is improved. When the MOS tube is in a conducting state, the control module controls the MOS tube to reduce the driving voltage at preset time intervals so as to generate a voltage difference at two ends of the plug detection circuit, and the control module detects whether the voltage at the two ends of the plug detection circuit is smaller than a second preset value so as to judge whether the charging equipment is pulled out. When the control module detects that the voltage at the two ends of the plugging detection circuit is smaller than the second preset value, the control module judges that the charging equipment is plugged out of the USB interface and drives the MOS tube to be kept disconnected to stop the USB interface from outputting the charging voltage, so that whether the charging equipment is plugged out of the USB interface or not can be accurately detected, the situation that a user is mistakenly judged that the charging equipment is not plugged out when the user only plugs out the apple mobile phone but does not plug out the Lightning data line is avoided, and the charging voltage is timely stopped being output by the USB interface after the charging equipment is plugged out of the USB interface.
Drawings
Fig. 1 is a block diagram of a charging device according to an embodiment of the present invention;
fig. 2 is a circuit connection diagram of a USB interface and a circuit in the charging device according to the embodiment of the present invention;
fig. 3 is a circuit diagram of a charging device according to an embodiment of the present invention;
fig. 4 is a graph showing a variation curve of the current Ids passing through the MOS transistor and the voltage Vab at two ends of the plugging detection circuit under different driving voltages VGS in the charging device according to the embodiment of the present invention;
fig. 5 is a flowchart of a control method of a charging device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
According to the charging device provided by the embodiment of the invention, by arranging the plugging detection circuit for connecting the voltage output circuit and the USB interface and the MOS tube which is connected with the plugging detection circuit in parallel and is used for connecting or disconnecting the voltage output circuit and the USB interface, the principle that the plugging detection circuit forms loop current when the charging equipment is plugged into the USB interface and generates voltage at two ends of the plugging detection circuit is utilized, and the control module detects whether the voltage at two ends of the plugging detection circuit is greater than a first preset value when the MOS tube is in a disconnected state, so that whether the charging equipment is plugged into the USB interface can be judged, and the accuracy for detecting whether the charging equipment is plugged into the USB interface is improved. When the MOS tube is in a conducting state, the driving voltage of the MOS tube is reduced at every interval preset time through the control module, so that the impedance of the MOS tube is increased, when the control module detects that the voltage at two ends of the plug detection circuit is smaller than a second preset value, the control module judges that the charging device extracts the USB interface and controls the MOS tube to be disconnected so as to stop the USB interface from outputting the charging voltage, and therefore whether the charging device extracts the USB interface or not can be accurately detected, and the charging device can stop the USB interface from outputting the charging voltage in time after extracting the USB interface.
Referring to fig. 1 to fig. 3, an embodiment of the invention provides a charging device, including: the device comprises a power supply 1, a voltage output circuit 2 connected with the power supply 1, a control module 3 electrically connected with the power supply 1, a detection circuit 4 connected with the voltage output circuit 2 and the control module 3, and a USB interface 5 connected with the detection circuit 4.
Referring to fig. 2, the detection circuit 4 includes a plugging detection circuit 41 connecting the voltage output circuit 2 and the USB interface 5, and a MOS transistor 42 connected in parallel with the plugging detection circuit 41 and used for turning on or off the voltage output circuit 2 and the USB interface 5, where the MOS transistor 42 is connected to the control module 3, and the plugging detection circuit 41 forms a loop current when the charging device is plugged into the USB interface 5, and generates a voltage at two ends of the plugging detection circuit 41. The charging equipment can be a mobile phone, a Bluetooth headset, a tablet computer and the like.
When the MOS transistor 42 is in the off state, when the control module 3 detects that the voltage at the two ends of the plug detection circuit 41 is greater than the first preset value, the control module 3 determines that the charging device is plugged into the USB interface 5 and controls the MOS transistor 42 to be turned on, so that the USB interface 5 outputs the charging voltage to charge the charging device.
When the MOS transistor 42 is in the on state, the control module 3 controls the MOS transistor 42 to reduce the driving voltage at preset intervals, and detects the voltages at the two ends of the plugging detection circuit 41, and when the control module 3 detects that the voltages at the two ends of the plugging detection circuit 41 are smaller than the second preset value, the control module 3 determines that the charging device is plugged out of the USB interface 5 and controls the MOS transistor 42 to be kept off, so that the USB interface 5 stops outputting the charging voltage.
In the embodiment of the present invention, the control module 3 may be a single chip or an analog chip. In this embodiment, the control module 3 is a single chip microcomputer. The control module 3 inputs a low level to the MOS transistor 42 at every predetermined time, so that the MOS transistor 42 is turned off at every predetermined time to reduce the driving voltage of the MOS transistor 42. The characteristic that the driving voltage of the MOS transistor 42 is gradually reduced in the closing process is utilized to reduce the driving voltage of the MOS transistor 42, and during the reduction of the driving voltage of the MOS transistor 42, the impedance of the MOS transistor 42 is gradually increased, so that a voltage difference is generated between two ends of the plug detection circuit 41, if the charging device pulls out the USB interface 5, the voltage between two ends of the plug detection circuit 41 will be smaller than the second preset value, if the charging device does not pull out the USB interface 5, the voltage between two ends of the plug detection circuit 41 will be greater than or equal to the second preset value, and therefore the control module 3 can judge whether the charging device pulls out the USB interface 5 by detecting whether the voltage between two ends of the plug detection circuit 41 is smaller than the second preset value.
The interval time of the MOS tube 42 being closed by the control module 3 at each time can be set according to actual needs, so as to ensure that the driving voltage when the MOS tube 42 is closed at each time is not reduced to zero, so that the MOS tube 42 is not completely closed, and the control module 3 can be ensured to accurately detect the voltages at the two ends of the plug detection circuit 41, thereby accurately judging whether the charging device is pulled out. If the driving voltage of the MOS transistor 42 is not reduced at preset intervals by the control module 3, the voltage at both ends of the MOS transistor 42 approaches zero when the MOS transistor 42 is turned on, and the plug detection circuit 41 is in a short-circuit state, so that the voltage at both ends of the plug detection circuit 41 cannot be detected.
In this embodiment, when the MOS transistor 42 is in the on state, the control module 3 turns off the MOS transistor 42 every 2 seconds, the power supply voltage of the power supply 1 is 5V, and the initial driving voltage of the MOS transistor 42 is 5V. During the closing process of the MOS transistor 42, the driving voltage of the MOS transistor 42 gradually decreases from 5V, and during this process, the control module 3 detects the voltage across the plug detection circuit 41. When the control module 3 detects that the voltage at the two ends of the plug detection circuit 41 is smaller than the second preset value, the control module 3 determines that the charging device is plugged out of the USB interface 5, and at this time, the control module 3 continuously outputs a low level to the MOS transistor 42, so as to control the MOS transistor 42 to be kept disconnected, so that the USB interface 5 stops outputting the charging voltage; if the control module 3 detects that the voltages at the two ends of the plug detection circuit 41 are greater than or equal to the second preset value in the closing process of the MOS transistor 42, the control module 3 determines that the charging device is not plugged out of the USB interface 5, and at this time, the control module 3 controls the MOS transistor 42 to be turned on again and turns off the MOS transistor 42 at preset intervals to reduce the driving voltage of the MOS transistor 42, so as to detect whether the charging device is plugged out of the USB interface 5 in real time.
According to the charging device provided by the embodiment of the invention, by arranging the plugging detection circuit 41 which is connected with the voltage output circuit 2 and the USB interface 5 and the MOS tube 42 which is connected with the plugging detection circuit 41 in parallel and is used for conducting or disconnecting the voltage output circuit 2 and the USB interface 5, the plugging detection circuit 41 forms loop current when the charging device is plugged into the USB interface 5, and voltage is generated at two ends of the plugging detection circuit 41. When the MOS transistor 42 is in the off state, the control module 3 detects whether the voltage at the two ends of the plug detection circuit 41 is greater than the first preset value, so as to determine whether the charging device is plugged into the USB interface 5, thereby avoiding a situation that only the Lightning data line of the built-in chip is plugged into the USB interface 5 and the charging device is mistakenly determined to be plugged into the USB interface 5, and improving the accuracy of detecting whether the charging device is plugged into the USB interface 5; when the MOS transistor 42 is in a conducting state, the driving voltage of the MOS transistor 42 is reduced at preset time intervals by the control module 3 to generate a voltage difference at two ends of the plug detection circuit 41, and whether the voltage at two ends of the plug detection circuit 41 is smaller than a second preset value is detected by the control module 3 to determine whether the charging device is plugged out. When the control module 3 detects that the voltage at the two ends of the plugging detection circuit 41 is smaller than the second preset value, the control module 3 judges that the charging device is plugged out of the USB interface 5 and controls the MOS tube 42 to be disconnected to stop the USB interface 5 from outputting the charging voltage, so that whether the charging device is plugged out of the USB interface 5 can be accurately detected, and it is avoided that a user is mistakenly judged that the charging device is not plugged out when the user only plugs out the iphone but does not plug out the iphone data line, so that the USB interface 5 is timely stopped from outputting the charging voltage after the charging device plugs out the USB interface 5.
In the embodiment of the present invention, the MOS transistor 42 is a PMOS transistor or an NMOS transistor. The MOS transistor 42 is connected to the control module 3 through a current limiting resistor, so as to limit the current passing through the MOS transistor 42 and prevent the MOS transistor 42 from being damaged.
As an embodiment of the present invention, the plugging detection circuit 41 includes a detection resistor R0 connected in parallel to the MOS transistor 42, one end of the detection resistor R0 is connected to the USB interface 5 and the source of the MOS transistor 42, the other end of the detection resistor R0 is grounded and connected to the drain of the MOS transistor 42, and the gate of the MOS transistor 42 is connected to the control module 3. Since the MOS transistor 42 is connected in parallel with the detection resistor R0, the voltage across the plug detection circuit 41 is the voltage across the detection resistor R0. In addition, the plugging detection circuit 41 may be provided with two or more detection resistors connected in series.
In this embodiment, the gate of the MOS transistor 42 is connected to the port GateX of the control module 3, and the MOS transistor 42 is connected to the voltage output circuit 2 and the USB interface 5, so as to control the on/off of the MOS transistor 42, and control the on/off of the output voltage of the USB interface 5. The MOS tube 42 is controlled to be turned on when the port GateX of the control module 3 outputs a high level, and the MOS tube 42 is controlled to be turned off when the port GateX of the control module 3 outputs a low level, so that the MOS tube 42 is turned off. One end of the detection resistor R0 is connected to the pin GND of the USB interface 5 and is connected to the source of the MOS transistor 42 to form a node a, the other end of the detection resistor R0 is connected to the GND end of the voltage output circuit 2 and is connected to the drain of the MOS transistor 42 to form a node b, the pin VCC of the USB interface 5 is connected to the Vbus end of the voltage output circuit 2, and the voltage at the two ends of the plug detection circuit 41 is the voltage Vab between the node a and the node b.
In this embodiment, when the USB interface 5 is not inserted into the charging device, the plugging detection circuit 41 does not form a path, the plugging detection circuit 41 does not form a current, and the voltage Vab between the two ends of the plugging detection circuit 41 is zero. When a charging device is plugged into the USB interface 5, the plugging detection circuit 41 forms a path with the USB interface 5 via a data line, and a loop current Iab passing through the plugging detection circuit 41 is formed. At this time, since the MOS transistor 42 is not turned on, the current passes through the detection resistors R0, vab = Iab R0 of the plug detection circuit 41, if the Lightning data line (the data line of the iphone) of the built-in chip is inserted into the USB interface 5, the current is drawn to be less than 1mA, and if the charging device such as the mobile phone/the bluetooth headset is inserted into the USB interface 5, the current is drawn to be at least greater than 10 mA. Because the resistance value of the detection resistor R0 is fixed, only the first preset value of Vab needs to be set, and whether the USB interface 5 is inserted into the charging equipment can be judged, so that whether the charging equipment is inserted into the USB interface can be reliably identified, and misjudgment is avoided.
The first preset value can be set according to the resistance of the detection resistor R0, and if the resistance of the detection resistor R0 is 200 ohms, the first preset value is set to 0.3V. When the Lightning data line is inserted into the USB interface 5, the current passing through the detecting resistor R0 is smaller than 1mA, and therefore the voltage at the two ends of the detecting resistor R0 is smaller than 0.2V, and therefore when the Lightning data line is inserted into the USB interface 5, the control module 3 can detect that the voltage Vab at the two ends of the plugging detecting circuit 41 is smaller than 0.3V, so that it can be accurately determined that no charging device is inserted into the USB interface 5, the MOS transistor 42 is not turned on at this time, and the USB interface 5 does not output the charging voltage.
In the embodiment of the present invention, after the control module 3 determines that the charging device is plugged into the USB interface 5 and controls the MOS transistor 42 to be turned on to enable the USB interface 5 to output a voltage to charge the charging device, the MOS transistor 42 is turned off at preset intervals by the control module 3, so as to reduce the driving voltage of the MOS transistor 42 to increase the impedance of the MOS transistor 42, so as to generate a voltage difference at two ends of the plug detection circuit 41, and thus, whether the voltage Vab at two ends of the plug detection circuit 41 is smaller than a second preset value can be accurately detected by the control module 3 to determine whether the charging device is plugged out.
As shown in fig. 4, the impedance of the MOS transistor 42 increases with the decrease of the driving voltage VGS of the MOS transistor 42, and the current Ids passing through the MOS transistor 42 decreases, so that a voltage difference occurs between the two ends Vab of the insertion/extraction detection circuit 41. In this embodiment, when the control module 3 controls the MOS transistor 42 to be turned off, the driving voltage VGS of the MOS transistor 42 is gradually reduced from 5V, and in this process, the control module 3 detects the voltage Vab at two ends of the plugging/unplugging detection circuit 41. When the charging device is not unplugged from the USB interface 5, the voltage Vab at two ends of the plugging detection circuit 41 is greater than or equal to the second preset value; when the voltage Vab at the two ends of the plugging detection circuit 41 is smaller than the second preset value, it represents that the charging device plugs out the USB interface 5. If the control module 3 detects that the voltage Vab at the two ends of the plugging detection circuit 41 is greater than or equal to the second preset value, the control module 3 determines that the charging device is not plugged out of the USB interface 5 and keeps the MOS transistor 42 turned on, and reduces the driving voltage of the MOS transistor 42 at preset intervals to detect whether the charging device is plugged out of the USB interface 5 in real time, so that the control module 3 continuously detects whether the charging device is plugged out of the USB interface 5 by controlling the turning-off and turning-on of the MOS transistor 42. When the control module 3 detects that the voltage Vab at the two ends of the plugging detection circuit 41 is smaller than the second preset value, the control module 3 judges that the charging device is plugged out of the USB interface 5 and controls the MOS tube 42 to be disconnected to stop the USB interface 5 from outputting the charging voltage, so that whether the charging device is plugged out of the USB interface 5 can be accurately detected, and it is avoided that a user is mistakenly judged that the charging device is not plugged out when the user only plugs out the apple phone without plugging out the data line of the apple phone, so that the USB interface 5 is timely stopped from outputting the charging voltage after the charging device plugs out the USB interface 5.
The setting value of the second preset value may be the same as or different from the first preset value, and both the second preset value and the first preset value are greater than zero, specifically set according to the resistance value of the plugging detection circuit 41. In this embodiment, the second preset value is also set to 0.3V. When the charging device extracts the USB interface 5, the current through the detecting resistor R0 is equal to zero, or only the iphone is extracted without extracting the lighting data line of the iphone, and the current through the detecting resistor R0 is smaller than 1mA, so the voltages at the two ends of the detecting resistor R0 are both smaller than 0.2V and smaller than 0.3V, which avoids that the iphone is not extracted and misjudged as the charging device is in a charging state, thereby the charging device can be accurately judged to extract the USB interface 5, and at this time, the control module 3 controls the MOS transistor 42 to be turned off, so that the USB interface 5 does not output a charging voltage.
In the embodiment of the invention, the charging device further comprises a voltage stabilizing module 6, and the control module 3 is connected with the power supply 1 through the voltage stabilizing module 6. The Vdd terminal of the control module 3 is connected to the voltage stabilizing module 6, the GND terminal of the control module 3 is grounded, and the voltage stabilizing module 6 plays a role in stabilizing, so that the working voltage of the control module 3 is stable.
As an embodiment of the present invention, the number of the USB interfaces 5 and the number of the detection circuits 4 are at least two, and each USB interface 5 is correspondingly connected to one detection circuit 4, so as to facilitate to charge a plurality of charging devices simultaneously. Besides, the number of the USB interface 5 and the detection circuit 4 may be set to only one. In the present embodiment, the number of the USB interfaces 5 and the detection circuits 4 is three.
In this embodiment, when the MOS transistor 42 corresponding to each USB interface 5 is in the off state, and when the control module 3 detects that the voltage Vab at the two ends of the plug detection circuit 41 is greater than the first preset value, the control module 3 determines that the charging device is plugged into the USB interface 5 and drives the MOS transistor 42 to be turned on, so that the USB interface 5 outputs the charging voltage to charge the charging device.
When the MOS transistor 42 corresponding to each USB interface 5 is in a conducting state, the control module 3 reduces the driving voltage of the MOS transistor 42 at preset time intervals, and detects the voltage Vab at two ends of the plugging detection circuit 41, and when the control module 3 detects that the voltage Vab at two ends of the plugging detection circuit 41 is smaller than a second preset value, the control module 3 determines that the charging device is plugged out of the USB interface 5 and controls the MOS transistor 42 to be disconnected, so as to stop the USB interface 5 from outputting the charging voltage.
As an embodiment of the present invention, the charging apparatus further includes a charging protocol module 7 connected to the voltage output circuit 2 and the control module 3, respectively, and the charging protocol module 7 is connected to each USB interface 5 at the same time. The charging protocol module 7 is connected to the port En1 of the control module 3. In this embodiment, the charging protocol module 7 is an identification chip.
When the control module 3 detects that a charging device is inserted into one USB interface 5, the control module 3 sends a first control signal to the charging protocol module 7, and the charging protocol module 7 receives the first control signal and controls the voltage output circuit 2 to output a charging voltage corresponding to the charging device to the USB interface 5 according to the charging voltage of the charging device; when the control module 3 detects that two or more USB interfaces 5 are plugged into the charging device, the control module 3 sends a second control signal to the charging protocol module 7, and the charging protocol module 7 receives the second control signal and controls the voltage output circuit 2 to output a preset charging voltage to the USB interfaces 5. The first control signal is a high level signal, and the second control signal is a low level signal.
In this embodiment, when the control module 3 detects that any one USB interface 5 is inserted into the charging device, the control module 3 switches on the MOS transistor 42 corresponding to the USB interface 5, the control module 3 outputs a high level signal to the charging protocol module 7, the charging protocol module 7 identifies the charging voltage of the charging device through a handshake protocol, and controls the voltage output circuit 2 to output the charging voltage corresponding to the charging device to the USB interface 5, so as to implement the fast charging of the charging device.
When the control module 3 detects that the second USB interface 5 is inserted into the charging device, that is, when it detects that the two USB interfaces 5 are inserted into the charging device, the control module 3 drives the MOS transistors 42 corresponding to the second USB interface 5 to be turned on, at this time, the control module 3 outputs a low level signal to the charging protocol module 7, and the charging protocol module 7 receives the low level signal and controls the voltage output circuit 2 to output a preset charging voltage to the USB interface 5. The preset voltage is 5V, so that two or more charging devices can realize common charging. The two charging devices realize that the common charging is not allowed to enter a quick charging mode; similarly, when the control module 3 detects that the third USB interface 5 is inserted into the charging device, that is, when it detects that more than two USB interfaces 5 are inserted into the charging device, the control module 3 drives the MOS transistor 42 corresponding to the third USB interface 5 to be turned on, at this time, the control module 3 outputs a low level signal to the charging protocol module 7, and the charging protocol module 7 receives the low level signal and controls the voltage output circuit 2 to output a preset voltage to the USB interface 5, so that the three charging devices all realize normal charging. When any one USB interface 5 is detected to be inserted into one charging device to realize the quick charging of the charging device, and two or two USB interfaces 5 are detected to be inserted into the charging device to realize the ordinary charging, the requirements of quick charging and ordinary charging can be met, the total power is not increased, and the production cost is effectively reduced.
In the embodiment of the present invention, the voltage output circuit 2 includes a resistor R7 and a resistor R8, one end of the resistor R7 is connected to the power supply 1, the other end of the resistor R8 is connected to one end of the resistor R8, the other end of the resistor R8 is grounded, and the pin FB of the charging protocol module 7 is connected between the resistor R7 and the resistor R8. One end of the resistor R7 is connected with the Vout end of the power supply 1, one end of the resistor R8 connected with the resistor R7 is connected with the Vfb end of the power supply 1, and the other end of the resistor R8 is connected with the GND end of the power supply 1.
In the embodiment of the present invention, the charging protocol module 7 precisely controls the output voltage of the voltage output circuit 2 by adjusting the source current or sink current of the pin FB, so as to output a corresponding charging voltage according to the charging voltage of the charging device. For example, when the resistor R7 is 100k ohms and the USB interface 5 needs to output a voltage of 9V, the FB pin of the charging protocol module 7 draws a current 40uA, so that the voltage of the USB interface 5 may be changed from 5V to a voltage of 9V for output; when the USB interface 5 needs to output 12V voltage, the FB pin of the charging protocol module 7 needs to pull current 70uA, so that the voltage of the USB interface 5 can be changed from 5V to 12V voltage for output; when the USB interface 5 outputs a voltage of 5V, the FB pin of the charging protocol module 7 does not source current or sink current, and the voltage of the USB interface 5 outputs a voltage of 5V.
Referring to fig. 3, in detail, the detection circuit 4 includes a first detection circuit, a second detection circuit and a third detection circuit, the USB interface 5 includes a first USB interface 51, a second USB interface 52 and a third USB interface 53, and the first USB interface 51, the second USB interface 52 and the third USB interface 53 are respectively connected to the charging protocol module 7.
The first detection circuit comprises a first plug detection circuit connected with the voltage output circuit 2 and the first USB interface 51 and a first MOS tube Q1 which is connected with the first plug detection circuit in parallel and used for connecting or disconnecting the voltage output circuit 2 and the first USB interface 51, the first MOS tube Q1 is connected with the control module 3, the first plug detection circuit forms loop current when the charging equipment is inserted into the first USB interface 51, and voltage is generated at two ends of the first plug detection circuit. The first plug detection circuit comprises a first detection resistor R4, a Gate of the first MOS transistor Q1 is connected with a port Gate1 of the control module 3 through a first current-limiting resistor R1, one end of the first detection resistor R4 is respectively connected with a pin GND of the first USB interface 51, a source of the first MOS transistor Q1 and a port Point1 of the control module 3, the other end of the first detection resistor R4 is grounded and is connected with a drain of the first MOS transistor Q1, a pin VCC of the first USB interface 51 is connected with one end of a resistor R7, which is connected with a Vout end of the power supply 1, and a pin D + of the first USB interface 51 and a pin D-of the first USB interface 51 are respectively connected with the charging protocol module 7.
The second detection circuit comprises a second plugging detection circuit connected with the voltage output circuit 2 and the second USB interface 52 and a second MOS tube Q2 which is connected with the second plugging detection circuit in parallel and used for connecting or disconnecting the voltage output circuit 2 and the second USB interface 52, the second MOS tube Q2 is connected with the control module 3, the first plugging detection circuit forms loop current when the charging equipment is plugged into the second USB interface 52, and voltage is generated at two ends of the first plugging detection circuit. The first plug detection circuit includes a second detection resistor R5, a Gate of the second MOS transistor Q2 is connected to the port Gate2 of the control module 3 through a second current-limiting resistor R2, one end of the second detection resistor R5 is connected to the pin GND of the second USB interface 52, the source of the second MOS transistor Q2, and the port Point2 of the control module 3, the other end of the second detection resistor R5 is grounded and connected to the drain of the second MOS transistor Q2, the pin VCC of the second USB interface 52 is connected to the end of the resistor R7 that is connected to the Vout terminal of the power supply 1, and the pin D + of the second USB interface 52 and the pin D-of the second USB interface 52 are connected to the charging protocol module 7, respectively.
The third detection circuit comprises a third plug detection circuit connected with the voltage output circuit 2 and the third USB interface 53, and a third MOS transistor Q3 connected in parallel with the third plug detection circuit and used for turning on or off the voltage output circuit 2 and the third USB interface 52, the third MOS transistor Q3 is connected with the control module 3, the third plug detection circuit forms a loop current when the charging device is inserted into the third USB interface 53, and generates a voltage at two ends of the third plug detection circuit. The third plug detection circuit includes a third detection resistor R6, a Gate of the third MOS transistor Q3 is connected to the port Gate3 of the control module 3 through a third current-limiting resistor R3, one end of the third detection resistor R6 is connected to the pin GND of the third USB interface 53, the source of the third MOS transistor Q3, and the port Point3 of the control module 3, the other end of the third detection resistor R6 is grounded and connected to the drain of the third MOS transistor Q3, the pin VCC of the third USB interface 53 is connected to the end of the resistor R7 connected to the Vout of the power supply 1, and the pin D + of the third USB interface 53 and the pin D-of the third USB interface 53 are connected to the charging protocol module 7, respectively.
When the first MOS transistor Q1 is in a disconnected state, when the port Point1 of the control module 3 detects that the voltage at two ends of the first plug detection circuit is greater than a first preset value, the control module 3 determines that the charging device is inserted into the first USB interface 51, and the port Gate1 of the control module 3 outputs a high level to drive the first MOS transistor Q1 to be turned on so that the first USB interface 51 outputs a charging voltage to charge the charging device; otherwise, when the port Point1 of the control module 3 detects that the voltage at the two ends of the first plug detection circuit is smaller than or equal to the first preset value, the port Gate1 of the control module 3 outputs a low level, and the first MOS transistor Q1 is not turned on; when the first MOS transistor Q1 is in a conduction state, the control module 3 reduces the driving voltage of the first MOS transistor Q1 at preset time intervals, in this process, when the port Point1 of the control module 3 detects that the voltage at the two ends of the first plug detection circuit is smaller than a second preset value, at this time, the control module 3 judges that the charging device is plugged out of the first USB interface 51, and the port Gate1 of the control module 3 outputs a low level to drive the first MOS transistor Q1 to be closed; if the port Point1 of the control module 3 detects that the voltage at the two ends of the first plug detection circuit is greater than or equal to the second preset value, the control module 3 determines that the charging device is not plugged out of the first USB interface 51, and the control module 3 reduces the driving voltage of the first MOS transistor Q1 at preset time intervals to detect whether the charging device is plugged out of the first USB interface 51 in real time.
When the second MOS transistor Q2 is in a disconnected state, when the port Point2 of the control module 3 detects that the voltage at the two ends of the second plug detection circuit is greater than the first preset value, the control module 3 determines that the charging device is inserted into the second USB interface 52, and the port Gate2 of the control module 3 outputs a high level to drive the second MOS transistor Q2 to be turned on, so that the second USB interface 52 outputs a charging voltage to charge the charging device; otherwise, when the voltage detected by the port Point2 of the control module 3 is less than or equal to the first preset value, the port Gate2 of the control module 3 outputs a low level, and the second MOS transistor Q2 is not turned on. When the second MOS transistor Q2 is in a conducting state, the control module 3 reduces the driving voltage of the second MOS transistor Q2 at preset time intervals, in this process, when the port Point2 of the control module 3 detects that the voltage at the two ends of the second plugging detection circuit is smaller than a second preset value, at this time, the control module 3 judges that the charging device is plugged out of the second USB interface 52, and the port Gate2 of the control module 3 outputs a low level to drive the second MOS transistor Q2 to be closed; if the port Point2 of the control module 3 detects that the voltage at the two ends of the second plug detection circuit is greater than or equal to the second preset value, the control module 3 determines that the charging device is not plugged out of the second USB interface 52, and the control module 3 reduces the driving voltage of the second MOS transistor Q2 at preset intervals to detect whether the charging device is plugged out of the second USB interface 52 in real time.
When the third MOS transistor Q3 is turned on and in a closed state, when the voltage detected by the port Point3 of the control module 3 is greater than the first preset value, the control module 3 determines that the charging device is inserted into the third USB interface 53, and the port Gate3 of the control module 3 outputs a high level to drive the third MOS transistor Q3 to be turned on so that the third USB interface 53 outputs a charging voltage to charge the charging device; otherwise, when the voltage detected by the port Point3 of the control module 3 is less than or equal to the first preset value, the port Gate3 of the control module 3 outputs a low level, and the third MOS transistor Q3 is not turned on. When the third MOS transistor Q3 is in a conducting state, the control module 3 reduces the driving voltage of the third MOS transistor Q3 at preset time intervals, in this process, when the port Point3 of the control module 3 detects that the voltage at the two ends of the third plug detection circuit is smaller than the second preset value, at this time, the control module 3 judges that the charging device is plugged out of the third USB interface 53, and the port Gate3 of the control module 3 outputs a low level to drive the third MOS transistor Q3 to be turned off; if the port Point3 of the control module 3 detects that the voltage at the two ends of the third plugging detection circuit is greater than or equal to the second preset value, at this time, the control module 3 determines that the charging device is not plugged out of the third USB interface 53, and the control module 3 reduces the driving voltage of the third MOS transistor Q3 at preset intervals to detect whether the charging device is plugged out of the third USB interface 53 in real time.
When the port Gate1, the port Gate2 or the port Gate3 of the control module 3 outputs a high level, which represents that one USB interface 5 is plugged into the charging device, at this time, one counter n is introduced, and n counts once, for example, when the counter n is equal to 3, which represents that three USB interfaces 5 are plugged into the charging device, by the above detection method for detecting the plugging and unplugging of the charging device, when the charging device of one USB interface 5 is unplugged, the counter n is decremented by 1, which represents that the charging device of 1 USB interface 5 is unplugged. When the counter n is equal to 1, it represents that only one USB interface 5 is inserted into the charging device, at this time, the port En1 of the control module 3 is set to a high level, the charging protocol module 7 receives a high level signal, and the charging protocol module 7 controls the voltage output circuit 2 to output a charging voltage corresponding to the charging device to the USB interface 5 according to the charging voltage of the charging device, so as to implement fast charging. When the counter n >1, it represents that two or more USB interfaces 5 are plugged into the charging device, the port En1 of the control module 3 is set to a low level, and the charging protocol module 7 receives a low level signal and controls the voltage output circuit 2 to output a preset charging voltage to the USB interfaces 5, so as to implement a normal charging function.
According to the charging device provided by the embodiment of the invention, by arranging the plugging detection circuit for connecting the voltage output circuit and the USB interface and the MOS tube which is connected with the plugging detection circuit in parallel and is used for connecting or disconnecting the voltage output circuit and the USB interface, the principle that the plugging detection circuit forms loop current when the charging equipment is plugged into the USB interface and generates voltage at two ends of the plugging detection circuit is utilized, and the control module detects whether the voltage at two ends of the plugging detection circuit is larger than a first preset value when the MOS tube is in a disconnected state, so that whether the charging equipment is plugged into the USB interface can be judged, the condition that only a Lightning data line is plugged into the USB interface and the charging equipment is mistakenly judged to be plugged into the USB interface is avoided, and the accuracy for detecting whether the charging equipment is plugged into the USB interface is improved. When the MOS tube is in a conducting state, the MOS tube is controlled to reduce the driving voltage at intervals of preset time through the control module, so that a voltage difference is generated at two ends of the plug detection circuit, and whether the voltage at the two ends of the plug detection circuit is smaller than a second preset value or not is detected through the control module so as to judge whether the charging equipment is pulled out or not. When the control module detects that the voltage at the two ends of the plugging detection circuit is smaller than the second preset value, the control module judges that the charging equipment is plugged out of the USB interface and drives the MOS tube to be disconnected so that the USB interface stops outputting the charging voltage, therefore, whether the charging equipment is plugged out of the USB interface can be accurately detected, the situation that a user is mistakenly judged that the charging equipment is not plugged out when the user only plugs out the apple mobile phone but does not plug out the Lightning data line is avoided, and therefore the USB interface can be timely stopped outputting the charging voltage after the charging equipment plugs out the USB interface.
Referring to fig. 5, an embodiment of the present invention further provides a control method of the charging device, where the control method of the charging device includes:
step S1, when the MOS tube 42 is in a disconnected state, the control module 3 detects the voltage at two ends of the plug detection circuit 41;
in this step, when the MOS transistor 42 corresponding to each USB interface 5 is in the off state, that is, the USB interface 5 is in the off state, it is determined whether a charging device is inserted by detecting the voltage Vab at the two ends of the plug detection circuit 41.
Step S2, the control module 3 determines whether the voltage Vab at two ends of the plugging detection circuit 41 is greater than a first preset value; if yes, entering the next step S3; if not, returning to the step S1;
in this step, when the control module 3 determines that the voltage Vab at the two ends of the plugging detection circuit 41 is greater than the first preset value, it represents that the charging device is plugged into the USB interface 5, and the control module 3 inputs a high level to the MOS transistor 42 to turn on the MOS transistor 42, so that the USB interface 5 outputs a charging voltage to charge the charging device.
S3, the control module 3 judges that a charging device is inserted into the USB interface 5 and controls the MOS tube 42 to be conducted, so that the USB interface 5 outputs charging voltage to charge the charging device;
as an embodiment of the present invention, when the number of the USB interface 5 and the plug detection circuit 41 is one, and the MOS 42 corresponding to the USB interface 5 is in the off state, and when the control module 3 detects that the voltage at two ends of the plug detection circuit 41 is greater than the first preset value, the control module 3 determines that the charging device is inserted into the USB interface 5 and drives the MOS 42 to be turned on, so that the USB interface 5 outputs the preset charging voltage to charge the charging device. The preset charging voltage is 5V, and common charging of the charging equipment is achieved.
As another embodiment of the present invention, when the number of the USB interfaces 5 and the plugging detection circuit 41 is two, the charging apparatus further includes a charging protocol module 7 connected to the voltage output circuit 2 and the control module 3, respectively, and the charging protocol module 7 is connected to each USB interface 5 at the same time.
When the control module 3 detects that a charging device is inserted into one USB interface 5, the control module 3 sends a first control signal to the charging protocol module, and the charging protocol module 7 receives the first control signal and controls the voltage output circuit 2 to output a charging voltage corresponding to the charging device to the USB interface 5 according to the charging voltage of the charging device; when the control module 3 detects that two or more USB interfaces 5 are plugged into the charging device, the control module 3 sends a second control signal to the charging protocol module 7, and the charging protocol module 7 receives the second control signal and controls the voltage output circuit 2 to output a preset charging voltage to the USB interfaces 5.
In this embodiment, when the control module 3 detects that any one USB interface 5 is inserted into the charging device, the control module 3 switches on the MOS transistor 42 corresponding to the USB interface 5, the control module 3 outputs a high level signal to the charging protocol module 7, the charging protocol module 7 identifies the charging voltage of the charging device through a handshaking protocol, and the voltage output circuit 2 is controlled to output the charging voltage corresponding to the charging device to the USB interface 5, so as to realize the quick charging of the charging device.
When the control module 3 detects that the second USB interface 5 is inserted into the charging device, that is, when it detects that the two USB interfaces 5 are inserted into the charging device, the control module 3 drives the MOS transistor 42 corresponding to the second USB interface 5 to be turned on, at this time, the control module 3 outputs a low level signal to the charging protocol module 7, and the charging protocol module 7 receives the low level signal and controls the voltage output circuit 2 to output a preset charging voltage to the USB interfaces 5, so as to implement normal charging of two or more charging devices. Therefore, when any one USB interface 5 is detected to be inserted into one charging device to realize the quick charging of the charging device, and two or two USB interfaces 5 are detected to be inserted into the charging device to realize the ordinary charging, the requirements of the quick charging and the ordinary charging can be met, the total power is not increased, and the production cost is effectively reduced.
Step S4, when the MOS tube 42 is in a conducting state, the control module 3 controls the MOS tube 42 to reduce the driving voltage and detects the voltage at two ends of the plugging detection circuit 41 at preset time intervals;
in this step, the MOS transistor 42 is controlled to reduce the driving voltage of the MOS transistor 42 at preset time intervals by the control module 3, so that a voltage difference is generated between two ends of the plug detection circuit 41, and the control module 3 detects the voltages at two ends of the plug detection circuit 41 to determine whether the charging device is plugged out in real time.
Step S5, the control module 3 determines whether the voltage Vab at two ends of the plugging detection circuit 41 is smaller than a second preset value; if yes, entering the next step S6; if not, returning to the step S4;
in this step, in the on state of the MOS transistor 42, the control module 3 determines whether the voltage Vab at the two ends of the plug detection circuit 41 is smaller than the second preset value, so as to accurately detect whether the charging device is plugged out of the USB interface 5, thereby avoiding the situation that the user is mistakenly determined that the charging device is not plugged out when the user only plugs out the apple-phone but does not plug out the lighting data line. When the control module 3 detects that the voltage at the two ends of the plug detection circuit 41 is greater than or equal to the second preset value, the control module 3 determines that the charging device is not plugged out of the USB interface 5 and keeps the MOS transistor 42 turned on, so that the USB interface 5 continues to output the charging voltage to charge the charging device, and the control module 3 continues to reduce the driving voltage of the MOS transistor 42 every preset time interval and detects the voltage at the two ends of the plug detection circuit 41, so as to detect whether the charging device is plugged out in real time.
And S6, the control module 3 judges that the charging equipment is pulled out of the USB interface and controls the MOS tube to be disconnected so as to enable the USB interface 5 to stop outputting the charging voltage.
In this step, when the control module 3 detects that the voltage at the two ends of the plug detection circuit 41 is smaller than the second preset value, the control module 3 determines that the charging device has pulled out the USB interface and drives the MOS transistor to be disconnected to stop the USB interface from outputting the charging voltage, so that the USB interface 5 stops outputting the charging voltage in time after the charging device has pulled out the USB interface 5. After the MOS transistor 42 is in the off state, the control module 3 detects the voltage across the plug detection circuit 41 in real time to determine whether a charging device is plugged.
According to the charging device control method provided by the embodiment of the invention, whether the voltage at two ends of the plugging detection circuit is larger than the first preset value or not is detected by the control module when the MOS tube is in the off state so as to judge whether the USB interface is inserted into the charging equipment or not, so that the situation that only the Lightning data line of the built-in chip is inserted into the USB interface and the charging equipment is wrongly judged to be inserted into the USB interface is avoided, and the accuracy of detecting whether the charging equipment is inserted into the USB interface is improved; when the MOS tube is in a conducting state, the MOS tube is controlled to reduce the driving voltage by the control module at preset time intervals so as to generate a voltage difference at two ends of the plugging detection circuit. When the control module detects that the voltage at the two ends of the plugging detection circuit is smaller than the second preset value, the control module judges that the charging equipment is plugged out of the USB interface and drives the MOS tube to be kept disconnected to stop the USB interface from outputting the charging voltage, so that whether the charging equipment is plugged out of the USB interface or not can be accurately detected, the situation that a user is mistakenly judged that the charging equipment is not plugged out when the user only plugs out the apple mobile phone but does not plug out the Lightning data line is avoided, and the charging voltage is timely stopped being output by the USB interface after the charging equipment is plugged out of the USB interface.
The above-mentioned embodiments are merely preferred embodiments of the present invention, which should not be construed as limiting the present invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (9)

1. A charging device, comprising: the device comprises a power supply, a voltage output circuit connected with the power supply, a control module electrically connected with the power supply, a detection circuit connected with the voltage output circuit and the control module, and a USB interface connected with the detection circuit;
the detection circuit comprises a plug detection circuit connected with the voltage output circuit and the USB interface, and an MOS (metal oxide semiconductor) tube which is connected with the plug detection circuit in parallel and is used for switching on or off the voltage output circuit and the USB interface, the MOS tube is connected with the control module, and the plug detection circuit forms loop current when charging equipment is inserted into the USB interface and generates voltage at two ends of the plug detection circuit;
when the MOS tube is in a disconnected state, when the control module detects that the voltage at two ends of the plugging detection circuit is greater than a first preset value, the control module judges that a charging device is plugged into the USB interface and controls the MOS tube to be conducted so that the USB interface outputs a charging voltage to charge the charging device;
when the MOS tube is in a conducting state, the control module controls the MOS tube to reduce the driving voltage at every preset time interval and detects the voltage at two ends of the plugging detection circuit, and when the control module detects that the voltage at two ends of the plugging detection circuit is smaller than a second preset value, the control module judges that the charging equipment is plugged out of the USB interface and controls the MOS tube to be disconnected so as to enable the USB interface to stop outputting the charging voltage;
the plugging detection circuit comprises a detection resistor connected with the MOS tube in parallel, one end of the detection resistor is connected with the USB interface and the source electrode of the MOS tube, the other end of the detection resistor is grounded and connected with the drain electrode of the MOS tube, and the grid electrode of the MOS tube is connected with the control module;
the first preset value and the second preset value are both larger than 0 and are both larger than a voltage value of two ends of the detection resistor caused by the Lightning line.
2. The charging device of claim 1, wherein the number of the USB interfaces and the detection circuits is at least two, and each USB interface is connected to one detection circuit.
3. The charging device according to claim 2, further comprising a charging protocol module respectively connected to the voltage output circuit and the control module, wherein the charging protocol module is simultaneously connected to each of the USB interfaces;
when the control module detects that the charging equipment is inserted into one USB interface, the control module sends a first control signal to the charging protocol module, and the charging protocol module receives the first control signal and controls the voltage output circuit to output charging voltage corresponding to the charging equipment to the USB interface according to the charging voltage of the charging equipment;
when the control module detects that two or more than two USB interfaces are inserted into the charging device, the control module sends a second control signal to the charging protocol module, and the charging protocol module receives the second control signal and controls the voltage output circuit to output a preset charging voltage to the USB interfaces.
4. The charging device according to claim 3, wherein the voltage output circuit comprises a resistor R7 and a resistor R8, one end of the resistor R7 is connected to the power supply, the other end of the resistor R8 is connected to one end of the resistor R8, the other end of the resistor R8 is grounded, and the pin FB of the charging protocol module is connected between the resistor R7 and the resistor R8.
5. The charging device of claim 1, further comprising a voltage regulation module, wherein the control module is connected to the power supply via the voltage regulation module.
6. The charging device of claim 1, wherein the MOS transistor is connected to the control module through a current limiting resistor.
7. A charging device control method applied to the charging device according to claim 1, characterized by comprising:
when the MOS tube is in a disconnected state, the control module detects the voltage at two ends of the plugging detection circuit;
the control module judges whether the voltage at two ends of the plugging detection circuit is greater than a first preset value or not; if yes, entering the next step; if not, returning to the previous step;
the control module judges that a charging device is inserted into the USB interface and controls the MOS tube to be conducted so that the USB interface outputs charging voltage to charge the charging device;
when the MOS tube is in a conducting state, the control module controls the MOS tube to reduce the driving voltage and detect the voltage at two ends of the plugging detection circuit at preset time intervals;
the control module judges whether the voltage at the two ends of the plugging detection circuit is smaller than a second preset value; if yes, entering the next step; if not, returning to the previous step;
the control module judges that the charging equipment is pulled out of the USB interface and controls the MOS tube to be kept disconnected so that the USB interface stops outputting the charging voltage.
8. The method according to claim 7, wherein the number of the USB interfaces and the detection circuits is at least two, and each USB interface is connected to one detection circuit.
9. The charging device control method according to claim 8, wherein the charging device further comprises a charging protocol module connected to the voltage output circuit and the control module, respectively, the charging protocol module being connected to each of the USB interfaces simultaneously; the control module judges that a charging device is inserted into the USB interface and controls the MOS tube to be conducted, so that the USB interface outputs charging voltage to charge the charging device, and the control module comprises:
when the control module judges that the charging equipment is inserted into one USB interface, the control module sends a first control signal to the charging protocol module, and the charging protocol module receives the first control signal and controls the voltage output circuit to output charging voltage corresponding to the charging equipment to the USB interface according to the charging voltage of the charging equipment;
when the control module judges that two or more than two USB interfaces are inserted into the charging device, the control module sends a second control signal to the charging protocol module, and the charging protocol module receives the second control signal and controls the voltage output circuit to output a preset charging voltage to the USB interfaces.
CN201911107550.2A 2019-11-13 2019-11-13 Charging device and charging device control method Active CN110912224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911107550.2A CN110912224B (en) 2019-11-13 2019-11-13 Charging device and charging device control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911107550.2A CN110912224B (en) 2019-11-13 2019-11-13 Charging device and charging device control method

Publications (2)

Publication Number Publication Date
CN110912224A CN110912224A (en) 2020-03-24
CN110912224B true CN110912224B (en) 2023-04-14

Family

ID=69817608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911107550.2A Active CN110912224B (en) 2019-11-13 2019-11-13 Charging device and charging device control method

Country Status (1)

Country Link
CN (1) CN110912224B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111817409B (en) * 2020-09-11 2020-12-15 深圳英集芯科技有限公司 Fast charging protection circuit and method, fast charging chip and fast charging power supply equipment
CN112260348B (en) * 2020-09-30 2023-11-17 安克创新科技股份有限公司 Charging control circuit and charging equipment
CN114336814A (en) * 2020-09-30 2022-04-12 深圳英集芯科技股份有限公司 Multi-port charging control circuit, charging chip and power supply equipment
CN112380080B (en) * 2020-12-02 2021-06-08 深圳慧能泰半导体科技有限公司 USB equipment detection system and method
CN113267736B (en) * 2021-05-31 2022-04-12 荣耀终端有限公司 Charging test device and method
CN113900871A (en) * 2021-10-08 2022-01-07 重庆电哥科技(集团)有限公司 Circuit and method for detecting insertion of USB (universal serial bus) equipment
CN113972722A (en) * 2021-11-01 2022-01-25 青岛海信移动通信技术股份有限公司 Mobile terminal
CN114362509B (en) * 2022-01-21 2024-05-14 珠海慧联科技有限公司 Dynamic voltage switching device, TWS chip and TWS equipment
CN114624633B (en) * 2022-05-17 2022-09-30 陕西天视致远航空技术有限公司 HDMI (high-definition multimedia interface) port plugging detection system and method, electronic equipment and storage medium
CN114839571B (en) * 2022-06-30 2022-09-16 深圳英集芯科技股份有限公司 Circuit for detecting plugging and unplugging of equipment and electronic equipment
CN116148586B (en) * 2023-04-21 2023-07-28 苏州水芯电子科技有限公司 USB equipment pull-out detection circuit

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232196A (en) * 2008-02-02 2008-07-30 中兴通讯股份有限公司 Control circuit of charging mode in USB charging stand and method thereof
WO2011032410A1 (en) * 2009-09-19 2011-03-24 惠州Tcl移动通信有限公司 Method and device for identifying universal serial bus (usb) insertion or charger insertion of mobile terminal
CN105186598A (en) * 2015-08-04 2015-12-23 深圳英集芯科技有限公司 USB insertion automatic identification and power supply system and chip integrated with the same
CN108539830A (en) * 2018-06-20 2018-09-14 深圳英集芯科技有限公司 A kind of charging control switching circuit and control method
CN109149691A (en) * 2018-08-29 2019-01-04 宁波公牛数码科技有限公司 A kind of charging unit and its charging method
CN110221163A (en) * 2019-03-21 2019-09-10 珠海智融科技有限公司 A kind of the connecting detection method and detection circuit of USB Type-C interface

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101494900B1 (en) * 2007-07-25 2015-02-24 삼성전자주식회사 Mobile phone and method for charging through discernment charging cable

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232196A (en) * 2008-02-02 2008-07-30 中兴通讯股份有限公司 Control circuit of charging mode in USB charging stand and method thereof
WO2011032410A1 (en) * 2009-09-19 2011-03-24 惠州Tcl移动通信有限公司 Method and device for identifying universal serial bus (usb) insertion or charger insertion of mobile terminal
CN105186598A (en) * 2015-08-04 2015-12-23 深圳英集芯科技有限公司 USB insertion automatic identification and power supply system and chip integrated with the same
CN108539830A (en) * 2018-06-20 2018-09-14 深圳英集芯科技有限公司 A kind of charging control switching circuit and control method
CN109149691A (en) * 2018-08-29 2019-01-04 宁波公牛数码科技有限公司 A kind of charging unit and its charging method
CN110221163A (en) * 2019-03-21 2019-09-10 珠海智融科技有限公司 A kind of the connecting detection method and detection circuit of USB Type-C interface

Also Published As

Publication number Publication date
CN110912224A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN110912224B (en) Charging device and charging device control method
US9923390B2 (en) Method and apparatus for performing charging port detection control
US10601242B2 (en) Micro short protection for charger, terminal device, and charging system
TWI700873B (en) Standard-connector adapter protection circuit and method
US9450441B2 (en) Mobile terminal, and device and method for charging same
CN102202117B (en) Electronic device with USB (universal serial bus) interface and USB communication starting method thereof
CN111917163B (en) Multi-port charging control circuit and method, charging chip and power supply equipment
EP2677388A2 (en) Voltage regulator circuit with adaptive current limit and method for operating the voltage regulator circuit
EP3484002B1 (en) Electrostatic protection circuit
CN108539830B (en) Charging switching control circuit and control method
CN112380080B (en) USB equipment detection system and method
CN105022468A (en) USB adapter and USB line
CN111835074A (en) Multi-output charging head
CN203759164U (en) Circuit for detecting access state of USB load equipment
CN115237235A (en) USB equipment shift-out identification circuit and method and power supply system
CN106449670B (en) Optical module
CN113507665B (en) Electronic equipment assembly and terminal equipment
US8806255B2 (en) Interface connection control based on voltage at input rail
US9882372B2 (en) Electronic device and power protection method
TWI812013B (en) Over voltage protection circuit for usb type-c port and related method
CN204462295U (en) Auxiliary circuit is detected from equipment and insertion thereof
US10817450B1 (en) USB apparatus and operation method thereof
TWI402668B (en) An electronic device and method for assigning power to usb ports dynamically
CN203760209U (en) MHL cable and MHL cable hot plug detecting system
CN113836065A (en) One-to-many data line circuit and data line

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
GR01 Patent grant
GR01 Patent grant