Patent ID: 9110651
Filing Date: 2015-08-18
Classification: G06F

Abstract:
1. An electronic device capable of detecting consumption of power, the electronic device comprising: a plurality of functioning parts; an external power port configured to connect to an external power source; a battery; a system power input port configured to receive power from the battery or the external power source and then power the functioning parts, a current detection module configured to detect current flowing therethrough and convert the current to a detection voltage, wherein the current detection module comprises a first terminal and a second terminal, the first terminal is connected to an anode input port of the external power port, and the second terminal is connected to an anode of the battery; a first path switch connected between the first terminal of the current detection module and the system power input port; a second path switch connected between the second terminal of the current detection module and the system power input port; a processing unit comprising a detection port, a first control pin, and a second control pin, wherein, the detection port is connected to the current detection module, the processing unit obtains the detection voltage from the current detection module via the detection port; a first control circuit electrically connected between the first path switch and the first control pin, and configured to control the first path switch to turn on or off according to control signals output by the first control pin; and a second control circuit electrically connected between the second path switch and the second control pin, and configured to control the second path switch to turn on or off according to control signals output by the second control pin; wherein, when the electronic device is powered on, if the processing unit detects the external power port does not connect to the external power source, the processing unit controls the first control pin to output a first control signal and controls the second control pin to output a second control signal; the first control circuit controls the first path switch to turn on when receiving the first control signal from the first control pin, and the second control circuit controls the second path switch to turn off when receiving the second control signal from the second control pin; the battery provides power to the functioning parts via the current detection module, the first path switch, and the system power input port, the processing unit then determines the current flowing through the current detection module according to the obtained detection voltage, and determines power consumption of the functioning parts according to the current flowing through the current detection module.