Where are my maths going wrong? - Page 1
Forum section: electronics / beginners

author: msknight
author_rank: Regular Contributor
timestamp: November 23, 2021, 11:26:41 am
content: I am trying to work out the mAh/mWh of a AA battery which doesn't list the figures on it.I have four 1.5v AA batteries running a 6V LED which I measured as drawing 30mA. So far it went 180 hours of putting out a good 10-ish Ev before dropping to 4Ev and on its way down.So, that's 30mAh at 6V - 180mWh ? By 180 hours that's 32,400 mW consumed. From four batteries that's 8,100 mW per battery, which providing 1.5V comes down to 5,400mA which seems too high for a AA.I reckon my maths are wrong somewhere... but I can't figure out where.

author: Ian.M
author_rank: Super Contributor
timestamp: November 23, 2021, 11:57:38 am
content: LEDs are non-linear so as the voltage drops the current drops *FAR* faster. Its also difficult to determine light intensity unless you measure it or set up a side by side comparison that does *NOT* subject you to glare, so unless you measure it, you may not notice the current has dropped significantly.Therefore it is meaningless to attempt to determine the battery capacity from the initial voltage and current.

author: msknight
author_rank: Regular Contributor
timestamp: November 23, 2021, 12:13:57 pm
content: So what you're saying is that if I have a 1V battery with 1000mA of power and a 1V LED that draws 10mA, then I can't say that the LED will be lit for 100 hours because of various characteristics that will change throughout the discharge of the battery.

author: Psi
author_rank: Super Contributor
timestamp: November 23, 2021, 12:20:56 pm
content: Quote from: msknight on November 23, 2021, 12:13:57 pmI assume you meant to say 1000mAh not 1000mA. The /hour is important.yes, as the battery voltage falls so does the led current draw which extends the run time and a lower brightness.

author: brucehoult
author_rank: Super Contributor
timestamp: November 23, 2021, 12:37:42 pm
content: Quote from: msknight on November 23, 2021, 11:26:41 amWell, your units are screwed up for a start."So, that's 30mAh at 6V - 180mWh ?"Where does that come from. You said the the LED takes 30 mA. Fine. That's not the same as 30 mAh. One is a unit of current and the other a unit of charge.30 mA at 6 V is 180 mW, yes (NOT 180 mWh), but there's no point in working that out.30 mA for 180 hours is 5400 mAh.That's a lot.You don't say what kind of batteries you're using. Both Alkaline and NiMH AAs can provide something a little under 3000 mAh at 50 mA ... something like 2800.Alkalines might put out a bit more than that at less than 50 mA, but I wouldn't have thought as much as 5400 mA.The more likely explanation is, as others have said, that less than 30 mA is being drawn for much of that time.

author: msknight
author_rank: Regular Contributor
timestamp: November 23, 2021, 12:41:03 pm
content: So... if I measure the draw as 30mA, then how do I work out the time factor? How do I turn that reading of 30mA into an hourly usage?

author: Psi
author_rank: Super Contributor
timestamp: November 23, 2021, 12:51:06 pm
content: Quote from: msknight on November 23, 2021, 12:41:03 pmThese sort of questions of hourly runtime when all the parameters change can be a bit complicated.Made more compilated by the use of an LED which is not a normal load, like a resistor, if the battery and LED voltages are close.Usually when an LED is used you have a higher voltage than the LED and it can more or less be though of as a resistive load because you have a resistor in series with the LED.You can use advanced math to calculate it but the easy way is to use excel and divide the time into some number of chunks and work out the remaining battery capacity at each chunk then fill down the formula and see when the battery hits 0% (or some percentage you decide is flat for the battery).But you need to know the discharge curve for the battery so you can predict what the voltage will be at x state of discharge.

author: tunk
author_rank: Super Contributor
timestamp: November 23, 2021, 12:59:28 pm
content: Here's some typical discharge curves for an AA cell:https://lygte-info.dk/review/batteries2012/Ikea%20AA%20UK.htmlEdit: What's the cell voltages when you stopped thetest? You could also test how much it draws withthree new AAs - a guess would be around 15mA.Edit2: What's the current at the end of the test?

