Monitoring battery health of a battery used in a device
Approaches provide for determining an internal rate of resistance of a battery in a computing device. In particular, various examples enable using a processor to expose the battery to a first load at a first rate of consumption and to measure a first analog voltage across the battery during exposure of the battery to the first load. The processor is able to expose the battery to a second load a second rate of consumption and to measure a second analog voltage across the battery during exposure of the battery to the second load. Linear equations can be used to solve for the battery's internal rate of resistance based at least in part on the first rate of consumption, the first analog voltage, the second rate of consumption, and the second analog voltage. In various embodiments, the battery's internal rate of resistance can be correlated to a battery health indicator.
1. A method for determining battery health in a card reader, the method comprising:
causing, by a processor, a battery to be exposed to a first load by running the processor at a first clock rate to maintain the card reader at a first rate of power consumption;
measuring, using an analog input pin of the processor, a first voltage across the battery in response to exposure of the battery to the first load;
causing, by the processor, the battery to be exposed to a second load by running the processor at a second clock rate that is different from the first clock rate to maintain the card reader at a second rate of power consumption that is different from the first rate of power consumption, wherein exposing the battery to the first load and exposing the battery to the second load are performed also based on switching an element between an activated state and a deactivated state, wherein the element includes at least one of a component of the card reader, a light emitting diode (LED) of the card reader, or a peripheral of the processor;
measuring, using the analog input pin of the processor, a second voltage across the battery in response to exposure of the battery to the second load;
determining an internal resistance of the battery via one or more calculations in which values are used in one or more equations, the values including the first rate of power consumption, the first voltage, the second rate of power consumption, and the second voltage;
generating an indicator of a health of the battery based on the internal resistance; and
outputting, by the card reader, the indicator of the health of the battery.
2. The method of claim 1 , wherein causing, by the processor, the battery to be exposed the first load by running the processor at the first clock rate to maintain the card reader at the first rate of power consumption further comprises:
executing instructions by the processor at the first clock rate, the instructions stored in one or more non-transitory computer-readable media, wherein execution of the instructions by the processor at the first clock rate causes the processor to maintain the battery at the first rate of power consumption.
3. The method of claim 2 , wherein causing, by the processor, the battery to be exposed to the second load by running the processor at the second clock rate that is different from the first clock rate to maintain the card reader at the second rate of power consumption further comprises:
executing the instructions by the processor at the second clock rate, wherein execution of the instructions by the processor at the second clock rate causes the processor to maintain the battery at the second rate of power consumption.
4. The method of claim 3 , further comprising:
determining that the battery is at least one of: fully charged, charged to a threshold amount, or charged for a threshold amount of time.
5. The method of claim 1 , further comprising:
prior to exposing the battery to the first load, disabling an interrupt system configured to manage interrupts for the processor.
6. The method of claim 1 , further comprising:
prior to exposing the battery to the first load, determining, by the processor, that the battery has completed a charge cycle.
7. The method of claim 1 , wherein causing the battery to be exposed to the first load is triggered in response to determining that the card reader has been disconnected from a charger configured to charge the battery.
8. The method of claim 1 , wherein the battery is a rechargeable battery corresponding to at least one of a lead-acid battery, a nickel cadmium battery (NiCd), a nickel metal hydride (NiMH) battery, a lithium ion (Li-ion) battery, or a lithium ion polymer (Li-ion polymer) battery.
9. The method of claim 1 , further comprising:
causing, by the processor, the battery to be exposed to the first load to maintain the card reader at the first rate of consumption;
measuring a third voltage across the battery;
causing, by the processor, the battery to be exposed to the second load to maintain the card reader at the second rate of consumption;
measuring a fourth voltage across the battery;
determining a first average voltage based at least in part on the first voltage and the third voltage;
determining a second average voltage based at least in part on the second voltage and the fourth voltage; and
determining the internal resistance of the battery based at least in part on the first rate of consumption, the first average voltage, the second rate of consumption, and the second average voltage.
10. The method of claim 1 , wherein outputting the indicator of the health of the battery includes displaying a message on a display interface.
11. The method of claim 1 , wherein generating the indicator of the health of the battery based on the internal resistance includes modeling a discharge curve of the battery.
12. The method of claim 1 , wherein outputting the indicator of the health of the battery includes activating at least one light emitting diode (LED) of the card reader.
13. The method of claim 1 , wherein outputting the indicator of the health of the battery includes displaying a message on a display interface of a computing device to which card reader is coupled.
14. A device, comprising:
a battery configured to provide power to a processor;
an output interface that outputs an indicator of a health of the battery; and
the processor configured to:
cause the battery to be exposed to a first load by running the processor at a first clock rate to maintain the device at a first rate of power consumption,
measure a first voltage across the battery using an analog input pin of the processor in response to exposure of the battery to the first load,
cause the battery to be exposed to a second load by running the processor at a second clock rate that is different from the first clock rate to maintain the device at a second rate of power consumption that is different from the first rate of power consumption, wherein exposing the battery to the first load and exposing the battery to the second load are also based at least in part on switching an element between an activated state and a deactivated state, wherein the element includes at least one of a component of the device, a light emitting diode (LED) of the device, or a peripheral of the processor,
measure a second voltage across the battery using the analog input pin of the processor in response to exposure of the battery to the second load,
determine an internal resistance of the battery via one or more calculations in which values are used in one or more equations, the values including the first rate of power consumption, the first voltage, the second rate of power consumption, and the second voltage, and
generate the indicator of the health of the battery based on the internal resistance.
15. The device of claim 14 , wherein the processor is further configured to disable an interrupt system prior to exposing the battery to the first load, further comprising:
the interrupt system, wherein the interrupt system is configured to manage interrupts for the processor.
16. The device of claim 14 , wherein the processor is further configured to:
cause the battery to be exposed to the first load to maintain the device at the first rate of consumption;
measure a third voltage across the battery;
cause the battery to be exposed to the second load to maintain the device at the second rate of consumption;
measure a fourth voltage across the battery;
determine a first average voltage based at least in part on the first voltage and the third voltage;
determine a second average voltage based at least in part on the second voltage and the fourth voltage; and
determine the internal resistance of the battery based at least in part on the first rate of consumption, the first average voltage, the second rate of consumption, and the second average voltage.
17. The device of claim 14 , further including:
a housing having a reader for reading a financial transaction card to facilitate a financial transaction between a buyer and seller; and
an output adapted to be coupled into a portable computing device for providing a signal indicative of data that is transferable from the device to the portable computing device.