Advice on voltage meter with or without load

Hi!
I’ve set-up a voltage divider (2x100K) on a Leonardo. It works well to measure an 8.4v li battery, with different levels of led colors that indicate each voltage level on a rgb led.

I’d like to know if there’s any workaround to what happens.

This battery powers a power led. So, when the power led is off, the rgb led shows its voltage level. When I connect a load to the battery (the power led) the voltage drops and the rgb voltage led shows a lower level of voltage. When I turn the power led off, the voltage meter returns to show on the rgb led a higher voltage level.

So the voltage on the battery is temporarily reduced when the load is applied, and gets back to normal when the load is off. It’s not a “real”, pemanent voltage decrease of the battery.

Is there a way to make it show the real state of the battery, no matter this temporarily decrease of voltage because of the load?

Because when the led is off it shows a “healthier” battery than when the led is on.

Thanks!

Refering to a genuin knowledge about lead battories I say that the status of Your battory is the best point for descisions. Your electronics depends on the momentary voltage.
For lead battories it is very important how the charge is decreased. To achieve the highest amount of ampere hours as low discharge rate is used. To stamp the capacity of a lead battory of, say 100 Ah, it is discharged by 10 amps, called C10 until a certain low voltage level is reached. The capacity is the elapsed discharging time x current.
If the same theory applies to all modern battories I can't tell. Maybe it does.

Lithium Ion batteries have a flat discharge curve, so just measuring voltage wont give you an accurate result for how much capacity is left.
The only way to measure the capacity left is a technique called coulumb counting, which requires that the energy supplied by the battery is measured continuously and compared with the batteries maximum capacity.

@mauried
You are surely right. Integrating amps x time was used for lead battories when the battory was delivering the power, not being "idle" and "idle" voltage couldn't be measured.

I don't see which type of Li battery OP is using.
Every battery has some declining voltage during discharge. Some chemistries more than others.
Some have memory effect, others not.
The right code can estimate state of charge somewhat, especially if the load is constant.
You might need two sets of voltage calculation lines in your code.
One without light, and one with.
Leo..

@Wawa
Which measurement will tell what?
An increasing difference might tell that the battory is getting worned out., or?

Sorry. I’m using those Battery packs for Video lights, that varies from 7.2 to 8.4V, and the capacity varies also from vendor to vendor.They are the same as the Sony’s NP-F550 batteries. And they have protection. When voltage gets lower than a limit it shuts down. That’s why i’m using voltage as a reference of measuring than current. When it gets closer to 6V it shuts down.

I agree with you. I was thinking of measuring the voltage with the leds on and off, do the math, and send the appropriate “level” to the rgb led. I don’t need exact precision, just a color warning to remind me to replace the battery when getting close to the lowest capacity limit.

I may have to have 6 measure levels then because I vary brightness by pwm control (5 fixed levels) on the power led.

So I guess for each brightness a different voltage drop will occur.

Aha. The battory has built in logics. I guess that it cuts off regardless of load or not. Then measure the battory voltgage all the time and descide from that.