author: BeBuLamar
author_rank: Super Contributor
timestamp: November 23, 2021, 01:35:38 pm
content: To figure out the mAh you don't need to convert it to mW. You simply multiply the current draw by the time which is 30mA * 180h which does give 5400mAh. So I think the current isn't 30mA for the entire 180h that you tested.

author: bitwelder
author_rank: Super Contributor
timestamp: November 23, 2021, 01:57:10 pm
content: Quote from: msknight on November 23, 2021, 12:41:03 pmThe point is that those 30mA are not always 30mA.To get better results you could either do more current measurements and adapt your calculations, or you could make a simple constant current driver (LM317?)

author: msknight
author_rank: Regular Contributor
timestamp: November 23, 2021, 02:06:56 pm
content: Well, actually, the test isn't complete. There are two set ups on test, but the one with the replacement 6V E10 LED bulb was bright at 9.9EV (measured with a light meter) until after about 180 hours at which point it's dropped to 4EV and it's still running at... er... more than 200 hours now and if I take a reading now, it's at 3.6ev. So I don't yet know the finishing voltage in the batteries, but I would assume they'd be near flat by the end of it.The other is a pair of LED's together pulling 30mA at 3v, from two pairs of AA in series/parallel, and I know that those LED's will fail when the voltage drops below 2.6V ... so it always was a test of which will fail first... the 6V LED when it gets low enough to fall off the cliff (as I believed that the batteries in parallel would slowly go from 6.3V down to 4.somethingV and then drop off a cliff... or the 3V batteries slowly dropping off their initial 3.2V down to 2.6V at which point the LED would go out but there would still be a good chunk of charge left in the batteries. So far after those 200+ hours, they are still putting out 6.3ev of light, which is very usable in a camping tent scenario. (they started at 8.4ev)

author: tunk
author_rank: Super Contributor
timestamp: November 23, 2021, 03:05:40 pm
content: Do as bitwelder suggests, "do more current measurements",this will help you understand how it works. (And measurevoltage as well.)Both current and light output will go asymptotically towardszero. Depending on your cut-off criteria, it could run forthousand(s) of hours.Edit: This assumes that the bulb is a resistor in series withan LED.

author: mariush
author_rank: Super Contributor
timestamp: November 23, 2021, 03:48:58 pm
content: Quote from: msknight on November 23, 2021, 11:26:41 amIt depends entirely on how you limit the current going to the LED.If you use a simple resistor, you can't accurately calculate the capacity of the battery because as the voltage of the battery drops, so will the current used by the led.You have Ohm's law : Voltage = Current x Resistance and you can adapt it for your led circuit like this: Input voltage - (number of leds x forward voltage of LED) = Current x ResistanceSo let's say you have 4 x 1.5v batteries and let's say your LED's forward voltage is 5.5v at 30mA ... you can then put the numbers in the formula to calculate the current limiting resistor value :4 x 1.5v - 1x5.5v = 0.030A x Resistance ===> Resistance = (6v - 5.5v) / 0.030 = 0.5/0.030 = 16 ohm.Let's use 15 ohm because it's a standard value, in which case the current will actually be a bit more .. 0.5v / 15 ohm= 0.033A or 33 mANow, when the battery voltage drops to let's say 1.4v, your input voltage will be 5.6v but your current limiting resistor will remain the same 15 ohm, so the current will drop to:4x1.4v - 5.5v = current x 15 ohm => current = 0.1 / 15 = 0.006A or 6mAA LED DRIVER (the non-linear kind) will work like a dc-dc converter and always provide 30mA no matter the input voltage (as long as it's above the led's forward voltage, if it's a plain buck/step-down led driver). It will also typically produce those 30mA of current at higher efficiency, let's say above 85%.With your example of a 6v led powered by a 4 AA battery pack, it's not as obvious but it can be more obvious if you had a 3.2v led powered by 4AA battery pack that also allows use of rechargeable AA batteries which have a voltage of around 1.2v ..1.35vA buck led driver would produce 3.2v at 30mA = 96mW with let's say 80% efficiency, so to produce this it takes ~ 120 mW from the battery (the input). I'm also including in that 20mA the power consumption of the driver itself.When the batteries are full and you have 6v, that means the battery will see a current of 120mW / 6 = 20mAWhen the batteries are almost depleted at around 1.1v the batteries will see a current of 120mW / 4.4 = 27 mASo as the batteries discharge such circuit takes even more current from the batteries, discharging them faster and speeding up the discharge, but you get a consistently bright led.You have the page already linked to here...https://lygte-info.dk/review/batteries2012/Ikea%20AA%20UK.htmlLook at the pretty graphs at the yellow line, which is for 0.1A ... your 30mA is 3 times less, so most likely your battery pack will have an even longer life.You can see that if you use 1.2v as cutout voltage (too low voltage), then a 4 battery pack with those Ikea batteries should power a 100mA load (constant) for at least 15 hours.edit ...Also keep in mind that if you measure the current with a multimeter by having the probes in series, your measurement will be slightly affected by the multimeter's burden voltage ... see video belowAt low current ranges, the resistance used inside the meter to measure current could be quite high, and that will affect your calculations.If you want to avoid that, place a very small value resistor in series and then just measure the voltage drop across the resistor with your multimeter.Let's take the example above where I used a 6v battery and a led with a 5.5v forward voltage and a 15 ohm resistor to limit the current to 33mA.If I put my multimeter in series with the led, the multimeter uses a 10 ohm resistor in 0 ... 220mA range, so now the circuit has 10 + 15 = 25 ohm instead of 15 ohm, and now there's no longer 33mA going through the LED.But, I can put a 0.1 ohm resistor (or 10 x 1ohm resistors in parallel) in circuit and measure the voltage drop across the resistor... and multiply that by 10 to get the actual current.

author: jmelson
author_rank: Super Contributor
timestamp: November 23, 2021, 06:02:46 pm
content: Quote from: msknight on November 23, 2021, 12:41:03 pm30 ma X 180 hours is 5.4 Ah. That seems amazing for a AA cell. take 5.4 Ah and multiply by the voltage (you said about 10 V previously) so the battery gave 5.4 X 10 = 540 Wh.Jon

author: msknight
author_rank: Regular Contributor
timestamp: November 23, 2021, 08:18:26 pm
content: Quote from: jmelson on November 23, 2021, 06:02:46 pmIt was 30mA for about 180 hours of useful light, with 4 x 1.5v cells running a 6V LED E10 replacement bulb which was, for the most part, giving off 10EV of light through the plastic housing. In the picture, the one on the left is the 3v two LED version giving off about 6.5EV and the one on the right is the 6V having dropped to 4EV.The 3v version is 4 x 1.5v cells running in serial/parallel, powering two 3v LEDs in parallel, pulling 15mA each, started with nearly 9EV and is currently giving 6.2EV after ...let's see, we're nearing the end of day 14 (of 15 hours per day, so if they die, I'll see it) so that's 210 hours of operation.

author: BeBuLamar
author_rank: Super Contributor
timestamp: November 23, 2021, 08:41:53 pm
content: I would expect the AA to have about 2000 to 3000mAh but at low discharge rate it can be more and less at high discharge rate. However the 5400mAh does seem high. Are you sure that the current doesn't drop from 30mA as the battery voltage gets lower?

author: msknight
author_rank: Regular Contributor
timestamp: November 23, 2021, 08:56:45 pm
content: Quote from: BeBuLamar on November 23, 2021, 08:41:53 pmI just measured it at the end of the battery life and it was lit dimly and drawing 2.5mA thereabouts.

author: brucehoult
author_rank: Super Contributor
timestamp: November 23, 2021, 09:28:18 pm
content: Quote from: msknight on November 23, 2021, 12:41:03 pmTo get the Ampere-hours you multiply the Amperes by the hours. Or more precisely, integrate the Amperes with respect to the hours, if the current is varying.

author: brucehoult
author_rank: Super Contributor
timestamp: November 23, 2021, 09:34:24 pm
content: Quote from: msknight on November 23, 2021, 08:56:45 pmWell there's the reason.The thing to do would be to figure out how much light (and therefore how much current) you actually need to get a useful amount of light, and then use a regulator to get that brightness all the time.So 30 mA gives maybe more light than you actually need, but 2.5 mA doesn't give enough. Would 5 mA be enough? 10?

author: tunk
author_rank: Super Contributor
timestamp: November 23, 2021, 11:00:20 pm
content: QuoteAnd what's that voltage of the battery?

author: Rick Law
author_rank: Super Contributor
timestamp: November 24, 2021, 06:40:21 am
content: Quote from: msknight on November 23, 2021, 08:56:45 pmHow did you measure the 2.5mA current? Wait, we will get back to that in a moment.Now you know while it started at 30mA, it eventually drift down to 2.5mA. So it was not 30mA from beginning to end, and that is where "your math went wrong". Since each light bulb design differs, unless you have the manufacturer specs, you cannot determine how much light is given off.To determine the useful run-time, you have to judge: basically looking at it and ask yourself "is it still bright enough to be useful. Even with manufacturer spec, "bright enough to be useful" is still a subjective thing. The manufacturer spec may tell you 50 lumen at 1 watt, but "is 50 lumen bright enough to be useful" would be entirely subjective. So you have to be the one to judge "is it bright enough to be useful." If you run it at 10mA, is it bright enough for you? If so, then your run time is from 30mA down to 10mA.Better yet, since voltage is easier to measure, may be you should convert the question to what is the voltage at minimum useful brightness.Once you know the voltage at minimum useful brightness, now you can work on how long it stays useful. If you have the battery manufacturer's discharge specs that can give you clues on discharge time-vs-voltage drop, you can look up how long it takes to drop to your minimum useful voltage. If you can't get that from the specs, you will have to run it down from fresh battery down to that voltage with your LED once so as to measure the time.EDITED: Arrh... copy-pasted the wrong. Re-done.

author: Vtile
author_rank: Super Contributor
timestamp: November 25, 2021, 11:43:37 am
content: You are wrongly assuming that you load is constant over time.You are also wrongly assuming your source is constant over time.To avoid these traps you can A) use lots of theoretical models B) Use lots of datarecorders and breadsheet calculation C) build a simple constant current circuit driving the led (operational amplifier, transistor and a few resistors).

