Overview

Here’s how to use our addressable LED strips and pixels for portable projects — bicycles, costumes and fashion accessories — using readily-available AA cells. This is much easier and less expensive to start with than using fancy lithium-polymer batteries and voltage converters.
Our 12mm LED pixels and digital RGB flex strips all operate on 5 Volts. When working at one’s desk or workbench, this is easily supplied with a 5 volt wall adapter, or you might have a bench power supply.

So how do we get our project off the workbench and out into the world?
36mm LED pixels and “analog” LED flex strips require 12 Volts and are not covered here — this tutorial is strictly for 5V LED products.
The recommended 5 Volts is a “nominal” rating…we actually have a little bit of wiggle room here. About 10% above or below this figure works fine. You can see this by measuring the output of a wall adapter with a voltmeter: due to manufacturing variance, the actual output could be anywhere in this range. So anything from about 4.5 to 5.5 Volts is safe for these LEDs and 6V is the 'rated absolute maximum'. Any higher and they’ll burn out quickly. Any less and the colors will appear muddy and brown.

About Batteries

Different battery types have different output voltages…a function of their internal chemistry. Among common household batteries — the kinds you might find at the grocery store — there are two major types:
Rechargeable nickel metal hydride (NiMH) cells output 1.2 Volts, as do nickel cadmium (NiCd) cells. The latter have fallen out of favor for a number of reasons, but maybe you still have a few around the house.

These cells are more expensive up front, and require a charger. But for frequent use, they can be more economical in the long run.
Single-use, disposable alkaline cells output 1.5 Volts.

Though not reusable, for occasional use they may be more economical. But the main benefit is their ubiquity — replacements can be bought almost anywhere, important when you’re away from home and a charger.
(We’re using approximate numbers here. Actual output will vary by some fraction of a volt depending on the cell’s age, state of discharge, temperature and other factors. For most casual projects, these small factors can be ignored for simplicity’s sake.)
When cells are wired in series (joined end to end, as when installed in our 4X AA battery holder), add up the voltages to determine the total output:
4 NiMH cells = 4.8 Volts total. That’s right in our target voltage range, making it perfect for the LED strips! If you’re using rechargeables, the 4 cell holder can be used directly to power your project.
4 alkaline cells = 6.0 Volts total. Uh oh…that's too much! If connected directly to an LED strip, this will burn it out. Fortunately, there’s an easy workaround…

Diode Fix for Alkaline Batteries

“I don’t know if you wanna trust the safety of our country to some, uh…silicone diode!”
— General Beringer, WarGames
A single 1N4001 diode has about a 0.7 Volt drop across its leads. Wired to our 6 Volt battery pack (when using alkaline cells), this yields 5.3 Volts output. That’s within our 5V±10% target window, so this simple component addition is all that’s needed to use the battery pack with the LED strips and pixels.

This same solution can 
be seen in our Digital Programmable LED Belt Kit.

Diodes have a specific polarity, passing current in only one directionthe silver stripe is the + end. So we want to connect the + terminal from the battery pack to the “dark” end with no stripe.
This sequence is only needed if you’ll be using alkaline cells. If you know for a FACT that ONLY rechargeables will be used, this part can be skipped. If you’re unsure, or will use different cells at different times, add the diode.
This works for small projects with a short run of LEDs; at most about 1A average current. A single small diode like this is not rated for the high current required of larger projects.

Cut the red wire of the battery pack short by about an inch.

Strip off about 3/8" insulation from the red wire.

Then “tin” the end of the wire with a bit of solder to keep it from fraying.

Clip the end of the diode (the “dark” end, without a silver stripe) to a similar length, then solder the red wire to this.

Clip the other end of the diode (the side with a silver stripe).


Cut off and slide a 2" piece of heat shrink tube onto the red wire. Keep sliding it all the way past the diode.

Now solder the positive wire from your LED circuit to the “stripe” end of the diode. Or you can add a plug/receptacle pair between the two to make them easier to separate and service later on.

Take the piece of heat shrink you slid over the wire before…

…and slide it back over the diode and the solder joints.

Shrink the tubing to grip the diode and wires. You can use a heat gun, lighter or the edge of your soldering iron.

Taa-daah!

The black wire from the battery holder then connects to the ground wire of the LED circuit (or plug/receptacle, if you’ve installed one). This side is much simpler than the diode-equipped wire:

Slide a small 1" piece of heat shrink onto the black wire (this image shows a much shorter piece…oops…go a little longer than this).

Solder together the ends of the wires. The dreaded inline splice!

Then slide and shrink as you did before. Done!

Powering the Microcontroller

The Arduino (or other 5 Volt microcontroller) can be powered off the same supply as the LED strip, by splitting the power leads (after the diode, if used) and connecting to the Arduino’s 5V pin (not Vin) and GND.
LED strips aren’t picky about which side they receive power from, only data. In a pinch, if the situation really calls for it, you can connect the battery pack (with diode, if used) to the OUT end of the strip, then power the Arduino from the + and – connections on the IN end (along with the serial data and clock signals). This isn’t recommended though, because voltage drops slightly along the length of the strip, and the Arduino (which is supposed to be running everything) will give out sooner as the batteries approach depletion. Powering the Arduino close to the batteries ensures a healthy voltage, to stay in control for as long as possible.

