Determining battery amp-hour for a complex circuit

Thread Starter

djsfantasi

Joined Apr 11, 2010
9,163
Sorry, this should be a simple problem but I’m overthinking it.

I have a system with a uP, three peripheral modules and 11 hobby servos. For most of the circuit, I know the current draw. But where I get confused is that the three peripherals and the Servo motors do not have a well defined draw. They are randomly used. Totally random.

So, the actual draw will be significantly less than their individual current requirements when in use.

What I’m looking for is a technique to determine how long the device will operate, at variable battery capacities. Right now, all I have is a SWAG!

The device is currently powered by an external power supply. 5VDV at 8A. (from a 70s era POS power supply) I’m sure that’s way over-powered. It is strongly desired to run this off battery. Ideally, for 4 hours, but until I can develop a process to determine power requirements, I can’t extrapolate to that long a period.

Thanks in advance for providing techniques to analyze this problem.

Go Pats!
 

sghioto

Joined Dec 31, 2017
5,390
If you think 8 amps is way too much then maybe 4 amps is an average? Thinking a 6 volt battery at 20 amp/hr.
As far as a device to analyze that would be a data logger measuring current draw.
SG
 

wayneh

Joined Sep 9, 2010
17,498
What battery chemistry are you using? Estimating SOC for a lead-acid is fairly easy and you can get close without logging. Other chemistries are more challenging and do require logging usage.
 

crutschow

Joined Mar 14, 2008
34,432
You have to determine the current draw of each device, and how long each device is ON, on average.
Or you need to use a data logger for the current to determine the average current draw.
I don't see now else you can determine battery life, other than just hooking some battery up of known capacity and see how long until it's dead.
 

wayneh

Joined Sep 9, 2010
17,498
Standard sealed lead acid battery
SG
Well that means you can at least estimate SOC at any given moment. But that doesn't solve your problem of not knowing the approximate current draw. I don't see how you fix that without data. I think you could collect some data and see if that gives a good-enough estimate of usage and thus remaining battery life. The worst case scenario, in terms of complexity, is watching and logging the consumption in real-time.
 

Thread Starter

djsfantasi

Joined Apr 11, 2010
9,163
Standard sealed lead acid battery
SG
Hello! What are you talking about? It’s my thread.

I’m looking for a compact supply. It has to fit within a 5x4x1.5 space. I’ve looked at NiMh and Lithium. There’s a lot of NiCad for RC use, but I want to stay away from that.

My problem IS determining average current draw. As I said,!each component is randomly activated. There is no way to predict. The devices are activated by software, in a random sequence.

Here! Look at this...
https://www.youtube.com/playlist?list=PL78XSCgh6iCpB_1Zo-boH31TJIkrj0nBo
 

MisterBill2

Joined Jan 23, 2018
18,502
You can even use an ordinary computer for the data logging and a fairly simple program.
The problem that is obvious to me is that if the operation of the servo devices is randomly controlled then their power consumption is also random, and thus variable.
If there is room in the controller's memory for additional code, you could add code to record the time that each output is active for some length of time, possibly an hour. Then take those times, multiplied by the power draw of each load, and you could have a close total to the actual power consumed. And you do not need any extra hardware. Cheap and quick but probably not easy or simple. But it would work.
 

Norfindel

Joined Mar 6, 2008
326
If you don't mind using a larger battery, and there's even a remote possibility that the current draw is at maximum 100% of the time, and you want to be certain that it will last the 4 hours, then you could go with the worst case scenario. Also, take into account the type of battery. Lead-acid doesn't likes to be discharged. The deeper the depth of discharge, the less cycles the battery will last.
 

Reloadron

Joined Jan 15, 2015
7,517
Or you need to use a data logger for the current to determine the average current draw.
That is how I would start. Based on your description even the uP current draw will change based on what it is doing or how much work. I would, using your supply, do several runs of 4 hours each and get an average. Then I would allow a margin of maybe 25%. That done you should have a good idea of what amp hour rating battery you want and what type battery would be practical.

There are several inexpensive data loggers available which should be good enough for what you need. Just log the voltage and current against time. Most data loggers will allow you to grab the data in a CSV format. You can then dump it into a spreadsheet like Excel or Open Office Calc which is free stuff. Then just get an average of your samples. That should get you close enough for what you want.

Ron
 
Last edited:

Thread Starter

djsfantasi

Joined Apr 11, 2010
9,163
The data logger approach is the reasonable approach. @sghioto, I was listening for a while. Never said there was a problem.

I’ve never used such a device. I’ll do a search online to learn more. If anyone has a suggestion for such a device, I’ll listen.
 

wayneh

