Abstract:
An exemplary electronic device capable of automatically selecting a power source includes two power ports configured to connect to external power sources and a battery compartment configured to receive a battery module. The voltage of the battery module is higher than at least one of the external power sources. The electronic device further includes a power selection module allocated between the battery module and the power port which selects the lower voltage. Three diodes are respectively located on the output path of the three power sources. A path switch that controls whether power to the device comes from the battery compartment or a power port is located between the anode of the battery compartment and the diode located on the output path of the battery module. Among the multiple power sources, the external power source providing a higher voltage is the first to be chosen to power the electronic device.

Description:
BACKGROUND 
     1. Technical Field 
     The present invention relates to an electronic device capable of automatically selecting a power source. 
     2. General Background 
     Nowadays, electronic devices (e.g., mobile phones and media players) are supplied with power from an AC/DC adapter which converts power from a wall outlet, a built-in battery, or another electronic device via an interface (e.g., a USB interface). If an electronic device is capable of receiving power from more than one power source, there is a need for the electronic device to automatically select one power source. 
     A typical power source auto-switch device can switch power between a battery, a USB interface, and an AC/DC adapter. However, the power from the USB interface can only be supplied to the device when the battery is disconnected. Therefore, if the electronic device needs to be powered by the USB interface instead of the battery, the battery must either be disconnected or physically removed from the electronic device, creating an inconvenience to the user. 
     Therefore, an electronic device capable of automatically selecting a power source is desired to overcome the above-described deficiencies. 
     SUMMARY 
     The present invention provides an electronic device capable of automatically selecting a power source. 
     The electronic device includes: a battery compartment, a first power port, a second power port, a DC/DC converter, a path switch, a power selection module, and at least three unidirectional switches. 
     The battery compartment is configured for receiving a battery module. The first power port is configured for connecting to a first external power source which provides power with a voltage higher than a voltage of the battery module. The second power port is configured for connecting with a second external power source which provides power with a voltage lower than the voltage of the battery module. The DC/DC converter is configured for converting the power from either the battery module, the first external power source, or the second external power source to supply the required voltage to power the electronic device. A unidirectional switch is configured for conducting power from the first power port to the DC/DC converter when being forward biased between the first power port and the DC/DC converter. Another unidirectional switch is configured for conducting the power from the second power port to the DC/DC converter when being forward biased between the second power port and the DC/DC converter. A third unidirectional switch is configured for conducting the power from the battery module to the DC/DC converter when being forward biased between the battery compartment and the DC/DC converter. 
     The path switch is connected between the battery compartment and the third unidirectional switch, for maintaining or cutting off power from the battery module to the third unidirectional switch. The power selection module is connected to the battery compartment, the second power port and the path switch. The power selection module controls the path switch to switch off when the second power port is connected to the second external power source, cutting off power from the battery module to the third unidirectional switch. 
     Other advantages and novel features will become more apparent from the following detailed description of embodiments when taken in conjunction with the accompanying drawings. 
    
    
     
       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 the present electronic device. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views. 
         FIG. 1  is a block diagram of an electronic device capable of automatically selecting a power source in accordance with a first embodiment of the present invention. 
         FIG. 2  is a circuit diagram of the electronic device of  FIG. 1 . 
         FIG. 3  is a block diagram of an electronic device capable of automatically selecting a power source in accordance with a second embodiment of the present invention. 
     
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       FIG. 1  is a block diagram of a first embodiment of an electronic device. The electronic device includes a first power port  10 , a battery compartment  20 , a second power port  30 , a power selection module  40 , a DC/DC converter  50 , a path switch  60 , and a plurality of unidirectional switches D 1 , D 2 , and D 3 . The first power port  10  is configured to connect to a first external power source (not shown), and the second power port  30  is configured to connect to a second external power source (not shown). The battery compartment  20  is configured to receive a battery module (not shown); the battery module can have one or more batteries. The DC/DC converter  50  is configured to convert power from either the first external power source, the second external power source, or the battery module into the required voltage (e.g. 3.7 volts (V)), to power the electronic device. In the first embodiment, the first external power source provides a relatively high voltage (e.g., 12V), the second external power source provides a relatively low voltage (e.g., 5V), and the battery module provides a voltage between the relatively high voltage and the relatively low voltage (e.g., 7.2V). 
     The anode of the power port  10  is connected to an input port (not shown) of the DC/DC converter  50  via the unidirectional switch D 1 . The anode of the battery compartment  20  is connected to the input port of the DC/DC converter  50  via the path switch  60  and the unidirectional switch D 2 . The anode of the second power port  30  is connected to the input port (not shown) of the DC/DC converter  50  via the unidirectional switch D 3 . The power selection module  40  is connected between the battery compartment  20 , the second power port  30 , and the path switch  60 . The power selection module  40  includes an output port  401  which is connected to a control port  601  of the power path switch  60 . 
     To illustrate one embodiment, the electronic device is powered by the first external power source via the first power port  10  when the first external power source is present. When the second external power source is present, the electronic device is powered by the second external power source via the second power port  20 . When the battery module is present, the electronic device is powered by the battery module in the battery compartment  20 . 
     If the first external power source, the second external power source, and the battery module are present, the unidirectional switch D 1  is switched on while the unidirectional switches D 2  and D 3  are switched off. The DC/DC converter  50  obtains power from the first external power source and converts the power from the first external power source to the required voltage. 
     If only the second external power source and the battery module are present, the output port  401  of the power selection module  40  sends an off signal to the control port  601  to switch off the path switch  60 , thereby cutting off the connection between the battery compartment  20  and the DC/DC converter  50 . Hence, the DC/DC converter  50  obtains power only from the second external power source and converts it to the required voltage. 
     If only the battery module is present, the power selection module  40  outputs an on signal to the control port  601 , to switch on the path switch  60 . Then, the DC/DC converter  50  obtains power from the battery module and converts it to the required voltage. 
       FIG. 2  is a circuit diagram of the electronic device. In this circuit, the first power port  10  can be an AC/DC adapter port  10  which is configured to connect to the first external power source, such as an AC/DC adapter. The second power port  30  can be a universal serial bus (USB) port  30  or an IEEE1394 port  30 . The USB port  30  is configured to connect to a USB power source (e.g., a USB port of a computer) (not shown). The unidirectional switches D 1 , D 2 , D 3  are diodes D 1 , D 2 , D 3 , respectively. An anode (not labeled) of the diode D 1  is connected to an anode of the AC/DC adapter port  10 , an anode (not labeled) of the diode D 2  is connected to the anode of the battery compartment  20  through the path switch  60 , and an anode (not labeled) of the diode D 3  is connected to an anode of the USB port  30 . Cathodes (not labeled) of the diodes D 1 , D 2 , D 3  are all connected to the input port of the DC/DC converter  50 . 
     In one embodiment, the AC/DC adapter port  10  provides a 12 volt (V) voltage, the USB port  30  provides a 5V voltage, and the battery compartment  20  provides a 7.2V voltage. The DC/DC converter  50  converts the 12V, 7.2V, and 5V voltages to a 3.7V voltage to power the electronic device. 
     The power selection module  40  includes a first switch  401  and a second switch  402 . The first switch  401  is a low voltage activated switch and the second switch  402  is a high voltage activated switch. The first switch  401  and the second switch  402  both include a control terminal (not labeled), a first path terminal (not labeled), and a second path terminal (not labeled). The path switch  60  is a low voltage activated switch that also includes a control terminal (not labeled), a first path terminal (not labeled), and a second path terminal (not labeled). In one embodiment of the present invention, the first switch  401  and the path switch  60  are p-channel metal-oxide-semiconductor field-effect transistors (PMOSFETs) Q 1 , Q 3  respectively, and the second switch  402  is an n-channel metal-oxide-semiconductor field-effect transistor (NMOSFET) Q 2 . Gates (not labeled), sources (not labeled), and drains (not labeled) of the MOSFETs Q 1 , Q 2 , Q 3  constitute the control terminals, the first path terminals, and the second path terminals of the first switch  401 , the second switch  402 , and the path switch  60 , respectively. The gate of the PMOSFET Q 3  corresponds to the control port  601  of the path switch  60 . 
     To illustrate one embodiment, the gate of the NMOSFET Q 2  is symbolically expressed as node A which connects to the anode of the USB port  30 , the node A further connects with a ground node E via a resistor R 3 , and the drain of the NMOSFET Q 2  is symbolically expressed as node D which connects to the gate of the PMOSFET Q 1 . The node D further connects to the anode of the battery compartment  20  via a resistor R 1 . The source of the NMOSFET Q 2  is grounded through the ground node E. The source of the PMOSFET Q 1  is symbolically expressed as node B which connects to the anode of the battery compartment  20 , and the drain of the PMOSFET Q 1  is symbolically expressed as node C which connects to the gate of the PMOSFET Q 3 . The node C corresponds to the output port  401  of the power selection module  40 . The gate of the PMOSFET Q 3  connects with the ground node E via a resistor R 2 , the source of the PMOSFET Q 3  connects with the node B, and the drain of the PMOSFET Q 3  connects with the anode of the diode D 2 . 
     If the AC/DC adapter, the USB power source, and the battery module are present, the diode D 1  is switched on and the diodes D 2 , D 3  are both switched off, and the DC/DC converter  50  obtains the 12V voltage from the AC/DC adapter and converts the 12V voltage to the required voltage. 
     If only the USB power source and the battery module are present, the gate of the NMOSFET Q 2  (namely node A) obtains a high voltage and controls the NMOSFET Q 2  to switch on. The gate of the PMOSFET Q 1  is connected to the ground node E by the NMOSFET Q 2  and obtains a low voltage, so the PMOSFET Q 1  is switched on. The gate of the PMOSFET Q 3  is connected to the anode of the battery compartment through the PMOSFET Q 1 . The gate of the PMOSFET Q 3  obtains a high voltage and controls the PMOSFET Q 3  to switch off. The DC/DC converter  50  obtains the 5V voltage from the USB port  30  and converts the 5V voltage to the required voltage. 
     If only the battery module is present, the node A connects to the ground node E via the resistor R 3  and obtains a low voltage, and the NMOSFET Q 2  is switched off. The gate of the PMOSFET Q 1  is connected to the anode of the battery compartment  20  through the resistor R 1  and obtains a high voltage, so the PMOSFET Q 1  is also switched off. The gate of the PMOSFET Q 3  is connected to the ground node E through the resistor R 2  and obtains a low voltage. The PMOSFET Q 3  is then switched on. The DC/DC converter  50  obtains the 7.2V voltage from the battery module and converts the 7.2V voltage to the 3.7V voltage to power the electronic device. 
     In another embodiment, the first switch  401  and the path switch  60  can be bipolar junction transistors (BJTs). The first switch  401  and the path switch  60  can be positive-negative-positive (PNP) BJTs, and the second switch  402  can be a negative-positive-negative (NPN) BJT. The bases, emitters, and collectors of the PNP BJTs and the NPN BJT constitute the control terminals, the first path terminals, and the second path terminals, respectively, of the first switch  401 , the second switch  402 , and the path switch  60 . 
       FIG. 3  is a block diagram of a second embodiment of an electronic device capable of automatically selecting a power source. Here, the first external power source and the second external power source supply power with voltages that are lower than the voltage of the battery module. Compared to the first embodiment of the present invention, the electronic device further includes a power selection module  70  connected between the first power port  10  and the battery compartment  20 . The power selection module  70  has the same structure and function as the power selection module  40 , but also includes an output terminal  701  which connects with the control port  601  of the path switch  60 . 
     If an external power source and the battery module are present, either power selection module  40  or  70  controls the path switch  60  to switch off, thereby selecting the external power source to power the electronic device. Furthermore, if both the first external power source and the second external power source are present, the unidirectional switch D 1  or D 3  is switched on or off depending on the voltages of the first external power source and the second external power source. For example, if the first external power source supplies a higher voltage than the second external power source, the unidirectional switch D 1  is switched on and the unidirectional switch D 3  is switched off. Otherwise, if the second external power source supplies a higher voltage than the first external power source, the unidirectional switch D 3  is switched on and the unidirectional switch D 1  is switched off. In this configuration, the external power source that supplies a higher voltage powers the electronic device. 
     In the embodiments, if there is both an external power source and a built-in power source (e.g., batter module), the electronic device will automatically select the external power source to power itself. If two or more external power sources are simultaneously present, the electronic device automatically selects the external power source which can provides a higher voltage to power itself. 
     It is believed that the present embodiments and their advantages will be understood from the foregoing description, and it will be apparent that various changes may be made thereto without departing from the spirit and scope of the invention or sacrificing all of its material advantages, the examples hereinbefore described merely being exemplary embodiments of the invention.