Tri-Color LED Breakout Quickstart Guide


Overview:

Brighter than the LED Starter Kit but not quite packing the punch of the über bright Luxeons, the Tri-Color LED Breakout Kit lets your geek shine. If you need something large, bright, and colorful to cast your project in the best light, look no further than the Tri-Color LED Breakout Kit. With superbright LEDs it can blind brighten just about anything! Here we have everything you need here to get you up and running with it quickly.

Tri-Color LED Breakout Kit

Requirements:

Assembly of this kit will require soldering. So, if you don’t already know how, please check out this helpful guideAdditionally, you will need a few tools for assembly: 

Since the Tri-Color LED Breakout is simply a breakout there are many, many ways you can use or control it. However, for this guide you will find the following helpful:

What it Does:

The Tri-Color LED Breakout Kit is a simple kit designed to allow control of very bright LEDs which draw more current than the pins of a microcontroller can provide. Each LED has transistor to switch the 5V source to the LEDs. There is also a current limiting resistor to drive each LED as close to their 80mA maximum as possible. Check out the schematic to see it all laid out.

How to Use it:

Assembly:

Before beginning assembly, carefully check that you've got all the parts. You should have the following:

Missing any parts? (Bad SparkFun kitters!) Drop our customer service team an email. We'll get them out to you as soon as possible.

Alright, let's begin building!

Tri-Color LED Breakout Kit PCB

Grab that PCB and check out the big round silk screens in the center. These are for your LEDs. The longer leg of each of the LEDs will go into the hole marked “L” for long and the shorter leg in the hole marked “S” for short. This is really important because LEDs are diodes and if you install them backwards they will not turn on.

Now you need to figure out which color each LED is. There are a few ways to do this:

Coin Cell LED Testing

1) Grab a coin cell battery and insert the coin cell between the battery leads with the positive side of the battery contacting the longer lead (the anode) on the LED. The LED should light up, indicating its color. If it does not, make sure that the battery is oriented correctly and that both sides of the battery are touching the LED leads. The battery is only capable of outputting a small amount of current so don’t worry your LED will be brighter once this is assembled!



Multimeter LED Testing

2) A nice multimeter will have diode test setting (sometimes combined with continuity testing) which you can use as shown to light up your LEDs. The multimeter only puts the tiniest bit of current though the LED so don’t worry that your LED looks super dim!
 

LED Current Limiting Resistor Test

3) Grab a 330 ohm resistor (the one with stripes colored in this order: Orange, Orange, Brown, Gold) and 5V. Connect as shown. We are using the 330ohm resistor to limit the current because we want to be sure the current is low enough to not destroy the LED. So, again, don’t worry your LED will be brighter once this is assembled!

LEDs Soldered
 

Now that you know which color is which solder those little buggers in the right places and clip their leads. Make sure to push the LEDs flat against the PCB. They should take a little pushing to get all the way through.

Next, it is time for the transistors. Transistors are used because these LEDs will be running at their maximum brightness around 80mA. That’s more than a typical microcontroller, like Arduino, can output on a pin. So, we use transistors to switch the LEDs on and off. Line the transistors up with their footprints. A little wiggling should get them as close to the board as possible. Then solder and clip their leads.

Tri-Color LED Breakout Kit  Top View

Third, the resistors. Each resistor will have a color code indicating its value. You can either read this color code or use a multimeter to measure the resistor’s value. It is important to match the resistors up with their correct spots on the PCB. Match them using the number printed on the PCB or use the first letter of each color of the bands. Don't worry about the direction in which they are inserted, it is not important. Color codes for the resistors in this kit are given below:

7.5 Ohm (Violet, Green, Gold)
6.8 Ohm (Blue, Gray, Gold)
20 Ohm (Red, Black, Black)
330 Ohm (Orange, Orange, Brown, Gold)

Finally solder on a connector. We choose to use male headers for use in a breadboard but you, of course, are free to use just about anything you please.

Hardware:

Now let's get this thing shining! You can treat the board like a simple LED breakout because the transistors are pre-configured for use with a low current digital signal.  Wiring this to a microcontroller is incredibly simple just make sure that your power supply can provide 240mA (80mA *3 LEDS). Most wall warts and USB sources can provide this easily. Now, wire to your Arduino as shown:

Tri-Color LED Breakout Wiring Diagram

Firmware:

Now that everything has been hooked up, we're ready to control it with our Arduino. First, you will need to install the Arduino IDE if you haven't already. This will allow us to load example code and control our LEDs. Check this tutorial if you need more help installing the Arduino IDE.

Notice we wired the PWM pins on the Arduino? This allows us to flicker the LEDs on and off very fast, faster than the eye can see, to produce a ‘dimming’ effect. Check out the example code below for a demonstration:

 /*
 Tri-Color LED Breakout - An example sketch for the Tri-Color LED Breakout
 By: Hilary Hoops
 SparkFun Electronics
 Date: 6/23/11
 License: CC-BY SA 3.0 - Creative commons share-alike 3.0
 use this code however you'd like, just keep this license and
 attribute. Let me know if you make hugely, awesome, great changes.
 */
  
int RedLED = 9;     // LED connected to digital pin 9 (pwm pin)
int GrnLED = 10;    // LED connected to digital pin 10 (pwm pin)
int BluLED = 11;    // LED connected to digital pin 11 (pwm pin)
int LED[3]={RedLED, GrnLED,BluLED}; //an array to make it easier to cycle though 
the LED colors

void setup()  { 
  //Set pins as output pins
  pinMode(RedLED, OUTPUT);   
  pinMode(GrnLED, OUTPUT);   
  pinMode(BluLED, OUTPUT);   
} 

void loop()  {
  //Fade each LED in and out individually. Possible range is 0-255
  for(int i=0; i<3;i++){ //Cycle LED color
    //Fade in
    for(int fade=0; fade<=255; fade+=5){
        analogWrite(LED[i], fade); 
        delay(30);
    }
    //Fade out
    for(int fade=255; fade>=0; fade-=5){
        analogWrite(LED[i], fade); 
        delay(30);
    }
  }
  //Fade all the LEDs in and out 
  //Fade in
  for(int fade=0; fade<=255; fade+=5){
      analogWrite(RedLED, fade); 
      analogWrite(GrnLED, fade); 
      analogWrite(BluLED, fade); 
      delay(30);
  }
  //Fade out
  for(int fade=255; fade>=0; fade-=5){
      analogWrite(RedLED, fade); 
      analogWrite(GrnLED, fade); 
      analogWrite(BluLED, fade); 
      delay(30);
  }
}

That should be all you need to get your lights shining.

Resources:

Conclusion:

Enjoy your new LEDs! If you have any problems, feel free to contact SparkFun Technical Support at techsupport@sparkfun.com

Comments 3 comments

  • And then I had noticed that the poor thing was screened wrong. It should be screened the same on both sides. Top and bottom.

    Also a special sound set towards your demo sketch author. The person wrote one which only needed one thing changed. For some strange reason a select, and copy to clipboard and then pasting inside the IDE caused the comments to be broken wrong in spacing. Fixed with a judicious delete on spacing….. Also means that the code contained in the repository needs to be checked….

  • Interesting idea for the LED positioning scheme. L for the long lead, and S for the short one. Took me for a fast loop.

    • This really confused me as well and your comment above about the comment line break missing (or an additional line comment on the following line) is still an issue.