author: tunk
author_rank: Super Contributor
timestamp: November 25, 2021, 03:48:02 pm
content: Or D): in this case, measure voltage and current e.g.every 24h and then calculate/estimate cell capacity.

author: BeBuLamar
author_rank: Super Contributor
timestamp: November 25, 2021, 04:12:03 pm
content: I wonder if the OP wanted to see how long the batteries will provide useful light or how much capacity in mAh?

author: msknight
author_rank: Regular Contributor
timestamp: November 25, 2021, 07:36:49 pm
content: Quote from: BeBuLamar on November 25, 2021, 04:12:03 pmI did. Particularly at the time, I wanted to get a handle on the figures and mathematics, particularly after watching John Cadogan's video on understanding batteries, watt hours v amp hours and all the rest of it, which also furthered what people had been kindly telling me on this forum -However, it all went a bit west when I tried to get a handle on an actual experiment and trying to put the maths together to work out which would be the better solution... only to find that battery power and LED consumption are not constants... which has me scratching my head at Mr Cadogan's video. Perhaps not so much for the inverter part of the massive battery pack, but maybe about the USB power sockets.For those of interest, the experiment has yielded the following graph which also tied in epically with what Rick Law and others, had put forward. How much light is actually useful light? That puts any conclusion of best/worst right/wrong firmly into the land of fiction.The 3V graph has a peak because I discovered that one set of batteries had fallen off the connector and had to be put back on again. But I think I've worked out that 6EV as measured as I'm doing it... is about the lower limit for a light of this type, in a tent. Nevertheless about 170 to 180 hours of very useful light from the 6V direct E10 replacement bulb was a good result when compared to the usual filament bulb. But the increasing longevity of the 3V LEDs in parallel (which measured 2.67V yesterday evening, a shave above the 2.6V minimum operating voltage of the LEDs) which threatens to crawl on to 300 hours before conking out, and then with who knows how much energy still in them.But the key thing that I'm walking away from here with, is that there are too many variables here to be able to get a grip of things with straightforward mathematics and a better understanding is needed before I can properly look at discharge curves and be able to translate them into a real world expectation. Thank you all... this thread and the experiment has been a real eye opener.