Estimating Running Time

How long will one set of batteries last?

This can be fiendishly difficult to predict! Sometimes the only way to be sure is to plug it in with a fresh set of batteries and check the circuit and a clock periodically, until the LEDs fade or start to act erratically.

Why is it so difficult to predict?

Digital LEDs seldom run in one fixed state — they’re usually animated. We can estimate the power use for a steady configuration, but animation is constantly in flux.

Also, battery manufacturers often overstate their cells’ capacity, or express it under extremely idealized circumstances.

Where do I start?

Track down a datasheet for your batteries! You might find it on the manufacturer’s web site, or a vendor site such as Digi-Key. Easiest is just to use a web search engine. In most battery datasheets you’ll see one or more charts like this one:
This chart shows the cell’s output voltage over time, at different discharge rates. You can see that the expected service life is not directly proportional to power drain — halving the latter more than doubles the former. Again, with a fixed configuration, we could plan for this, but our LEDs are in motion, which doesn’t make things any easier. You’ll probably just have to come up with an informed average.

Elsewhere in the datasheet (or often printed on the cell itself, in the case of rechargeables), you may find a capacity in mAh (milliamp-hours).
LED current use is measured in milliamps (mA). As a rule of thumb, we usually use 20 mA as a guideline for a single LED at full brightness, and each color “pixel” contains three LEDs (one each for red, green and blue), for a total of 60 mA per pixel when displaying white at full brightness. If we leave that pixel on in that state for one hour, we’ve used 60 milliamp-hours (60 mA × 1 hour = 60 mAh). If the stated battery capacity is 2100 mAh, we could expect to run that one pixel for about 35 hours continuously before the battery peters out (2100 mAh ÷ 60 mA = 35 hours).
But single pixels are seldom left on at full brightness for hours. Usually there’s some combination of brightness levels being mixed, some number of pixels are off entirely, and these states may change many times per second. That’s why we just use reasonable estimates, as in “On average, running this code, I think there’s about ten pixels on at any given time, and the average color mix represents a brightness level of 75%.” Starting with the “60 mA per pixel” rule of thumb: 60 mA × 0.75 = 45 mA average per pixel. 45 mA × 10 pixels = 450 mA. Left to run continuously, with a 2100 mAh battery pack, 2100 mAh ÷ 450 mA = 4.66 hours.

Complicating matters further, the LED driver chips themselves use a tiny bit of current, even when the LEDs themselves are “off.” Each chip needs about 2 mA extra…for a strand of 25, it’s using about 50 mA just in this idle state. You may want to factor this into your estimation. Oh, and we forgot to mention power use for the microcontroller that’s driving all this…about 25 mA or so for an Arduino. So we’ll add about 75 mA to the above estimate: 2100 mAh ÷ 525 mA = 4 hours.

If you have a really nice multimeter with an average current recording mode, it will be your new best friend, because it’s doing this based on actual readings. But this capability is usually present only in high-end meters.

You may also want to add some “engineering overhead” to your estimate. Remember what was said about battery capacity often being idealized. So we’ll de-rate the battery by a bit, let’s assume reality is about 80% of the stated capacity: 2100 mAh × 0.8 = 1680 mAh. 1680 mAh ÷ 525 mA = 3.2 hours.

As you can see, there’s an awful lot of fudging and speculation in this process. This is why we say it’s easiest sometimes just to plug in some batteries and keep an eye on it!

Tips for Larger Projects

AA batteries are surprisingly potent little things, and a set of four can comfortably run about a meter of LPD8806 LED strip or one strand of 25 12mm pixels for a couple hours or more. You can go beyond this to create larger projects, with some forethought…

  • A fully-lit 1 meter strip can demand close to 2 Amps, but the batteries and diode are only rated for a continuous output of about 1 Amp. You can push beyond this for brief intervals, but it can’t be sustained. Design your software so that the LEDs seldom or never exceed this level, using the 60 mA rule of thumb.
  • Voltage diminishes slightly along the length of a strand. And when voltage drops too far, the LEDs will show dim and muddy colors. When using long runs of LEDs, we recommend adding an extra power tap every meter or 25 pixels to reduce this voltage drop.
  • Remember that “off” pixels still need a tiny bit of current for the driver chips…about 50 mA per strand or meter…and another 25 mA for the microcontroller. Factor this into your battery calculations and software design. Large setups may be using hundreds of milliamps that are never seen, but continuously pass through that diode with its 1 Amp ceiling.
  • C or D cells have more capacity for extra run time (up to 12,000 mAh with top-of-the-line NiMH D cells). We don't stock battery holders for these, but suitable ones can be found at Radio Shack and elsewhere. The 1N4001 diode is still rated for 1 Amp continuous output though…so for a larger project with many LEDs simultaneously lit, you might need to swap this out for a beefier diode such as a 1N5400, good for up to 3 Amps. This may get hot, so don’t leave it exposed to curious fingers.
This guide was first published on Jul 29, 2012. It was last updated on Jul 29, 2012.