0
\$\begingroup\$

I would like to throttle the power output of an LED light when the battery level is getting low.

My initial approach was to measure the voltage and start throttling at about 3.7 V (which in my estimation is 20% left).

However, drawing high current from the cell drops the battery voltage considerably. At high currents, the voltage drops to 3.7 V already at 80% battery capacity.

Unfortunately, these are my observations and I do not have any math to actually calculate the remaining capacity. Basically what I need is a formula:

battery_level = f(battery_voltage, battery_temperature, battery_capacity, discharge_current)

Given this information, how can I determine the battery level? Am I missing something important?

\$\endgroup\$
2
  • \$\begingroup\$ Just as kind of a book-keeping thing, we like to eventually have questions get answered (officially) or closed. Please consider accepting one of the answers or, if you solve the problem another way, write your own answer and accept it. It is perfectly OK to answer your own question and accept the answer. Also, if you accept an answer and change your mind you can un-accept it later. \$\endgroup\$
    – user57037
    Commented Oct 10, 2022 at 19:02
  • \$\begingroup\$ I will as soon as I will able to confirm that the answer worked out for me. \$\endgroup\$ Commented Oct 11, 2022 at 20:03

2 Answers 2

2
\$\begingroup\$

It is not possible to estimate the battery level only from those things. But you can get pretty close if you use:

true_battery_voltage = battery_voltage - (Rs * discharge_current)

Rs is the series resistance of your battery. You would have to look that up or determine it experimentally. When the true battery voltage reaches 3.7 you can throttle back.

The battery temperature and capacity barely matter so I am ignoring them.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you, I will try this out. Since I can calculate the discharge current, I can even calibrate the device on start to allow using different batteries. \$\endgroup\$ Commented Oct 10, 2022 at 12:29
1
\$\begingroup\$

If you are using PWM from a microcontroller to adjust the current for the LEDs, you could try measuring the battery voltage during the OFF time. I think the internal resistance of the lithium cell increases as SOC decreases, and if so, you can't use it as a constant in an equation. No load voltage should be a better indicator of SOC. However, when load is removed, it may take some time for the cell's voltage to recover, so this needs to be taken into account, especially if PWM frequency is high.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I agree with this answer too. The Rs I mention in my answer varies based on state of charge and also how far along the battery is in its life cycle. However, correcting for discharge_current * Rs, even if your Rs is not quite right, is still better than not correcting for discharge_current * Rs. So while it will not give a super accurate result, it MIGHT be accurate enough. \$\endgroup\$
    – user57037
    Commented Oct 8, 2022 at 23:52
  • \$\begingroup\$ I think this approach won't work in my case, because the PWM frequency is rather high (16kHz) and duty cycle can be 100%. I cannot lower the PWM frequency because of the noise will become audible. To perform a read I will have to switch off both PWM channels for a short time. In addition, I have to wait for the state to settle before performing the measturement. \$\endgroup\$ Commented Oct 10, 2022 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.