Respect Your Batteries

Seriously.  These seemingly innocuous little things can kill you if you mistreat them.  So be kind to your batteries, alright?  Don’t overcharge them, or short them out, or put them into hot ovens, or stab them, or shoot them with rifles, etc, etc.

Just an ordinary SLAB...

You see, I’ve had more than one close call with a battery in my day.  Like the time I was working on a regenerative motor drive circuit and suddenly had a gate driver IC turn into a dead short across 24V of lead-acid batteries.  Have you ever seen a 14-DIP glow red hot?  I have.  The aftermath looks something like this:

A Very-Failed Gate Driver IC

And then there was the time I was trimming some wires on the end of a string of twenty LiPo cells.  Somehow, I managed to temporarily short the two ends of the string with the diagonal cutters I was using.  End result?  The enormous surge of current actually  vaporized a chunk of metal from the tip of the cutters.  Oops.

Of course, misuse isn’t the only cause of battery misbehavior.  Overuse can cause problems as well.  Just yesterday, my UPS shut down and started beeping incessantly.  Now, in its defense, I’ve been using it almost non-stop for the past six years and have never replaced its battery.  In the last year, it’s probably warned me two or three times that it needed a new battery, but until yesterday, I’ve ignored it.  For one thing, I operate it at only about 10% of its full-load rating.  For another, it’s no longer supporting any equipment that needs to remain online during a power failure.  So I figured, eh, I don’t mind if it only lasts a few minutes during an outage – I’ll grab a new battery for it with my next Digi-Key order.

Well, when the unit finally shut down for good yesterday, I figured I’d better go ahead and pull out the battery.  Once I had the cover removed, however, I discovered three causes for concern.  First, the battery was unusually hot (about 130F according to my IR thermometer).  Second, it had swolen so much that I could no longer slide it out of my UPS.  Third, it had split in four places on its bottom, as you can see here:

Battery failure...

Battery failure (closeup) ...Yea, that looks pretty bad, right?  Electrolyte had actually started leaking out of one of the splits and had begun a bit of rusting on the battery housing cover.  You can see a close-up shot of this to the right.  Perhaps even more unnerving, however, is that when rotated, you could hear bits and pieces of something rattling around inside the battery.  That can’t be good.  Batteries aren’t supposed to have things rattling around inside of them…

So presented with this new problem, I grabbed my safety glasses and moved everything into the kitchen.  Why?  Well, I figured that if the thing started smoking or something while I was attempting to remove it from the UPS, I’d just toss the whole works into the oven (which was of course turned off), close the door, and grab the nearby fire extinguisher.  Fortunately, I didn’t need any of that.  After a bit of sweat and a lot of not-so-gentle prying, the battery popped lose and started to slowly cool.

Here’s something I don’t understand though: why did this sealed lead-acid battery split open at the bottom?  Isn’t that what the circular cuts on the top of the battery are designed for?  To vent any pressure accumulating inside the cells?  And yet, if you scroll back up to the top of the page and take a look at the first image shown, it sure doesn’t look like any of those vents have even cracked.  I don’t think I’ll be buying my replacement battery from YUASA though, I can tell you that…

And now, to wrap things up, more examples of why you should be nice to your batteries (especially LiPo cells… these things are psychotic):

 

By the way, Lithium battery chemistry has greatly improved over the years.  The risks of such spectacular fires are now quite low.  But please, don’t push your luck.  Respect.

Review: TI’s High-Power LED Driver Evaluation Board

On my desktop, I keep a list of miscellaneous parts I’d like to buy at some point (e.g. power resistors, laser diodes, etc).  Parts not destined for any specific project, just things that I’d like to toy with.  Well for a long time, I’ve wanted to get my hands on some high-power LEDs.  I suppose I’m just a sucker for pretty lights.  But for some reason, I’ve never gotten around to ordering any – probably because I’ve never had a good means of driving said LEDs (and I’m too busy lazy to make my own driver circuit).

Well last week Farnell (Newark in the States) came to my rescue with an offer to send me any product from their site (within a certain price limit) for free.  All they asked of me was an evaluation (this post) and a link to the product on their site.  And which product did I pick?  The TPS62260LED-338, a three-color LED driver evaluation module:

TPS62260LED-338This board hosts three 500mA LEDs (W5SM) from OSRAM.  Each LED is driven by a TPS62260 step-down DC-DC converter.  A low-cost MSP430F2131 microcontroller controls all three drivers via pulse-width modulation.