Joined Sep 9, 2010
17,498
Well, the cheap and direct approach is to just run it and see how long it lasts. You can get all fancy and log detailed data but in the end, isn't that what you really want to know?
 

WBahn

Joined Mar 31, 2012
30,058
Sorry, this should be a simple problem but I’m overthinking it.

I have a system with a uP, three peripheral modules and 11 hobby servos. For most of the circuit, I know the current draw. But where I get confused is that the three peripherals and the Servo motors do not have a well defined draw. They are randomly used. Totally random.

So, the actual draw will be significantly less than their individual current requirements when in use.

What I’m looking for is a technique to determine how long the device will operate, at variable battery capacities. Right now, all I have is a SWAG!

The device is currently powered by an external power supply. 5VDV at 8A. (from a 70s era POS power supply) I’m sure that’s way over-powered. It is strongly desired to run this off battery. Ideally, for 4 hours, but until I can develop a process to determine power requirements, I can’t extrapolate to that long a period.

Thanks in advance for providing techniques to analyze this problem.

Go Pats!
Three approaches come to mind.

First: If the devices are on/off in a truly random way, then on average they are on half the time. Start there. Measure the current with all the random devices off and then again with all of them on and figure it working out to about the average of that.

Second: Measure the total energy consumed over a four hour period and use that as a baseline. You could do it several times to see how much variation there is. A data logger would be ideal, but simpler things can get the basic data you need.

Third: See how long it lasts with the type of battery you want to use. Use that battery's capacity rating as a starting point to figure out a battery that should work and then try it.
 

Tonyr1084

Joined Sep 24, 2015
7,899
You got me thinking. STOP THAT! No, really. I have a Hantek oscilloscope. I'm wondering if you set the sweep low enough and let it run for whatever length of time it can store data if you can use that to monitor the voltage. I'm also wondering if it has an averaging feature where it can tell you the average voltage. If so - measuring the volt drop across a small resistor should be able to tell you how much current your device is using. Now I'm wondering about that.
 

Reloadron

Joined Jan 15, 2015
7,517
The data logger approach is the reasonable approach. @sghioto, I was listening for a while. Never said there was a problem.

I’ve never used such a device. I’ll do a search online to learn more. If anyone has a suggestion for such a device, I’ll listen.
I can give you an example of what I was getting at previously. I also agree with wayneh where he mentions:
Well, the cheap and direct approach is to just run it and see how long it lasts. You can get all fancy and log detailed data but in the end, isn't that what you really want to know?
That said if you want to take the data logging route there are literally dozens of options. The beginning would involve a transducer of sorts to measure the current. Chips like the ACS 712 and newer ACS 723 come in a wide range of current ranges and are available from several outlets on a breakout board. There are also other chips which I believe will output a serial data stream. It becomes a matter of your budget and what works for you. Should this merely be a one time test you don't want to buy stuff you will never need.

Software? Depending on the data acquisition device you can roll your own as Mr. Bill suggest or use what is available from manufacturers. I can give you a single example of a similar to what you want data acquisition system I use. There is a company named LASCAR who market several pretty slick little USB data acquisition devices which you program USB and then they are stand alone until you download your collected data via USB. LASCAR Electronics. The below examples use their Temperature and Humidity EL USB 2+ to collect temperature and humidity data from inside my gun safe.

Sample 1.png

The above image is a chart covering the date range specified on the chart. I programmed the module for the date and time range which is easily done. The top of the image you can see my cursor on the Export tab.

Sample 2.png

I choose CSV (Comma Separated Values) which will automatically in my case open Excel and place my data into an Excel Worksheet.

Sample 3.png

When I setup I decided on 5 min interval samples. The above is the top of my worksheet. In your case using a sample rate of 1 second over a period of 4 hours 1 min = 60 samples, 1 hour = 3600 samples and 4 hours = 14,400 samples. In my case here is the lower portion of my worksheet.

Sample 4.png

I only needed 165 samples over my time period since temperature and humidity don't change much. I let Excel do the math and the averages for each column are shown on the bottom of the columns.

Use a current transducer of your choosing which can be scaled giving you an output proportional to the measured current. That output will go to the data acquisition device of your choosing. It can be as simple as an Arduino with an Ethernet Shield (or other board with an SD slot). Then write you code. A Google of "Arduino SD Card and Data Logging to Excel Tutorial" will likely bring up some results.

Since your voltage won't really change much you can likely only log current, a single channel but if you want voltage just add a channel. Start your system and log the data (current) for four hours. Then save your data. Do this several times and average the averages to get your amp hour numbers. Then allow some overhead and choose your battery.

Again, this sort of project can be as costly or economical as you wish to make it. Really comes down to exactly what you want and how you want to go about it.

Ron
 
Top