Tuesday, 2 May 2017

#8 Low battery blinking indicator

This thought came out of the LED ring flash li-po mod, since the battery indication programmed into the microcontroller was "calibrated" for 100% being the 6v coming out of four full AA batteries, and (close to) 0% around 3.8-4v. Obviously, since a single lithium cell is only 4.2v when full, the stock battery indicator's out of whack.

Next step - i wanted a blinking indicator. Partially, because a solidly-lit LED would be a constant drain, and partially because a flashing light is more noticeable - think turn-signals on cars, or the emergency lights on police cars & ambulances.

Another criteria for this was to be able to put this together using as-jellybean-as-possible components. Why not make it cheap & simple, with parts i already have, instead of digging after "esoteric" ICs (which cost money, and need to be ordered and shipped)?

The simplest circuit i could think of, that would blink an LED, was the "classic" humble astable multivibrator. I threw together the circuit in LTspice, did a bit of math to see what resistor & capacitor values would get me in the ballpark i wanted (around 4Hz-ish), and then tweaked & juggled them a bit until it did what i wanted. The result was this:


Ignoring that first pulse, the following ones (should) occur at a rate of about 2.3Hz (corresponding to a period of about 430ms), and the LED is lit with a roughly 32% duty cycle (ie. lit up for around 130ms).

Then came the time to figure out how to whip up the low-battery detection circuit. Since the protection chip cuts off the lithium cell around 3v, i figured i'd give myself some leeway (and enough time to charge the cell) and get the detector to trigger when the battery reaches around 3.3v. It took me a while (read: a couple of hours of messing around in LTspice with various topologies and resistor value tweaking), but i managed to reach a satisfactory-enough behaviour.






The blue trace is the (simulated) battery voltage descending, and the white trace is the output voltage (ie. the voltage across R4). As you can see in the plot, with the component values shown, the output turns on at 3.3v. This output then supplies the above-described oscillator which starts blinking the low battery indicator LED.

Since this is once again a one-off (or maybe two-off), i wanted to get the PCB layout to be as simple as possible, and achievable via scoring "islands" on a piece of blank copper-clad board. Fortunately, this went considerably smoother than the design of the "trigger" circuit.


The board came out at about 26mm x 18mm (roughly 1in x 0.7in), and straight-forward enough for me. The 44k resistor from the LTspice schematic is made up of three resistors on the board (20k + 20k + 4k, simply because i have a bunch), although there's a good chance that'll need some tweaking. So it's just as well that i've got the space and options to do it, with series/parallel-ing resistors. The two big footprints are the two 47uF capacitors, which will be two tantalum caps i've scavenged from upgrading my iPod. I also added a 100nF cap on the input, for good measure.


Well, the <ahem> prototype board came out ok enough, i suppose. In the words of the one and only AvE - "she ain't pretty, but she's got it where it counts"...



Assembly was uneventful. Well, apart from dropping (and thus, losing) one of those 47uF tantalum caps, which prompted browsing through my component stash. I ended up with a pair of 22uF 10v tantalum caps. The blinking rate is thus brought up to something around 4Hz-ish. You're gonna notice it.


First step of testing was hooking up the bench supply (set to 3.7v and 25mA) directly to the blinker circuit. Working fine even when turned down to under 3v - perfect. Second step was connecting the positive lead of the bench supply to the input "island" of the entire circuit. At 3.7v, nothing at all. Upon slowly turning down the voltage, the LED started veeery dimly blinking around 3.35v. Close enough for jazz...

Aaaaand that's about that, really.

No comments:

Post a Comment