LED Light Bar Hookup

Pages
Contributors: jimblom
Favorited Favorite 10

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:

language:c
/* 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(25);
  }
  delay(1000); // Hold at full brightness
  for (int i=255; i>=0; i-=5) // Sweep LED off
  {
    analogWrite(ledControlPin, i);
    delay(25);
  }
  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