digitaldanny/AudioEffectsGlove

Battery State of Charge Research

Closed this issue · 5 comments

Is your feature request related to a problem? Please describe.
The user needs a way to gauge how much battery the glove has remaining. This research aims to find possible solutions to capturing charge remaining in a battery.

Describe the solution you'd like
Research the following:

  • State of Charge Determination - this site briefly describes several solutions.
  • What are some factors that might make the measurements inaccurate?
  • How inaccurate is the measurement allowed to be?
  • Would it be worth creating a "low battery state" where the device powers itself off after battery has reached a certain threshold? This would improve the battery life.

Describe alternatives you've considered
N/A

Additional context
N/A

Power Gauging Methods

State of Charge Determination

  • Direct Measurement: Battery charge = current * flowing time. Direct measurement would work if the current was being pulled at a consistent rate. The problem is that the discharge current decreases in a non-linear way as the battery is discharged. Plus this method requires discharging the battery fully to know how much charge it originally contained.
  • Coulomb Counting (Current based estimation): Measure current coming out of battery over time. If battery holds 1000 mAh and you measure 300 mA, there are 700 mAh remaining (70% battery). The reference point is the starting cell energy rather than the end cell energy, so this will account for battery deterioration over time.
  • How do I measure current on a microcontroller?
  • Shunt Resistor: The simplest method of determining the current is by measuring the voltage drop across a low ohmic value, high precision, series, sense resistor between the battery and the load known as a current shunt. This method of measuring current causes a slight power loss in the current path and also heats up the battery and is inaccurate for low currents.
  • Hall effect transducers: Avoid this problem but they are more expensive. Unfortunately they can not tolerate high currents and are susceptible to noise.
  • GMR magnetoresistive sensors: More expensive but have higher sensitivity and provide higher signal level. Also have better temperature stability.

State of Charge Notes:

  • The preferred SOC reference should be the rated capacity of a new cell rather than the current capacity of the cell. This is because the cell capacity gradually reduces as the cell ages. For example, towards the end of the cell's life its actual capacity will be approaching only 80% of its rated capacity and in this case, even if the cell were fully charged, its SOC would only be 80% of its rated capacity.
  • Will need to experiment with the stability of current output since this will affect how often I need to take current measurements. If there is low stability, I will need a higher sample rate to capture the highs/lows and get a good approximation of the current consumption.

This YouTube video by EEVblog discusses the LM3914 Dot/Bar Display Driver IC. A solution based on this IC would be to make a circuit using several comparators and a voltage ladder that powers 5-10 LEDs. Each LED would indicate an additional 10-20% battery charge. Below are some comparisons between the microcontroller and LM3914-like approaches.

LCD and microcontroller

Pros:

  • The LCD could be programmed with some more interesting characters.
  • The LCD could show a more precise charge percentage (0-100 percent, or even multiple decimal places).

Cons:

  • Requires uC time to write to the LCD.
  • Requires uC time to sample ADC values frequently enough to capture the highs/lows of the load's current draw.

LEDs and LM3914-like circuit

Pros:

  • Does not use any uC time.
  • Analog circuit will update LEDs instantly.

Cons:

  • Will be more difficult to demo since the glove won't drop 10%-20% battery charge within a 5 minute demo.
  • Hardware based approach cannot be changed after the PCB design is submitted.
  • Showing a few LEDs won't look as nice as having an LCD output.

Showing a few LEDs won't look as nice as having an LCD output.

A possible solution to this would be to use an additional ADC pin on the microcontroller and an additional 8x1 analog mux to occasionally read the various voltage thresholds from the voltage ladder. This info could be used to find the battery percentage and update the LCD, but it also eliminates the issue of high CPU usage due to the ADC frequently capturing the current being drawn.

A possible solution to this would be to use an additional ADC pin on the microcontroller and an additional 8x1 analog mux to occasionally read the various voltage thresholds from the voltage ladder. This info could be used to find the battery percentage and update the LCD, but it also eliminates the issue of high CPU usage due to the ADC frequently capturing the current being drawn.

At this point, I might as well just use 1 ADC pin on the microcontroller to read the battery voltage. This will give me a more accurate battery percentage than the 25% increments of using 4 comparators in a circuit, and it will also save PCB space.

Reading 3.3V - 4.2V on 3.3V microcontroller

  • Use an ADC on the microcontroller to read the battery voltage and estimate the charge level based on the battery's discharge curve.
  • Step down the 3.3V - 4.2V discharge curve range to 2.5V - 3.2V using a voltage divider with 10 kOhm and 33 kOhm. This 0.7V voltage range allows for 0.7 * 4096 / 3.3 = 868 distinct voltages with a 12-bit ADC. This should be more than enough for a rough charge estimate without boosting the signal.
  • Use a GPIO controlling a MOSFET to enable/disable ADC connection. This saves a lot of power since the microcontroller would be drawing current for the ADC pin when it only needs to measure 1x - 2x per second.