Out of the box, my first impression: these LEDs are painfully bright (especially that red one – my vision is still spotted as I type this).  They’re not kidding about protective eyewear.  But I wouldn’t want it any other way. 🙂 For most of my testing however, I simply covered the LEDs with about four sheets of paper.  That brought their intensity down to a comfortable level.

I must commend TI on making this board very easy to use and probe.  They’ve provided several nice wire-loop test points for connecting scope probes.  And they’ve even broken out the power and ground connections for people like me who don’t have the proper barrel connector power supply.  I was also pleased to see how they’d integrated heat sinks for each of the three LEDs into the PCB itself using a plethora of plated drill holes.  In operation, the board only just becomes warm to the touch.

But let’s talk about the real highlight of this board: the LED driver circuits.  Because LEDs operate within such a tight voltage range (their operating voltage is actually assumed to be about constant), they’re normally powered by some type of current controller (since the brightness of an LED is proportional to the current flowing through it).  Any yet, this board features three DC-DC voltage converters – devices which take a high input voltage and convert it to a lower output voltage.  So how is this supposed to work?

Well, each converter IC provides closed-loop control over its switching output.  In other words, the TPS62260 measures a feedback voltage and uses this to adjust its output duty cycle.  So regardless of how much current (well, up to 600mA) is being drawn from the output, the converter is able to maintain a fixed output voltage.  But here’s the tricky part: you can attach the converter’s feedback measurement input pin to anything (within reason, of course).  In this case, TI has wired each feedback pin to a 2Ω current-sensing resistor (part R9, below) connected in series with each LED.  Each converter will adjust its output in order to maintain 0.6V at its feedback pin (as 0.6V is the internal voltage reference of the converter).  Using ohm’s law, and realizing that the current will be the same in both the sense resistor and the LED, since they are in series, we can determine the LED’s current to be I = V/R = 0.6/2 = 0.3A or 300mA.

LED Driver Schematic

But wait, the current-sensing resistor is fixed, the converter’s internal voltage reference is fixed… so how do we control the current delivered to the LED?  Simply put: we don’t.  Then how can we control its brightness?  Pulse-width modulation.  Imagine flipping a light switch on and off so rapidly that you can no longer detect a flicker.  Then, adjust the ratio of the on and off times.  The longer the on time, the brighter the light will appear.  This is precisely what the MSP430 microcontroller is doing to control the brightness of the LEDs.  In fact, you can see this happening if you wave the board around rapidly while one of the LEDs is being dimmed (in this case, the blue LED):

Pulse-width modulation in action!

That image was captured with a 0.1s shutter speed.  And actually, with that knowledge, we can calculate the frequency of the PWM signal.  I count about twelve blinks of the blue LED there – so twelve blinks in 0.1s yields a frequency of 12/0.1 = 120Hz (a result I confirmed with my IOBoard oscilloscope).  If you’d like to read more about pulse-width modulation, check out my previous post on the subject.

So out of the box, the microcontroller on this evaluation board is programmed to slowly turn on and off each LED in sequence, such that one LED is always fully on while another is being ramped on or off.  This produces a very pleasing color gradient.

Now, according to the manual that came with the board, you’re also supposed to be able to turn the knob on the board in order to manually adjust the color balance.  Unfortunately, this feature did not work for me.  When I turn the knob on my board, the automatic sequence stops and the LEDs hold their current brightness states.  However, they do not change brightness when the knob is turned further.  I’ve probed the knob (which is actually a digital encoder) and believe it to be working properly.  My guess is that somebody just botched up the software.  It happens.

This brings me to my final point of discussion: reprogramming.  The TPS62260LED-338 provides a JTAG header for the traditional four-wire JTAG programmer.  Unfortunately, I do not possess such a programmer.  I was hoping instead to use the MSP430 programmer which is integrated into my LaunchPad development board.  Sadly, I never checked into the details: the LaunchPad programs via the two-wire SpyBiWire (SBW) interface, not the standard JTAG interface.  And of course, the MSP430F2131 does not support SBW.  So for now, there will be no reprogramming.  Of course, thanks to all of the convenient test points, it’s fairly easy for me to just put the micro into reset and drive the LEDs using my own PWM waveforms.  If anyone out there has any tricks for reprogramming though, please let me know!

So in conclusion, I’d say the TPS62260LED-338 is a product worth checking out.  For just over $20, it’s a pretty good deal.  If they’d given it the USB programming interface of the LaunchPad, I’d probably be happier, but then they would’ve needed to lower the current draw of the LEDs, which would’ve been no fun, or required a separate power supply, which wouldn’t have been such a big deal.