Servo & logic power
down to 5v with a 7805. That sufficed (six hours, anyway) while the
project only drew 30mA.
I needed to add a single standard RC servo; I didn't expect a 9v battery
to be able to supply the servo (at 5v) - and it, mostly, didn't,
resetting the processor more often than not.
The servo will not be moving much, nor frequently; it will mostly idle,
drawing a few milliamps, but when motion is required it'll need 300mA or
so, in spikes. My plan is to use six alkaline AAs and take 6v directly
from the bottom four cells for the servo (sharing ground, of course),
while regulating all six cell's 9v to 5v for logic.
Anything wrong with that?
whole thing on just 4 cells (6 volts), and skip the 7805 altogether.
The BX does have a built in regulator after all.
Obviously, if you need to power other circuitry as well, you'll have
to keep the 7805
--- In b..., Tom Becker wrote:
> For a crude prototype I used an alkaline 9v battery and regulated that
> down to 5v with a 7805. That sufficed (six hours, anyway) while the
> project only drew 30mA.
> I needed to add a single standard RC servo; I didn't expect a 9v
> to be able to supply the servo (at 5v) - and it, mostly, didn't,
> resetting the processor more often than not.
> The servo will not be moving much, nor frequently; it will mostly idle,
> drawing a few milliamps, but when motion is required it'll need
> so, in spikes. My plan is to use six alkaline AAs and take 6v directly
> from the bottom four cells for the servo (sharing ground, of course),
> while regulating all six cell's 9v to 5v for logic.
> Anything wrong with that?
Sure, but I think not very effectively.
The 78L05 on the BX-24p needs 7v on Vin, so I'm using a BX-24 on this
project since it has a 2951 LDO regulator, permitting Vin as low as 5.5v.
According to http://www.energizer.com, their AA alkaline cell can
provide 2850mAH from 1.58v to 0.9v, a 680mV range. Four fresh cells
make a little more than 6.3v; six cells make ~9.5v. Four cells will
allow the regulator to drop out if each cell loses only ~200mV.
Assuming the energy is released linearly, that's only about 30% of the
cell capacity, so 70% of the battery would need to be discarded.
Six cells will provide 5.4v at depletion, only 12.5mV per cell below the
2951 specified dropout voltage, so almost the entire cell capacity is used.
That doesn't consider the unregulated servo load (7.5mA@6v + motion),
nor regulator heat losses which will be greater for the higher Vin, but
I expect six cells should considerably outperform four, even if 50% more
I've got it clip-leaded on the bench now. The static project draws
~55mA, so 48 hours should use ~2700mAH and still provide regulated 5v
for logic and a usable servo voltage of ~3.6v. Time will tell.
Thanks for the feedback.
thankfully, so I did remove the 7805, which wouldn't regulate at 5.5v,
anyway. The 2951 runs only slightly warm , ~110F, when providing about
Well, I've run through four sets of cells. The scheme seems to work
well for this application. Both the regulator minimum voltage and a
usable servo voltage are available until just before battery depletion.
As the regulator gives up, the processor would continue to run below
5v but, since the analog inputs are no longer accurate - and the
project needs them - code detects less than 5.6v on the BX-24
regulator input, while the machine is still healthy, to enter a
shutdown mode. That saves the machine state by writing a few
persistent variables and sleeps. Very nice.
differentiating the battery voltage samples to determine the discharge
slope. That didn't work, principally because the 10-bit resolution of
the BX-24 ADC is too small unless the sample period is quite long.
Since in this application the bottom four cells are loaded slightly more
than the top two cells, those cell voltages start about 1% below the
upper two cells. I found that sampling both battery stack voltages (~6v
and ~9v) and normalizing them to a per-cell voltage for comparison,
reveals an apparent slope instantaneously.
The per-cell voltage ratio remains relatively constant [it is only 0.6%
less (-1.6%) as I write this, 16 hours into a set of batteries] until
approaching depletion, as the discharge slope steepens. Using
alkalines, at depletion the lower cells are about 25% below the upper
ones, in this instance.
project evolutions and results.
Have you tried running it from NiMH or NiCd batteries yet? How will
the application deal with the different discharge characteristics of
other battery chemistries?
--- In b..., Tom Becker wrote:
> In an attempt to predict imminent battery depletion, I tried
> differentiating the battery voltage samples to determine the discharge
> slope. That didn't work, principally because the 10-bit resolution of
> the BX-24 ADC is too small unless the sample period is quite long.
> Since in this application the bottom four cells are loaded slightly
> than the top two cells, those cell voltages start about 1% below the
> upper two cells. I found that sampling both battery stack voltages
> and ~9v) and normalizing them to a per-cell voltage for comparison,
> reveals an apparent slope instantaneously.
> The per-cell voltage ratio remains relatively constant [it is only 0.6%
> less (-1.6%) as I write this, 16 hours into a set of batteries] until
> approaching depletion, as the discharge slope steepens. Using
> alkalines, at depletion the lower cells are about 25% below the upper
> ones, in this instance.
No, I deliberately chose alkalines because they don't have the sharp
knee that NiCd and NiMH cells exhibit. An almost flat voltage plateau
before the knee gives little indication before the cell voltage pretty
abruptly falls from about 1.25 volts (NiCd) or 1.1v (NiMH), although the
latter is not as sharp. I want to use as much of the battery as
possible, and be in control to the end so the machine can do an orderly
Reconsidering now, five NiCd or NiMH cells should drive both the
processor regulator and the servo quite well, but the window with NiCds
is small (7.0v to 6.5v); NiMH cells droop more (7.0v to 5.5v). I'll
play with sensing the slope of a set of NiMH cells and see what comes of
Incredible! Five new Duracell 2650mAH AAs ran the project for 29
hours at ~100mA, and supplied ~6.9 to 5.595v before suddenly - within
six seconds - showing a slightly higher discharge slope then
collapsing to ~4v. Six seconds after 29 hours! Like a switch.
The discharge slope started at ~-40uV/second and lessened to
<-10uV/sec after about eight hours. It stayed there - a negative but
virtually flat slope - until it started steepening after 24 hours or
so. The last several hours showed a slope of ~-100uV/sec; in the last
few seconds, it reached ~-200uV/sec and then rapidly increased; the
current essentially turned off. These dV/dT rates are detectable by a
BX-24 and its 10-bit ADC but my code filters and differentiator are
slow (~120 seconds), too slow to see this knee, I think.
The discharge rate and the cell voltage, though, appear to be well
related. With these cells, -100uV/second at 100mA corresponds to
about 1.150v per cell. I'll be looking for 5.750v (5 * 1.150) this
time, which should predict the knee about 20 minutes later.
More after another few runs.
Well, I am now a little more battery-smart. I've learned that cell
voltage, alone, is insufficient to determine the battery
state-of-charge, and voltage slope is also insufficient, although each
varies usefully according to charge, load and temperature.
A proper method is to integrate the battery current, or
Coulumb-counting. The integration of discharge current decreases the
available energy (in mAH) directly over time. For example, if a
healthy battery starts out holding 1000mAH, and it is discharged at
an average rate of 100mA for three hours, the battery can be expected
to retain ~700mAH. That's the ideal, of course; there are other
losses, and age degrades.
Maxim's battery management parts sense the pack current by measuring a
microvolt-level voltage across a very-small shunt resistor that's in
series with the battery. From a known state, integrating that value
will closely track the energy currently in the battery, producing a
Still, if allowed to reach "Empty", the sharp knee is unforgiving;
believing that a 50% charge is available is comforting, but believing
that 5% is available is less comforting when the end is so abrupt, and
that's what I'm after.
Meanwhile, five NiMH cells is ideal for the BX-24 (not the BX-24p) and
as a simultaneous servo supply. The end, though, is fast.