author: Vtile
author_rank: Super Contributor
timestamp: November 25, 2021, 08:22:07 pm
content: I do not watch the vid of mr.C, but...USB is (usually) always constant 5v output as such there is one constant reference point (mentioned 5v). The reason I did suggest to make a constant current circuit to drive your led (resistor is preferred instead of led so you can go below 1.7v). This way the battery voltage slowly dropping down in time and effecting output can be omitted and use current as reference and only measure Voltage across battery over time. Then you can multipliäy constant current value and variable voltage to get power. Then by integrating aka calculating the area below power curve you get W*time unit (ie. Ws = W*s).Also to be noted that mAh value given many ie. Rechargeable cells is kind red line over the water (....I just can't figure right proverb in english at this time of evening). Ie. You connect 1500mAh AA NiMH cell to load that draw constant 1mA you get 1500h of fun until battery voltage have dropt down to 0.9 volts (example is from my head).

author: brucehoult
author_rank: Super Contributor
timestamp: November 25, 2021, 11:59:30 pm
content: Quote from: msknight on November 25, 2021, 07:36:49 pmJohn's an interesting guy. His angle is primarily from the perspective of cars, but he's an actual qualified engineer (as of course are many of us here) but he's also done a lot of time writing for car magazines and on TV and has got the communicating complex things simply ("beer garden physics") thing down quite well.He's also rather opinionated (some of them wrong or questionable e.g. he's down on "Electric Jesus" based, seemingly, primarily on his personality and excessive optimism about time scales) and not above throwing in the occasional clip of bikini models. But on the basic physics and viability of things such as solar and wind power, hydrogen etc he's spot on.

author: brucehoult
author_rank: Super Contributor
timestamp: November 26, 2021, 12:06:02 am
content: Quote from: Vtile on November 25, 2021, 11:43:37 amThis seems like a decent thing to just buy (or build their circuit)https://www.crowdsupply.com/electronut-labs/snapvccOf course you can easily buy a 9V batter clip and connect it to a holder for AA or D or whatever cells and click it to this.

author: Vtile
author_rank: Super Contributor
timestamp: November 26, 2021, 12:56:33 am
content: Quote from: brucehoult on November 26, 2021, 12:06:02 amhttps://www.wikiwand.com/en/Current_sourcefigure 7. Basic opa constant current driver. Replace zener with any diode add potentiometer parallel, take reference connection to opa from midle leg of potentiometer, instead of between resistor and zener as in figure7. Keep ground as is. Drive left side from 9v battery, drive transistor and led from battery you were interestes in. Use any bjt transistor, use ie. Lm358 opa etc. Almost any parts work on this circuit, only the sense resistor should be small value (very important if one wants to reach below 1v).

author: brucehoult
author_rank: Super Contributor
timestamp: November 26, 2021, 01:12:31 am
content: Won't this waste a fair bit of the battery's energy?

author: Vtile
author_rank: Super Contributor
timestamp: November 26, 2021, 01:31:57 am
content: For test purpose no, because the control part is driven separate battery and one only wants contant current draw from battery under test (positibe battery terminal connected to transistor collertor) load resistor can be basically omitted as transistor is the load. A small error to load is coming from base emitter current. I should draw better schematic, but writing from phone ... so not possible....plus this is great! transistor toaster above all.

author: Ian.M
author_rank: Super Contributor
timestamp: November 26, 2021, 02:07:20 am
content: Although a constant current load is useful for battery capacity testing, constant power is probably more use for a real-world battery powered LED lighting application. That is going to mean a switched mode regulator, either in the form of a constant output current switching LED driver for bare LEDs or a constant output voltage switching regulator if the LED is in the form of a bulb with integrated driver (or ballast resistor). The disadvantage is the input current goes up as the voltage drops and as the internal impedance of most primary battery technologies increases as the discharge you get little to no warning at the end of the battery discharge when it can no longer supply the required power to maintain the required LED current and the battery voltage 'crashes'. If you are using a rechargeable battery with such a load, an effective low voltage cutoff is essential to prevent damage to the battery.To drive the O.P's nom. 6V LED bulb, from a 4s AA battery pack, with adjustable brightness, as the battery voltage will start above the output voltage but drop below it as the battery discharges, the best choice would probably be an adjustable output voltageSEPICorĆukconverter, the Ćuk topology having the advantage of much smoother input current, (increasingly important as the battery internal resistance rises) but the disadvantage of a negative output voltage for the non-isolated version.However cheap non-inverting buck-boost modules are a lot easer to find than inverting Ćuk modules, and you can be fairly sure that if its only got one switching chip, it will be a SEPIC converter. Avoid the ones with separate boost and buck stages as their efficiency generally sucks.Here's a likely candidate on Aliexpress:https://www.aliexpress.com/item/1005003223667090.htmlIt can also be found on Ebay.A key criterion when searching for a suitable buck-boost module is input voltage range, as it is desirable to support operation below 1V per cell, or 4V for a 4s Alkaline battery pack. You are unlikely to get much extra useful life by operating right down to the 0.8V/cell generally recognized fully discharged voltage, due to the increasing internal resistance. Quiescent current and efficiency when lightly loaded are also worth looking at, but figures for cheap pre-built modules are rarely available, and even the datasheet for the chip used (if identifiable) may have less information than one would desire.

author: BeBuLamar
author_rank: Super Contributor
timestamp: November 26, 2021, 03:14:03 pm
content: I didn't watch the video entirely only the first few minutes and even in the very first example about the cooler which draws a varying current he assumed it's the average of 2A. Now it's not precise because you have to know how much time at which current draw but if you simply use the average of your test which is 30mA to 2.5ma average to about 16mA the result is short of 3000mA which is a realistic value for the AA battery at such a discharge rate.

author: msknight
author_rank: Regular Contributor
timestamp: December 01, 2021, 05:04:07 pm
content: For those who wanted to know the end of this experiment, I called an end at 355 hours.The 6V behaved as expected, fell off a cliff at about 170 hours with batteries drained.The 3V were still going and were producing 2.64V at the end which is still above the 2.6V for the LED, and would still have had power in them once the LED gave up.Along with what was stated by Rick Law, it does come down to use case. In a 6 man tent, the 10EV would have been needed and would still have lasted two weeks at 7 hours every night, while the 3V solution would work for a night light or in a two man tent and still be running after a month... although I don't think I'd like to be in a two man tent for that long, but that's another subject.The other thing I've taken away from this is that because of the behaviour of the batteries and the LEDs there would have been no easy way to do this with simple maths, unless I knew the averages from testing and made a rough guestimate.Thank you all for your wise words and insight. I have learned yet more.

author: Rick Law
author_rank: Super Contributor
timestamp: December 01, 2021, 07:26:28 pm
content: For future reference, you may want to get one of those "USB doctors" aka "USB testers". Many of them work from 3V to 20V. They show current, voltage and some would also show time. Most of these USB doctors shows in 10mA increment, some V+I meters have it down to 1mA resolution. I recall seeing one that is down to 1mA in resolution in this USB-doctor format, but I have not seen one of those of late.Prior to making some DIY loggers, I used time-lapse webcam with my USB cam. That makes data logging much easier than doing measure manually by the clock. Now I use DIY logger (Arduino NANO with INA219).Some form of easy logging helps understand the whole picture easier. For LED, Current is the better deciding factor since small change in voltage gives huge change in brightness - but just around a certain voltage range. Outside that range, changes in voltage has only small effect on brightness.This link is to show the type of device I mean. This is not an endorsement of this particular one or this particular seller. I don't know this particular seller/device, so no for/against intended here:https://www.aliexpress.com/item/32449997312.html