Abstract:
An electronic device includes a current detection module, two path switches, a processing unit, and two control circuits. Two terminals of the current detection module are connected to an external power port and a battery. The two path switches are connected to the two terminals. A first control circuit is connected to the processing unit and to one path switch. A second control circuit is connected to the processing unit and to another path switch. When the electronic device is powered on, whether using power from the battery or from the external power port, the device can analyze the power consumed by the functioning parts of the device, including (when power is taken from the external power port) the amount of current taken in charging the battery.

Description:
BACKGROUND 
       [0001]    1. Technical Field 
         [0002]    The present disclosure relates to electronic devices, and particularly to an electronic device capable of detecting and specifying power consumption by individual elements within the electronic device. 
         [0003]    2. Description of Related Art 
         [0004]    Electronic devices, such as mobile phones and tablet computers usually include a number of functioning parts, such as a processor, a display, and software applications, and a battery to power these functioning parts. Those electronic devices can display battery level to indicate the remaining energy of the battery. However, they cannot detect power consumption of each functioning part, thus, cannot give information to the user when one function module consumes a lot, or an excessive amount, of energy. 
         [0005]    In addition, when an electronic device is being charged, it is only capable of detecting the total power consumption including the functioning parts and the battery recharging, and cannot give separate power consumptions relating to the functioning parts and the battery. 
         [0006]    An electronic device capable of detecting and categorizing power consumptions to overcome the described limitations is thus needed. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]    Many aspects of the present disclosure are better understood with reference to the following 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 disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the views. 
           [0008]      FIG. 1  is a block diagram of one embodiment of an electronic device capable of detecting particular consumptions of power. 
           [0009]      FIG. 2  is a circuit diagram of one embodiment of the electronic device of  FIG. 1 . 
       
    
    
     DETAILED DESCRIPTION 
       [0010]    Embodiments of the present disclosure will be described with reference to the accompanying drawings. 
         [0011]      FIG. 1  illustrates a block diagram of an electronic device  100  capable of detecting particular consumptions of power. The electronic device  100  includes an external power port  10 , a battery  20 , a processing unit  30 , a current detection module  40 , a first path switch  50 , a second path switch  60 , a first control circuit  70 , a second control circuit  80 , a system power input port Vs, and a number of functioning parts  90 . 
         [0012]    The external power port  10  receives an external power source  200 , such as a USB power source or a power adapter. The external power port  10  can be a USB port or a power adapter port. 
         [0013]    The system power input port Vs receives power from the external power source  200  or from the battery  20 , and powers the functioning parts  90 . In detail, when the external power port  10  has been connected to the external power source  200 , the system power input port Vs receives power from the external power source  200  and then powers the functioning parts  90 . When the external power port  10  is not connected to the external power source  200 , the system power input port Vs takes power from the battery  20  and then powers the functioning parts  90 . In the embodiment, the functioning parts  90  include software applications, such as a browser application, a reader application, and hardware units, such as a processor and a display unit. 
         [0014]    The current detection module  40  includes a first terminal  401  and a second terminal  402 . The first terminal  401  is connected to an anode input port  101  of the external power port  10 , and the second terminal  402  is connected to an anode Vbat of the battery  20 . The current detection module  40  detects the amount of current flowing through it and converts the current to a detection voltage. 
         [0015]    The first path switch  50  is connected between the first terminal  401  of the current detection module  40  and the system power input port Vs. The second path switch  60  is connected between the second terminal  402  of the current detection module  40  and the system power input port Vs. 
         [0016]    The processing unit  30  includes a detection port  301 , a first control pin C 1 , and a second control pin C 2 . The detection port  301  is connected to the current detection module  40 , the processing unit  30  obtains the detection voltage from the current detection module  40  via the detection port  30 . 
         [0017]    The first control circuit  70  is electrically connected between the first path switch  50  and the first control pin C 1 , and is used to control the first path switch  50  to turn on or off according to control signals output by the first control pin C 1 . In detail, the first control circuit  70  controls the first path switch  50  to turn on when receiving a first control signal, and controls the first path switch  50  to turn off when receiving a second control signal. 
         [0018]    The second control circuit  80  is electrically connected between the second path switch  60  and the second control pin C 2 , and is used to control the second path switch  60  to turn on or off according to control signals output by the second control pin C 2 . In detail, the second control circuit  80  controls the second path switch  60  to turn on when receiving the first control signal, and controls the second path switch  60  to turn off when receiving the second control signal. 
         [0019]    When the electronic device  100  is powered on, if the processing unit  30  detects that the external power port  10  is not connected to the external power source  200 , the processing unit  30  controls the first control pin C 1  to output a first control signal and controls the second control pin C 2  to output a second control signal. The first control circuit  70  controls the first path switch  50  to turn on when receiving the first control signal from the first control pin C 1 , and the second control circuit  80  controls the second path switch  60  to turn off when receiving the second control signal from the second control pin C 2 . Then, the battery  20 , the current detection module  40 , the first path switch  50 , and the system power input port Vs are in a loop, and the battery  20  provides power to the functioning parts  90  via the current detection module  40 , the first path switch  50 , and the system power input port Vs. 
         [0020]    Because the current flowing through the current detection module  40  is all taken by the functioning parts  90 , this current reflects the total power consumption of the functioning parts  90 . The processing unit  30  then determines the current flowing through the current detection module  40  according to the detection voltage instantaneously obtained, and determines the power consumption of the functioning parts  90  according to the current flowing through the current detection module  40 . 
         [0021]    In the embodiment, the processing unit  30  also includes a voltage detection pin P 1 , the voltage detection pin P 1  is connected to the anode input port  101  of the external power port  10 . The processing unit  30  determines that the external power port  10  has been connected to the external power source  200  when the voltage detection pin P 1  detects a digital-high voltage, and determines the external power port  10  is not connected to the external power source  200  when the voltage detection pin P 1  detects a digital-low voltage. 
         [0022]    When the electronic device  100  is powered on and is being charged, namely, the electronic device  100  is powered on and the processing unit  30  detects that the external power port  10  is connected to the external power source  200 , the processing unit  30  by default controls the first control pin C 1  to output the second control signal and controls the second control pin C 2  to output the first control signal. The first control circuit  70  controls the first path switch  50  to turn off when receiving the second control signal from the first control pin C 1 , and the second control circuit  80  controls the second path switch  60  to turn on when receiving the first control signal from the second control pin C 2 . Thus, the current provided by the external power source  200  flows through the current detection module  40  and is then divided to power the functioning parts  90  via the second path switch  60  and the system power input port Vs, and also to charge the battery  20 . In this situation, the current flowing through the current detection module is the current provided by the external power source  200 . 
         [0023]    Then, the processing unit  30  determines the current provided by the external power source according to the obtained detection voltage. The processing unit  30  then can determine a total consumption of power of the functioning parts  90  and of the battery according to the obtained detection voltage. 
         [0024]    When the electronic device  100  is powered on and is being charged, and the processing unit  30  receives a command to query charging status, the processing unit  30  controls the first control pin C 1  to output the first control signal and controls the second control pin C 2  to output the second control signal. Thus, as described above, the first control circuit  70  controls the first path switch  50  to turn on when receiving the first control signal from the first control pin C 1 , and the second control circuit  80  controls the second path switch  60  to turn off when receiving the second control signal from the second control pin C 2 . Thus, a current provided by the external power source  200  is then divided into power for the functioning parts  90  via the path switch  50  and the system power input port Vs and power for charging the battery  20  via the current detection module  40 . Here, the current flowing through the current detection module  40  is the current which is charging the battery  20 . 
         [0025]    Then, the processing unit  30  can determine the charging status of the battery  20  according to the obtained detection voltage converted by the current flowing through the current detection module  40 . Specifically, the processing unit  30  determines the current required to charge the battery  20  according to the detection voltage obtained via the detection port  301 , and then determines the charging status, such as the speed of charge of the battery  20  based on the current required to charge the battery  20 . The charging status is considered as the power consumption of the battery  20 . In the embodiment, the command to query the charging status can be produced by operating a particular button, or selecting a menu item. 
         [0026]    When the electronic device  100  is powered on and is being charged, the processing unit  30  may receive a command to query power consumption of the functioning parts  90 . The processing unit  30  obtains the current provided by the external power source and the charging current as above, and deletes the level of charging current from the current provided by the external power source  200 , to obtain the amount of current provided to the functioning parts  90 . Thus, the processing unit  30  can determine the power consumption of the functioning parts  90  based on the amount of current provided to the functioning parts  90 . The command to query the power consumption of the functioning parts  90  also can be produced by operating a particular button, or selecting a menu item. 
         [0027]    Therefore, the electronic device  100  can detect the respective consumptions of power of the functioning parts  90  and of the battery  20 , when the electronic device  100  is powered on and the battery  20  is being charged. The electronic device  100  also can detect the power consumption of the functioning parts  90  when the electronic device is powered on and is powered by the battery  20 . 
         [0028]    In the embodiment, the electronic device  100  also includes a charge path switch  91 . The charge path switch  91  is connected between the anode input port  101  and the current detection module  40 . The charge path switch  91  is turned on when the external power port  10  connects to the external power source  200 , and is turned off when the external power port  10  is not connected to the external power source  200 . 
         [0029]    Referring to  FIG. 2  together,  FIG. 2  illustrates a circuit diagram of the electronic device  100  of  FIG. 1 . In the circuit, the current detection module  40  is a resistor R 1 . The first terminal  401  and the second terminal  402  of the current detection module  40  are respectively a first terminal  401  and a second terminal  402  of the resistor R 1 . 
         [0030]    The first path switch  50  includes a positive-negative-positive (PNP) bipolar junction transistor (BJT) Q 1  and a resistor R 2 . The resistor R 2  is connected between a base of the PNP BJT Q 1  and an emitter of the PNP BJT Q 1 . The emitter of the PNP BJT Q 1  is also connected to the first terminal  401  of the resistor R 1 , and a collector of the PNP BJT Q 1  is connected to the system power input port Vs. 
         [0031]    The second path switch  60  includes a PNP BJT Q 2  and a resistor R 3 . The resistor R 3  is connected between a base of the PNP BJT Q 2  and an emitter of the PNP BJT Q 2 . The emitter of the PNP BJT Q 2  is also connected to the second terminal of the resistor R 1  and the anode Vbat of the battery  20 . A collector of the PNP BJT Q 2  is also connected to the system power input port Vs. 
         [0032]    The first control circuit  70  includes a negative-positive-negative (NPN) BJT Q 3  and resistors R 4 , R 5 . A base of the NPN BJT Q 3  is electrically connected to the first control pin C 1  of the processing unit  30 , the base of the NPN BJT Q 3  is also grounded via the resistor R 4 . An emitter of the NPN BJT Q 3  is grounded via the resistor R 5 , and a collector of the NPN BJT Q 3  is electrically connected to the base of the PNP BJT Q 1 . 
         [0033]    The second control circuit  80  includes an NPN BJT Q 4  and resistors R 6 , R 7 . A base of the NPN BJT Q 4  is electrically connected to the second control pin C 2  of the processing unit  30 , and the base of the NPN BJT Q 4  is also connected to the anode Vbat of the battery  20  via the resistor R 6 . An emitter of the NPN BJT Q 4  is grounded via the resistor R 7 , and a collector of the NPN BJT Q 4  is electrically connected to the base of the PNP BJT Q 2 . 
         [0034]    In the embodiment, the first control signal output by the first control pin C 1  or the second control pin C 2  is a digital-high voltage signal, and the second control signal output by the first control pin C 1  or the second control pin C 2  is a digital-low voltage signal. 
         [0035]    As described, when the electronic device is powered on and the external power port  10  is not connected to the external power source  200 , the processing unit  30  controls the first control pin C 1  to output the first control signal, and controls the second control pin C 2  to output the second control signal. Because the first control signal is the digital-high voltage signal and the second control signal is the digital-low voltage signal, the NPN BJT Q 3  is turned on due to the base of the NPN BJT Q 3  receives the digital-high voltage signal from the first control pin C 1  and the NPN BJT Q 4  is turned off due to the base of the NPN BJT Q 3  receives the digital-low voltage signal from the second control pin C 2 . The base of the PNP BJT Q 1  is grounded via the NPN BJT Q 3  which is turned on, thus the PNP BJT Q 1  is turned on, namely the first path switch  50  is turned on. The base of the PNP BJT Q 2  is connected to the anode Vbat of the battery  20  via the resistor R 3  and at high voltage, thus the PNP BJT Q 2  is turned off, namely the second path switch  60  is turned off. 
         [0036]    Therefore, the current provided by the battery flows through the resistor R 1 , the PNP BJT Q 1 , and the system power input port Vs and then is provided to the functioning parts  90 . The processing unit  30  obtains the voltage of the resistor R 1  via the detection port  301  and determines the power consumption of the functioning parts  90  according to the obtained voltage of the resistor R 1 , namely the detection voltage. 
         [0037]    When the electronic device  100  is powered on and the battery  20  is being charged, if the processing unit  30  does not receive a command to query the power consumption of the functioning parts  90  or a command to query the battery level, the processing unit  30  by default controls the first control pin C 1  to output the second control signal and controls the second control pin C 2  to output the first control signal. 
         [0038]    Because the first control signal is the digital-high voltage signal and the second control signal is the digital-low voltage signal, the NPN BJT Q 3  is turned off due to the base of the NPN BJT Q 3  receives the digital-low voltage, and the NPN BJT Q 4  is turned on due to the base of the NPN BJT Q 4  receives the digital-high voltage. The base of the PNP BJT Q 1  is electrically connected to the anode input port  101  of the external power port  10 , thus the PNP BJT Q 1  is turned off, namely the first path switch  50  is turned off. The base of the PNP BJT Q 2  is grounded via the NPN BJT Q 4  which is turned on, thus the PNP BJT Q 2  is turned on, namely, the second path switch  60  is turned on. 
         [0039]    Therefore, the current provided by the external power source  200  is divided between charging the battery  20  and powering the functioning parts  90  after flowing through the resistor R 1 . In this situation, the current flowing through the resistor R 1  is the current provided by the external power source  200 . 
         [0040]    When the electronic device  100  is powered on and the battery  20  is being charged, as described, if the processing unit  30  receives a command to query the charging status, the processing unit  30  controls the first control pin C 1  to output the first control signal and controls the second control pin C 2  to output the second control signal. Thus, the PNP BJT Q 1  is turned on and the PNP BJT Q 2  is turned off, the current provided by the external power source  200  is divided between powering the functioning parts  90 , via the PNP BJT Q 1  and the system power input port Vs, and charging the battery  20  via the resistor R 1 . Here, the current flowing through the resistor R 1  is the charging current taken by the battery  20 . 
         [0041]    When the electronic device  100  is powered on and the battery  20  is being charged, if the processing unit  30  receives a command to query the power consumption of the functioning parts  90 , the processing unit  30  deletes the current taken by the battery  20  from the amount of current provided by the external power source  200 , thus obtaining the amount of current provided to the functioning parts  90 . The processing unit  30  thus determines the power consumption of the functioning parts  90  according to the amount of current provided to the functioning parts  90 . 
         [0042]    In detail, in the embodiment, the detection port  301  of the processing unit  30  includes a first detection pin D 1  and a second detection pin D 2 . The first detection pin D 1  and the second detection pin D 2  are respectively connected to the first terminal  401  and the second terminal  402  of the resistor R 1 . The detection voltage obtained by the detection port  301  is the voltage of the resistor R 1 , namely, the voltage difference between the first terminal  401  and the second terminal  402 . In the embodiment, the processing unit  30  stores a resistance value of the resistor R 1  and a relationship table. The relationship table defines relationships between a number of amounts of current (values) and power consumption states. When the processing unit  30  obtains the detection voltage, the processing unit  30  calculates the current according to the resistance value of the resistor R 1  and the detection voltage, and then determines the power consumption state corresponding to that level of current. In the embodiment, the power consumption states include the rate of power consumption, state of battery charge and charging rate. In the embodiment, the processing unit  30  provides visible information concerning the power consumption states to the user after determining the power consumption states. 
         [0043]    The charge path switch  91  includes a PNP BJT Q 5  and a resistor R 8 . A base of the PNP BJT Q 5  is grounded via the resistor R 8 , an emitter of the PNP BJT Q 5  is connected to the anode input port  101  of the external power port  10 , and a collector of the PNP BJT Q 5  is connected to the first terminal  401  of the resistor R 1 . When the external power port  10  connects to the external power source  200 , the emitter of the PNP BJT Q 5  obtains a high voltage, and a voltage between the emitter of the PNP BJT Q 5  and the base of the PNP BJT Q 5  is positive, thus the PNP BJT Q 5  is turned on. When the external power port  10  is not connected to the external power source  200 , there is no voltage between the emitter of the PNP BJT Q 5  and the base of the PNP BJT Q 5 , and the PNP BJT Q 5  is turned off. 
         [0044]    In another embodiment, P-channel metal oxide semiconductor Field Effect Transistors (PMOSFETs) can substitute for the PNP BJTs, and N-channel metal oxide semiconductor Field Effect Transistors (NMOSFETs) can substitute for these NPN BJTs. 
         [0045]    In the embodiment, the electronic device  100  can be a mobile phone, a computer, a digital photo frame, a digital camera, or the like. 
         [0046]    It is understood that the present embodiments and their advantages will be understood from the foregoing description, and various changes may be made thereto without departing from the spirit and scope of the disclosure or sacrificing all of its material advantages, the examples hereinbefore described merely being exemplary embodiments of the present disclosure.