Voltage measuring and sleep mode

Hi everybody,
I have a project containing a high voltage battery pack (6S 18650 battery = 25.2V when fully charged and a capacity of 15200mAh) and I need to measure it's voltage. My plan is to use a voltage divider circuit. But do I wire the Voltage divider circuit to the charging/discharging port of the BMS or to the Battery output directly !? If directly to the Battery output, I think I can measure the voltage of each cell on it's own. How many Volts and Amps are needed to charge this pack !? Note that I also want to measure the exact battery voltage while charging. And for the second question, I'm using and Arduino Mega for this project, and when charging, it will be in sleep mode, but is there a way to send the voltage by bluetooth even in sleep mode or the Arduino can't do anything in Sleep mode !?

Yes.

No, You can't that way.

Read the datasheet.

Why?

Who would send that signal? A sleeping Mega controller won't do it.

I meant each cell with the previous one

It will be a DIY battery pack, so there won't be any datasheet

To display the battery pourcentage while charging, is it possible by connecting the voltage divider circuit to the battery directly or will it measure the charger's voltage !?

And by the way, thank you for your short and clear answers

Note that charging an unmatched home made LiPo battery pack with a charger that is not designed for charging a 6S pack can be very dangerous.

A 6S LiPo pack with a 6S BMS should be charged with 6*≤4.2volt = 25.2volt (absolute max).
You should limit charge current to a value the battery and BMS module can take.
Too much battery imbalance and a too high charge current will heat up the BMS.

A Mega is a poor choice for sleep mode.

Voltage dividers should drop to ≤2.56volt, and the Mega should be switched to 2.56volt Aref.
Leo..

The BMS can take up to 20A, so maybe I can charge with a 24V 2A power supply

I did not understand that part. And the voltage divider that I'll use will use R1 of 100Komhs and R2 of 10Kohms, so it will lower the voltage from 55V to 5V so there won't be any problem withe Mega's analog pins. But I did not understand your reply.

Why !? (By the way I made a mistake about the battery pack's capacity, it is 15200mAh, not 1520mAh) And What can I use instead !?

If you're still talking about a 6S pack (25.2volt),
then a 100k:10k divider will drop to 10 / (10 + 100) * 25.2 = 2.29volt.
This is a good match for the Mega's more stable internal 2.56volt reference.
Switch to that, and you get A/D values of 0-1023 with input voltages of 0-28volt.

A Mega is power-hungry, and not every part on the board can be put to sleep.
Leo..

So I understood that by getting A/D values of 0-1023 with input voltages of 0-28volt I'll get a more precise voltage measuring, but I still did not understand the 2.56V reference. Can you explain to me the circuit or how to do the thing to get the more precise measuring please !?

Any ADC needs a reference-voltage for the Analog to Digital Conversion-process
This can be an external feeded in voltage or some ADCs offer an internal voltage reference.

The max digital-value at 10 bit resolution of the ADC this is 1023 relates to the reference-voltage
Changing the reference-voltages changes at what voltage the maximum digital-value is related to.

A 6S pack has a nominal voltage of 6* 3.7V = 22.2V
energy stored in your battery 22.2V * 15.2Ah = 337 Wh
You should only discharge down to 20%
usable energy 337 * 0.8 = 269 Wh.

Here is a thread that shows how much power an arduno Mega needs in different modes and with different hardware-modifications

sleepmode with bypassing onboard voltage-regulator says 0,23W
This means your battery will be discharged to 20% which is defacto empty
after 269 Wh / 0.23W = 1169 hours.

Anyway if you dont use a highly reliable charging-balancer
Your battery will overload one of the cells which then will catch fire.
I would do this only outside with anything than can burn minimum distance 2 m away.

I would change to a LiFePo4-battery which is secure in itself and does not explode or catch fire.
The higher costs of a LiFePo4-battery is the insurance money against fire.
Still charging balancing applies to a LiFePo4-battery

If you want to stay low cost and secure with easy to use charging technology use a sealed lead-acid-battery or a professional charger which has inbuilt cell-balancing

Or use a single-cell LiFePo4 so the thing cant be disbalanced as only a single cell is used
in combination with a DC-DC-step-up voltage-regulator

best regards Stefan

So if I connect 2.56V to the Aref pin, I will get 1023 at 2.56V in the Analog pin (wich means 28.2V il the input of the voltage divider) so that will give me a much higher precision, if I understood well

Why should I discharge the battery !?

How will it be discharged !?

As soon as I get home, I'll share with you guys my circuit diagram cuz now I don't have my laptop.

This explanation made me assume you are using the Arduino Mega on battery-operation
Why else would you want the Arduino Mega go into sleepmode???

using your battery for whatever will discharge the battery

If your Arduino Mega is supplied through the battery it will discharge the battery

Your thread shows again that it is very important to give a much more detailed description of your project.

I guess I made assumings that are all wrong.
So please give a much more detailed description of your project

best regards Stefan

I'm realizing a project wich is making an RC boat, I want the Arduino in sleep mode to wake quickly and I was planning on keeping the bluetooth communication always active, so if I send a command to the boat it wakes up automatically, but apparently it can wake up only by the Interrupt pins, and apparently when in Sleep Mode the microcontroller can't do anything.

I wanted to make my boat like the autonomous vacuum robot like Xiaomi's, but I'll face a lot lf problems doing that. That's why I prefer some personnal guidance over forums, but unfortunately in Tunisia, I can't find any help, that's why I'm using this forum, creating a lot of threads :sweat_smile: By the way Stefan I really appreciate your help also in other threads.

That is an oversimplification. For example, many devices don't actually go permanently to sleep while in standby or power saving mode. Instead, they use a timer that wakes periodically, does a little housekeeping, checks whether it is time to wake up, and then goes back to sleep if not. The overall duty cycle of the processor remains low, while it is still possible for the processor to respond slowly to external stimuli.

But, if it were myself building this robotic boat, I would complete most of the project and have a working, non-sleeping boat for a long time before worrying about power saving. Otherwise, I risk having power saving for a robot that doesn't exist.

I agree 100% with @anon57585045 on his points.

If I read the numbers correct, it will run for 1100 some hours.

That's over a half a year of 8 hours/day operation. Is a low power mode really going to buy you much for the complexity... that you can add later while it's out working :crazy_face:

IMHO, you bit off a lot to chew here... keep in mind one of the most valuable engineering principles KISS (keep it simple stupid)... you can always add on ... beauty of diy...


Imagining it is the most important part then implementation. There is nothing to implement without it being imagined first ...

Good luck..

:smiley_cat:

Ok, I won't be adding sleep / low power mode till I finish the main project of building the boat, then I'll think of it, so there's no risk of building a boat that is on 24h/24 even when the battery pack is charging. Now the question is will the Arduino measure the charger's voltage or the battery's voltage while charging !?

Charger voltage and battery voltage is the same.
If you use the right charger, then it will adjust it's voltage to keep charging current constant.
Leo..

More precisely, my question is when charging with 24V, and my battery voltage is 19.2V, when I measure the voltage directly from the battery's output, will it give me 24V or 19.2V !?

A current limited power supply (LiPo charger) adjust (lowers) it's voltage when needed.

You set it for 25.2volt, which is the maximum it ever will output.
The supply reduces it's voltage when the battery is still less than that,
so the current stays within the capabilities of the supply.
Leo..

So according to my example, I will get 19.2V is that right !? If I understood, the charger's voltage is equal to the battery's voltage

@00110010_techboy_00110010 look up Immitiately your private messages !

@00110010_techboy_00110010 look up your private messages !