[geeks] 9v battery meter

Dave McGuire mcguire at neurotica.com
Fri Jan 10 10:58:00 CST 2003


On Friday, January 10, 2003, at 11:51 AM, Kurt Huhn wrote:
> I'm wanting to build a simple 9v battery meter using an array of green,
> yellow, and red LEDs.  However, I can find very little online about 
> how to
> build one that's *simmple*.
>
> All I want is to build one with an array that light all the LEDS when 
> the
> battery is full, and increments down, turning off LEDs as battery power
> drops.
>
> Pointers, information, and URLs greatly appreciated.

   Take a look at the LM3914 dot/bar display driver.  It's a cheap chip 
that is (or at least used to be) available at Radio Shack.  You connect 
ten LEDs to it (through current-limiting resistors of course) and give 
it an input voltage, and it generates a single dot or bar graph of the 
voltage on the LEDs.  Dot or bar mode is selected by tying a pin high 
or low.  The LM3914's scale is linear, the LM3915 is a log variant of 
the same chip.

   The problem is, though, the discharge profile of most batteries is 
far from flat and linear...many batteries (depending on their 
chemistry) will maintain very close to ideal cell voltage until they're 
within a few percent of being depleted, then the cell voltage will drop 
very rapidly.

   So...with that in mind, it might actually be better to get a PIC 
processor with an on-chip A/D converter and drive a bunch of LEDs from 
that.  That'd be dead simple (and fun) to build and write the little 
smidgen of firmware for, and that way you can simply build a 
translation table in memory to map the incoming A/D values to the LED 
scale based on the battery chemistry in question.

          -Dave

--
Dave McGuire           "She's a cheek pincher.  I have scars."
St. Petersburg, FL                          -Gary Nichols


More information about the geeks mailing list