BACKGROUND
1. Technical Field
The present disclosure relates to an electronic device, and particularly, to an electronic device that can share battery power with other devices.
2. Description of Related Art
Electronic devices like ebook readers, tablet PCs, and mobile phones have built-in batteries which can be charged by a power supply through a USB interface. However, the built-in battery can only provide electricity to the electronic device which it belongs to rather than other electronic devices, and thus limiting the flexibility of the power usage between different electronic devices.
Therefore, what is needed is an electronic device with power output function.
BRIEF DESCRIPTION OF THE DRAWINGS
The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of an electronic device with outward power supply capability. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
FIG. 1 is a block diagram of an electronic device in accordance with one exemplary embodiment.
FIG. 2 is a circuit diagram of the electronic device of FIG. 1, in accordance with an exemplary embodiment.
FIG. 3 is a diagram of a first USB cable used with the electronic device of FIG. 1, in accordance with an exemplary embodiment.
FIG. 4 is a diagram of a second USB cable used with the electronic device of FIG. 1, in accordance with an exemplary embodiment.
DETAILED DESCRIPTION
Referring to FIG. 1, an electronic device 100 includes a USB interface 10, a boost circuit 20, a switch circuit 30, a charging circuit 40, and a battery 50. The USB interface 10 can be connected with an external power supply 61 through a first USB cable 60, or connected with a small electronic device 71 through a second USB cable 70. When the USB interface 10 is connected with the external power supply 61, the external power supply 61 charges the battery 50 through the first USB cable 60, the USB interface 10, the switch circuit 30, and the charging circuit 40. When the USB interface 10 is connected with the small electronic device 71, the battery 50 supplies power to the small electronic device 71 through the boost circuit 20, the USB interface 10, and the second USB cable 70. In the present embodiment, the external power supply 61 is USB power of a computer, the electronic device 100 is an ebook reader, and the small electronic device 71 is a mobile phone. In other embodiments, the external power supply 61 or the small electronic device 71 can be another electronic device 100.
Referring to FIG. 2, in one embodiment, the USB interface 10 is a 5 pin mini USB interface having a VCC pin, a D− pin, a D+ pin, an ID pin, and a GND pin. The electronic device 100 determines whether the external power supply 61 or the small electronic device 71 is connected to the USB interface 10 by a voltage level of the ID pin, and the voltage level of the ID pin is determined by whether the first USB cable 60 or the second USB cable 70 connected with the USB interface 10.
The switch circuit 30 includes a switch Q1 and a switch Q2. The switch Q1 is a pMOSFET having a source, a drain, and a gate, and the switch Q2 is a npn transistor having an emitter, a collector, and a base. The charging circuit 40 includes a power input terminal 41 connected with the switch circuit 30 and a power output terminal 42 connected with the battery 50. The source, the drain, and the gate of the switch Q1 are connected to the VCC pin of the USB interface 10, the power input terminal 41 of the charging circuit 40, and the collector of the switch Q2, respectively; the gate of the switch Q1 further connects to a power terminal VDD1 through a pull-up resistor R1. The emitter, the collector, and the base of the switch Q2 are connected to ground, the gate of the switch Q1, and the ID pin of the USB interface 10, and the base of the switch Q2 further connects to a power terminal VDD2 through a pull-up resistor R2. The power terminal VDD1 and VDD2 are connected to the positive electrode of the battery 50. The charging circuit 40 can receive power from the external power supply 61 through the power input terminal 41 and charge the battery 50 through the power output terminal 42.
Referring to FIG. 3, the first USB cable 60 has a first USB cable interface 601. In the present embodiment, the first USB cable interface 601 is a 5 pin mini USB interface, and an ID pin of the first USB cable interface 601 is floating. When the external power supply 61 is connected to the USB interface 10 through the first USB cable 60, the first USB cable interface 601 leaves the ID pin of the USB interface 10 floating. When the ID pin of the USB interface 10 is allowed to float, the base of the switch Q2 obtains a high voltage level through the power terminal VDD2 and the pull-up resistor R2, and thus closes the switch Q2. When the switch Q2 is closed, the gate of the switch Q1 is grounded and at a low voltage level, and thus closes the switch Q1. When the switch Q1 is closed, the external power supply 61 can charge the battery 50 through the first USB cable 60, the USB interface 10, the switch circuit 30, and the charging circuit 40.
Referring to FIG. 2, in the present embodiment, the boost circuit 20 is a direct current (DC)/DC boost circuit connected between the battery 50 and the interface 10, and boosts a voltage from the battery 50 and transfers the boosted voltage to the USB interface 10. The boost circuit 20 is enabled when an enable terminal (EN), connected to the ID pin of the USB interface 10, is at a low voltage level, and stops working when the enable terminal is at a high voltage level.
Referring to FIG. 4, the second USB cable 70 has a second USB cable interface 701. In the present embodiment, the second USB cable interface 701 is a 5 pin mini USB interface, and an ID pin of the second USB cable interface 701 is grounded through a GND pin of the second USB cable interface 701. When the small electronic device 71 is connected to the USB interface 10 through the second USB cable 70, the second USB cable interface 701 grounds the ID pin of the USB interface 10 to apply a low voltage level to the enable terminal of the boost circuit 20, and the battery 50 supplies power to the small electronic device 71 through the boost circuit 20, the USB interface 10, and the second USB cable 70. In the present embodiment, the boost circuit 20 can convert the battery voltage from 4.2V to 5V for charging the small electronic device 71.
Therefore, when the small electronic device 71 is connected to the electronic device 100 through the second USB cable 70, the boost circuit 20 is enabled to charge the small electronic device 71. When the external power supply 61 is connected with the electronic device 100 through the first USB cable 60, the switch circuit 30 is closed to allow the external power supply 61 to charge the battery 50.
Although the present disclosure has been specifically described on the basis of the exemplary embodiment thereof, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.