LED Light Bar Hookup a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t133



LED Light Bars are a super-easy way to add some extra-bright and colorful illumination to your project. Each Light Bar is essentially a set of three super-bright 5050-size LEDs. They’re offered in a variety of colors including white, red, blue, and green (note: the blue and green light bars are an older version, they look different but can still be connected the same way).

LED Light Bars lit up

While these bars are very simple devices, they do have a few quirks when it comes to using them. Like the fact that their nominal operating voltage is 12V. In this tutorial we’ll go over some of the important specifications of these LED Light Bars. Then we’ll dive into some example circuits that can help you get the most of these nifty little LED assemblies.

Suggested Reading

Here are some concepts and tutorials you should be familiar with before diving into this tutorial:

Hardware Overview

A glance at the LED Bars will reveal that there’s not a whole lot required to interface with them. There are two pairs of wire pigtails coming off the sides, labeled ‘+’ and ‘-’. The darker-gray wire connects to the ‘+’ pin, and the white wire connects to ‘-’ on both sides.

LED Bar with quarter for size comparison

These wires supply power directly to the LEDs. A nominal voltage of 12V should be applied to these wires. A lower voltage will work (to a point) but result in dimmer LEDs. Either of the wire pairs can be used to supply power to the LED, and the unused pair can either be trimmed or connected to another LED bar.

The bars themselves measure about 3 inches across and half an inch wide. Each has three super bright SMD LEDs, which are spaced by about 1.07".

For mounting purposes there are drill holes on either side of the board, and a peel-away sticky foam on the backside.

LED Characteristics

The “nominal” voltage for these LED Bars is 12V. “Nominal” as in that’s what’s recommended by the manufacturer. They will work at lower voltages, although that’ll mean sacrificing some brightness.

The table below shows some of the characteristics for each of the LED bar colors. These are values we found while testing the bars out. The minimum voltage was the lowest voltage where the LEDs were at recognizably lit up, although very dim. We recommend that you at least give the LEDs around 7V. The higher the voltage, the brighter your LED will be.

ColorMinimum voltageCurrent @ 7VCurrent @ 9VCurrent @ 12V
White4.84 V8.35 mA25.8 mA55.2 mA
Red2.8 V13 mA29.8 mA54.0 mA

As far as current pull goes, both LED colors consume about the same when powered from between 9 and 12V, up to about 55mA when powered at the nominal voltage.

Reverse Engineering the Light Bar Circuit

Looking at the visible components on the bars, it’s apparent that there’s not a lot to them. Three six-pin, SMD LEDs, and an equal number of resistors. We can easily reverse-engineer this circuit to find out exactly how these things work.

Each SMD LED is actually a collection of three equal LEDs. The LED bar’s PCB is set up to string those LEDs in series, with the resistor in-line to limit current. The values of the resistors depend on the color of the Bar. The red bar, for example uses 330Ω and the white bar uses 150Ω resistors.

LED bar schematic

Connect three of those circuits in parallel an you have your LED bar!

Assembly Tips

In most cases, Light Bar assembly begins with stripping some wire. The wire pigtails on the bars are 20 AWG, and should be easy enough to strip with any, old wire stripper.

The wire lengths can be extended, if need be, with a little splice. Don’t forget to cover your splice with heatshrink!

Alternatively the stripped pigtails can be tinned, crimped, or plugged directly into a mating connector.

Stringing Bars

The ‘+’ and ‘-’ wires of one bar can be connected to another to string them together. More and more bars can be stringed until you start to approach the current limit of the 20 AWG wires – about 1.5A. With some back of the napkin calculations – 55mA per bar, 1.5A max – that’d be 25-ish bars.

Bars strung together

Mounting the Bars

There are two possible methods for mounting the LED bars. There are mounting holes on either end of the bar with a 0.15" drill diameter, allowing for the bars to be screwed down. Every bar also includes a peel-away sticky-foam backing which adheres about as well as you could expect.

With a little prying, the PCB assembly part of the LED bar can be removed from the plastic mounting backing. This might be useful if your boards might need a tighter fit.

Backing removed from bar

Example Circuits

There are a variety of ways these LED bars can be controlled and illuminated. Let’s look at a few example circuits:

Direct Power

If you don’t care about dimming the LEDs, the easiest way to power them up is to connect them directly to a 12V power supply. Stick them in your enclosure or project, plug the supply in, and forget about them. If you’re looking for a supply that can source 12V, either a wall wart or a more general power supply should be able to do the job.

Bars directly powered

The DC Barrel Jack Screw Terminal Adapter makes connecting the 12V wall wart to the LED bar way easy.

To gain a little control over the LEDs, you can add a switch in-line between the power source and either the ‘+’ or ‘-’ wire of the first LED bar. Just make sure you pick a switch that can handle the high amounts of current that may run through it.

Dimming with MOSFETs

If you want to add some dimming control over your LED bar, MOSFETs combined with pulse width modulation are the tools you’ll need. There are a few approaches you can take to generating a PWM signal to control the MOSFET and LED bar. Here are a couple options:

Using an Arduino

If you’ve got an Arduino lying around (and what budding electrical engineer doesn’t these days?), that may prove to be the easiest way to control the LED bars via PWM. Use a circuit like below, with an n-channel MOSFET and the Arduino powered through the barrel jack connector by a 12V wall wart:

Arduino MOSFET circuit

Make sure the positive LED wire (the gray one) is connected to ‘VIN’ of the Arduino, which should be 12V (but could be 9V too). Our MOSFET Power Control Kit works perfectly for a circuit like this:

Arduino control image

Where the pin connected to the MOSFET gate could be any PWM-capable Arduino pin (3, 5, 6, 9, 10, or 11 on most ‘duinos). Then just write a simple sketch which analogWrite()’s that pin to the desired level. For example, you could slowly dim the LED bars with a sketch like this:

/* MOSFET LED Bar Dimmer
    Example Arduino Sketch

// Define the pin connected to our MOSFET gate:
int ledControlPin = 3; // Must be a PWM pin -- 3, 5, 6, 9, 10, 11

void setup()
  // Setup the LED control pin as output, start low
  pinMode(ledControlPin, OUTPUT);
  digitalWrite(ledControlPin, LOW);

void loop()
  for (int i=0; i<=255; i+=5) // Sweep LED on 
    analogWrite(ledControlPin, i);
  delay(1000); // Hold at full brightness
  for (int i=255; i>=0; i-=5) // Sweep LED off
    analogWrite(ledControlPin, i);
  delay(1000); // Hold at off

Or come up with other nifty sketches. How about attaching a potentiometer, and controlling the LED’s intensity with that?

Using a 555 Timer

If you don’t have an Arduion around, or are looking for a more analog/elegant/cheap solution, you could use a 555 timer and a handful of common components to generate the PWM signal. Here’s an example circuit:

555 Dimmer circuit

Most 555 timers can work at up to 16V, so you can run it directly off the 12V supply. Then twist the potentiometer to adjust the brightness. Woo 555 timers!

555 Timer circuit image

Resources and Going Further

Now that you know how easy it is to wire these LED bars up, what project are you going to make with them? Need some inspiration, check out some of these tutorials:

GPS wall clock

Or (on a slightly smaller scale) here are some other tutorials that might catch your interest:

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado