Go Down

Topic: Measuring the capacity of a battery using ACS712 current sensor ! help ! (Read 1 time) previous topic - next topic

firashelou

Hello everyone,
I would like to know if it is possible and how to make a capacity measuring device which will tell how much the battery still have mAh current left in it according to the circuit it is used in using the current sensor ACS712 like this video ?

thanks in advance
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

MarkT

It depends on the range of currents involved.  The ACS712 is a hall-effect sensor which is not particular accurate at low current, whereas shunt-resistor current-sensing can be very accurate, but severely limits the maximum current.

Are you thinking of deliberately discharging a battery to test its capacity, or do you want to monitor some circuit to predict when the battery is nearly empty?  What battery chemistry?

With any current sensor you can measure total charge by integrating over time, but issues of accuracy and dynamic range are important as is the power consumption of the measurement circuit.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

gilshultz

As I understand what you are asking is how to make a battery "fuel" gauge.  It is possible. You could take most of the ideas from the video but realize you need to know the current capacity of the battery to determine how much energy is left.  The capacity will change over time and is also temperature and load dependent.  Since you are burning energy why not just add a low value resistor in the low side and measure the voltage drop, that would be more accurate then the hall sensor. Depending on what resistance you use you may have to add an amplifier circuit using an op-amp or other convenient method to get the voltage to something the Arduino can read. This has been tried many times and there is no perfect solution that I know about. You will have to determine the tolerance you can live with. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

Wawa

The video uses a fixed 10 ohm discharge resistor, and measures the voltage across it (on both sides).
I don't see the need for any current measurement, since current can simply be calculated.
Leo..

firashelou

It depends on the range of currents involved.  The ACS712 is a hall-effect sensor which is not particular accurate at low current, whereas shunt-resistor current-sensing can be very accurate, but severely limits the maximum current.

Are you thinking of deliberately discharging a battery to test its capacity, or do you want to monitor some circuit to predict when the battery is nearly empty?  What battery chemistry?

With any current sensor you can measure total charge by integrating over time, but issues of accuracy and dynamic range are important as is the power consumption of the measurement circuit.
I want to predict when the battery is empty. I am using a Lipo battery and I want to when i plug it the arduino knows what is its capacity at that point if it is half full for example
It does not have to be so accurate just a prediction
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

firashelou

As I understand what you are asking is how to make a battery "fuel" gauge.  It is possible. You could take most of the ideas from the video but realize you need to know the current capacity of the battery to determine how much energy is left.  The capacity will change over time and is also temperature and load dependent.  Since you are burning energy why not just add a low value resistor in the low side and measure the voltage drop, that would be more accurate then the hall sensor. Depending on what resistance you use you may have to add an amplifier circuit using an op-amp or other convenient method to get the voltage to something the Arduino can read. This has been tried many times and there is no perfect solution that I know about. You will have to determine the tolerance you can live with. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil


well yes but my problem is that i do not have enough pins left just 2, so my idea was to use this ACS712 because it needs only 1 analog pin
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

Wawa

An INA216 breakout board could be a better solution for your (unspecified) project.
Voltage, current, power, all in one.
Leo..

firashelou

An INA216 breakout board could be a better solution for your (unspecified) project.
Voltage, current, power, all in one.
Leo..
thanks Wawa for your reply,
well the big question here is how to let my current sensor read the value of the battery in whatever state it is ?
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

Wawa

well the big question here is how to let my current sensor read the value of the battery in whatever state it is ?
Short answer: it can't.
Voltage/current sensors just measure voltage/current.
You have to figure out a way to make sense of that.

The video constantly discharges a battery until the voltage drops below a certain point.
Easy way to measure battery capacity at that specific current.

Much harder if you want to keep track of remaining charge with varying loads.
Googling "Arduino coulomb counter" might give you some hints.
Leo..

firashelou

Short answer: it can't.
Voltage/current sensors just measure voltage/current.
You have to figure out a way to make sense of that.

The video constantly discharges a battery until the voltage drops below a certain point.
Easy way to measure battery capacity at that specific current.

Much harder if you want to keep track of remaining charge with varying loads.
Googling "Arduino coulomb counter" might give you some hints.
Leo..

thanks Wawa
what I am thinking about is using this current sensor and then accumulate the current used and subtract it from the value entered in the program for example 2200 mAh and saving the remaining value to EEPROM of arduino. And having a pushbutton to be used when a full battery is plugged to reset the remaining value. And this way I would have an approximate device to measure the capacity.
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

MarkT

Real life batteries have lower capacity at higher currents, so you might have to correct for that, and capacity
falls with time (self-discharge) and depends on temperature too.

You'll probably want to use the battery voltage as well, to reliably detect the onset of full discharge as the
coulomb-counting isn't highly accurate.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

firashelou

Real life batteries have lower capacity at higher currents, so you might have to correct for that, and capacity
falls with time (self-discharge) and depends on temperature too.

You'll probably want to use the battery voltage as well, to reliably detect the onset of full discharge as the
coulomb-counting isn't highly accurate.
I have an idea of making a capacity tester for the battery then take a wire from arduino PWM pin to my second arduino analog pin which will show to the screen connected to second arduino
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

gilshultz

You got me curious so I did a bit of research and it is not that hard to make a battery fuel with an Arduino. You need at least 22 bits of analog conversion,  This is from Analog Devices web page: "Coulomb Counter (Battery Fuel Gauge)
Analog Devices' battery management gas gauges and coulomb counters accurately measure and report battery capacity in single cell or multicell handheld applications. Charge accuracy is uncompromised thanks to a variety of unique sensing techniques that appear seamless to the user. High-side current sensing allows downstream failure detection and avoids ground disturbance. Analog integrators digitize charge directly, resulting in cancelled amplifier offsets, minimal gain error, and better overall charge accuracy. Some models also provide battery voltage and temperature, while others integrate a sense resistor to minimize component count and increase accuracy even further. All devices have small footprints and provide simple digital interfacing with a host processor." You can get them assembled from Banggood, RobotShop and others for a few bucks.  This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil


This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

firashelou

You got me curious so I did a bit of research and it is not that hard to make a battery fuel with an Arduino. You need at least 22 bits of analog conversion,  This is from Analog Devices web page: "Coulomb Counter (Battery Fuel Gauge)
Analog Devices' battery management gas gauges and coulomb counters accurately measure and report battery capacity in single cell or multicell handheld applications. Charge accuracy is uncompromised thanks to a variety of unique sensing techniques that appear seamless to the user. High-side current sensing allows downstream failure detection and avoids ground disturbance. Analog integrators digitize charge directly, resulting in cancelled amplifier offsets, minimal gain error, and better overall charge accuracy. Some models also provide battery voltage and temperature, while others integrate a sense resistor to minimize component count and increase accuracy even further. All devices have small footprints and provide simple digital interfacing with a host processor." You can get them assembled from Banggood, RobotShop and others for a few bucks.  This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil



Just saw this reply!  Sorry for late response great i will search for it thank you
Aiming for the unreachable !

My F1 project at https://firasf1dream.wordpress.com
Phoenix F1 page at https://www.facebook.com/phoenixf1p
my news aggregator website https://asserter.epizy.com

TomGeorge

You got me curious so I did a bit of research and it is not that hard to make a battery fuel with an Arduino. You need at least 22 bits of analog conversion,  This is from Analog Devices web page: "Coulomb Counter (Battery Fuel Gauge)
Analog Devices' 
@gilshultz
Hows about a link to this page?
Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up