# RGB LED Strips

## Overview

http://www.flickr.com/photos/adafruit/5162826878/

We love some good LED blinking as much as the next person but after years of LED-soldering we need something cooler to get us excited. Sure there are RGB LEDs and those are fun too but what comes after that? Well, we have the answer: **LED Strips**! These are _flexible_ circuit boards with full color LEDs soldered on. They take a lot of LED-wiring-drudgery out of decorating a room, car, bicycle, costume, etc. The ones we carry are also waterproof (although not all are).  
  
There are two basic kinds of LED strips, the "analog" kind and "digital" kind. Analog-type strips have all the LEDs connected in parallel and so it acts like one huge tri-color LED; you can set the **entire** strip to any color you want, but you can't control the individual LED's colors. They are very very easy to use and fairly inexpensive.  
  
The Digital-type strips work in a different way. They have a chip for each LED, to use the strip you have to send digitally coded data to the chips. However, this means you can control each LED individually! Because of the extra complexity of the chip, they are more expensive.  
  
**[You can buy waterproof analog-type RGB LED strips by the meter at the Adafruit shop!](http://www.adafruit.com/index.php?main_page=product_info&cPath=37&products_id=285 "Link: http://www.adafruit.com/index.php?main\_page=product\_info&cPath=37&products\_id=285")**

Danger: 

Technical specs:

- 10.5mm (0.41") wide, 3mm (0.12") thick, 100mm (3.95") long per segment
- Clear waterproof molded
- 3M adhesive strip on back
- Maximum 12V @ 60mA draw per strip segment
- 3 common-anode RGB LEDs per segment
- LED wavelengths: 630nm/530nm/475nm
- No microcontroller or chip controller ('analog' only!)
- (We're working on getting an English datasheet from the manufacturer!)

![](https://cdn-learn.adafruit.com/assets/assets/000/002/681/medium800/led_strips_analogstrip_t.jpg?1396785743)

# RGB LED Strips

## Schematic

Analog type RGB LED strips come on a reel, and are made of 3-LED sections that are 10 cm long. They are easy to cut at the boundary of each section, theres a little cut mark area and some copper tabs you can solder to. Each LED in a section is a '5050' tri-color type, containing a red, green and blue LED. That means that every section really has 9 total LEDs - three red, three green and three blue. The LEDs are arranged in series as shown in the following schematic:

![](https://cdn-learn.adafruit.com/assets/assets/000/002/682/medium800/led_strips_astripsch.png?1396785761)

# RGB LED Strips

## Current Draw

Because there are three LEDs in series, you cannot drive these LEDs from a 5V supply. The LED strips say "+12V" on them to mark the anode and that's the maximum voltage we suggest. We've found that if you're ok with them being a little dimmer, even 9VDC works very well.  
  
Each segment of 3 LEDs draws **approximately** 20 milliAmperes from a 12V supply, per string of LEDs. So for each segment, there is a maximum 20mA draw from the red LEDs, 20mA draw from the green and 20mA from the blue. If you have the LED strip on full white (all LEDs lit) that would be 60mA per segment.  
  
To find the total maximum current draw per meter, we would multiply **60mA x 10** (ten segments per meter for the 30/LED per meter strip) = **0.6 Amps per meter** OR **60mA x 20** (twenty segments per meter for the 60/LED per meter strip) = **1.2 Amps per meter**. Again, that's assuming you would have all the LEDs on at once and that you are powering it from 12V. If you're going to be PWM-fading between colors, maybe 1/2 of that is what you'll be drawing. Still, you do need to have a fairly decent power supply to run this strip, all those LEDs add up!

# RGB LED Strips

## Wiring

Connecting up to the strip is fairly easy, you'll want to solder four wires to the copper tabs. We'll use white for +12V, then red, green and blue wires for the corresponding LED colors.![](https://cdn-learn.adafruit.com/assets/assets/000/002/683/medium800/led_strips_astripend_t.jpg?1396785766)

Cut away the waterproof overmolding at one end of the strip. The strips are symmetric so it doesn't matter which end you use.![](https://cdn-learn.adafruit.com/assets/assets/000/002/684/medium800/led_strips_astripcut_t.jpg?1396785770)

Scrape away the rubber to expose the copper pads.![](https://cdn-learn.adafruit.com/assets/assets/000/002/685/medium800/led_strips_astripscraped_t.jpg?1396785778)

Melt some solder onto the pads to tin them and also burn away any left over rubber.![](https://cdn-learn.adafruit.com/assets/assets/000/002/686/medium800/led_strips_astriptin_t.jpg?1396785782)

Solder the four wires on. We used stranded wire, which is more flexible and is probably a better choice than solid-core.![](https://cdn-learn.adafruit.com/assets/assets/000/002/687/medium800/led_strips_solderred_t.jpg?1396785788)

![](https://cdn-learn.adafruit.com/assets/assets/000/002/688/medium800/led_strips_wires_t.jpg?1396785795)

To protect the wires and maintain some waterproofness, you can use heatshrink.  
![](https://cdn-learn.adafruit.com/assets/assets/000/002/689/medium800/led_strips_heatshrink_t.jpg?1396785801)

![](https://cdn-learn.adafruit.com/assets/assets/000/002/690/medium800/led_strips_heatshrunk_t.jpg?1396785808)

Warning: If you have the wrong colors showing up, it could be because the manufacturer mixed up pins like Blue and Green, Turn off the power, switch leads, and apply power. You might have to do this a couple times to get the right wire order if the manufacturer messed up.

# RGB LED Strips

## Usage

Because these LED strips are very simple, we can easily use them with any microcontroller. We suggest&nbsp;using PWM dimming techniques to control the strip. Since each 'LED' pin may end up requiring an Amp or more to sink to ground, power transistors are **required**! Don't try to connect the pins directly to your everyday microcontroller, they will burn out and/or not work.  
  
You can use any power NPN or N-Channel MOSFET, make sure the transistor is rated to be able to pass as much current as you need. For example, since we draw about 0.2Amps per channel per meter, if you have a 5 meter strip you will need to pass up to 1 Ampere per transistor. Get the beefy "TO-220" packages, not the dinky little guys. Make sure they look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/002/691/medium800/led_strips_7805_t.jpg?1396785811)

For basic, low-cost usage we suggest using [N-channel MOSFETs](http://www.adafruit.com/partfinder/transistors#mosfet) such as the [IRLB8721](https://www.adafruit.com/product/355) - they are very popular and inexpensive and work with 3.3V or 5V logic. If you can't get those, [TIP120](https://www.adafruit.com/products/976) are also good but there is more voltage loss in a transistor than in a MOSFET which is why we suggest those first (less heat loss, more light!)  
  
This diagram shows connecting up with N-Channel MOSFETs where the Gate is pin 1, the Drain is pin 2 and the Source is pin 3  
  
The **IRLB8721**'s can handle up to **16 Amps** of continuous current - so that's at least 750 LEDs, and if you don't have them all on bright white, 1500 LEDs. You may need to heat sink depending on the continuous/overall power draw/dissipation

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/002/692/medium800/led_strips_ledstripfet.gif?1448059609)

This diagram shows connecting up with power NPN transistors such as TIP120, where Base is pin 1, Collector is pin 2 and Emitter is pin 3. Its very similar except this time we have 100-220 ohm resistors between the PWM output pin and the base.Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/002/693/medium800/led_strips_ledstripbjt.gif?1448059603)

Connect a 9-12V power supply to the Arduino so that **Vin** supplies the high voltage to the LED strip. If you want, you can also just use a separate wire that connects to a power supply that provides about +12V. Make sure to connect the ground of that supply to the ground of the Arduino/MOSFETs!  
  
TIP120's can handle up to **5 Amps** of continuous current - so that's at least 250 LEDs, and if you don't have them all on bright white, 500 LEDs.

# RGB LED Strips

## Arduino Code

Once you have the strip wired up, it is easy to control the color of the strip by using PWM output, for Arduino you can use **analogWrite()** on pins 3, 5, 6, 9, 10 or 11 (for classic Arduinos using the Atmega328 or 168). An **analogWrite(pin, 0)** will turn that LED off, **analogWrite(pin, 127)** will turn it on half-way and **analogWrite(pin, 255)** will turn it on full blast. Here is some example code that performs a simple color-swirl.  
  
[If you want to use other pins, check out this page on analogWrite() to know which models support analogWrite() on which pins](http://arduino.cc/en/Reference/analogWrite "Link: http://arduino.cc/en/Reference/analogWrite")

```auto
// color swirl! connect an RGB LED to the PWM pins as indicated
// in the #defines
// public domain, enjoy!
 
#define REDPIN 5
#define GREENPIN 6
#define BLUEPIN 3
 
#define FADESPEED 5     // make this higher to slow down
 
void setup() {
  pinMode(REDPIN, OUTPUT);
  pinMode(GREENPIN, OUTPUT);
  pinMode(BLUEPIN, OUTPUT);
}
 
 
void loop() {
  int r, g, b;
 
  // fade from blue to violet
  for (r = 0; r &lt; 256; r++) { 
    analogWrite(REDPIN, r);
    delay(FADESPEED);
  } 
  // fade from violet to red
  for (b = 255; b &gt; 0; b--) { 
    analogWrite(BLUEPIN, b);
    delay(FADESPEED);
  } 
  // fade from red to yellow
  for (g = 0; g &lt; 256; g++) { 
    analogWrite(GREENPIN, g);
    delay(FADESPEED);
  } 
  // fade from yellow to green
  for (r = 255; r &gt; 0; r--) { 
    analogWrite(REDPIN, r);
    delay(FADESPEED);
  } 
  // fade from green to teal
  for (b = 0; b &lt; 256; b++) { 
    analogWrite(BLUEPIN, b);
    delay(FADESPEED);
  } 
  // fade from teal to blue
  for (g = 255; g &gt; 0; g--) { 
    analogWrite(GREENPIN, g);
    delay(FADESPEED);
  } 
}
```

# RGB LED Strips

## CircuitPython Code

You can use analog RGB LED strips with CircuitPython's built-in analog/PWM output modules.&nbsp; Just like with [dimming a LED's brightness using CircuitPython](../../../../circuitpython-basics-analog-inputs-and-outputs/pulse-width-modulation-outputs) you can use PWM outputs to control the brightness of the strip's red, green, and blue LEDs.&nbsp; This allows you to set the color of the strip to anything you can imagine!

Just like with wiring to an Arduino you need to use transistors to buffer and control the higher current sent to the LED strips (your board can't supply all that current itself!).&nbsp; Be sure to [follow the usage page to wire the LED strip to your board](../../../../rgb-led-strips/usage) with power transistors as shown.&nbsp; This guide assumes the same wiring with board pin 5 connected to the strip's red LEDs, board pin 6 connected to green, and board pin 3 connected to blue.&nbsp; [As mentioned on the usage page](../../../../rgb-led-strips/usage) too be sure to use a powerful 12V external power supply with enough current to drive all the LEDs.

Here's an example of a Metro M0 Express wired to MOSFETs that drive a strip of LEDs:

![](https://cdn-learn.adafruit.com/assets/assets/000/047/917/medium800/led_strips_m0_analog_rgb_bb.png?1509700687)

[Fritzing Source](https://github.com/adafruit/Adafruit_Learning_System_Guides/raw/master/RGB_LED_Strips/m0_analog_rgb.fzz)
 **Note:** Be sure to use PWM output pins from your board!&nbsp; Not all digital inputs/outputs support PWM output.&nbsp; Check your board's guide and pinout to confirm.&nbsp; Typically a PWM-capable output will have a dot or wavy signal line next to it on the board's silkscreen.

**Also be very careful to ensure your board can be powered by 12 volts!&nbsp;** If you're driving your board from the same 12 volt supply as your LED strip you need to make sure you connect the 12 volt power to the appropriate pin on your board so it is properly regulated down to the necessary logic levels&nbsp;for your board.&nbsp; In particular be careful about using a Feather and 12 volt power, there's no Vin line like on Metro/Arduino boards so it's trickier to power them with higher voltage levels like 12 volts and you will **damage the boards**.&nbsp; **Don't power a Feather, Trinket or Gemma from 12V or it can damage the board, use a Metro board instead!**

Now&nbsp;[connect to the board's serial REPL&nbsp;](../../../../micropython-basics-how-to-load-micropython-on-a-board/serial-terminal)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

Import the necessary **pulseio** &nbsp;and **board** modules by running:

```auto
import board
import pwmio
```

Then create a PWM output for each LED connection (red, green, blue):

```auto
red = pwmio.PWMOut(board.D5)
green = pwmio.PWMOut(board.D6)
blue = pwm.PWMOut(board.D3)
```

Like the [analog I/O guide mentions](../../../../circuitpython-basics-analog-inputs-and-outputs/pulse-width-modulation-outputs) you can change the duty cycle of each PWM output to control the brightness of the LEDs.&nbsp; A larger duty cycle means the LEDs are turned on for longer and appear brighter.&nbsp; Remember the duty cycle is a value that goes from 0 (0% / not turned on) to 65535 (100% / turned on all the time).

To set the strip to a purple color with 100% red, 0% green, and 50% blue you could run:

```auto
red.duty_cycle = 65535   # 100% red
green.duty_cycle = 0     # 0% green
blue.duty_cycle = 32767  # 50% blue
```

Like the [analog I/O guide mentions](../../../../circuitpython-basics-analog-inputs-and-outputs/pulse-width-modulation-outputs) though it might be easier to make a function that converts a percent duty cycle value to the numeric value and use that to simplify your code.&nbsp; Here's how to define and use the function to set the same purple color:

```auto
def duty_cycle(percent):
    return int(percent / 100.0 * 65535.0)

red.duty_cycle = duty_cycle(100)  # 100% red
green.duty_cycle = duty_cycle(0)  # 0% green
blue.duty_cycle = duty_cycle(50)  # 50% blue
```

Here's a complete example of using CircuitPython to control the LED strip and fade it between different colors just like with the similar Arduino code from the previous page.&nbsp; Save this as a **code.py** on your board's root filesystem and it will fade the colors of the strip when the board starts:

After you've copied **code.py** over, your **CIRCUITPY** drive should look something like this:

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/RGB_LED_Strips.png )

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/RGB_LED_Strips/code.py


## Featured Products

### Flexible RGB Neon-like LED Strip 120 LEDs - 1 meter long

[Flexible RGB Neon-like LED Strip 120 LEDs - 1 meter long](https://www.adafruit.com/product/4245)
Here at Adafruit we love discovering new and exotic glowing things. Like moths to the flame, we were intrigued by these fresh&nbsp; **Flexible Silicone Neon-Like LED Strips**! They _look_ a lot like neon, but without the need for expensive transformers, glass tubing or inert...

In Stock
[Buy Now](https://www.adafruit.com/product/4245)
[Related Guides to the Product](https://learn.adafruit.com/products/4245/guides)
### RGB LED weatherproof flexi-strip - 30 LED/m - 5m

[RGB LED weatherproof flexi-strip - 30 LED/m - 5m](https://www.adafruit.com/product/285)
These LED strips are fun and glowy. There are **30** RGB LEDs per meter, and you can control the entire strip at once with any microcontroller and three transistors. The way they are wired, you will need a 9-12VDC power supply and then ground the R/G/B pins to turn on the three colors. Use...

In Stock
[Buy Now](https://www.adafruit.com/product/285)
[Related Guides to the Product](https://learn.adafruit.com/products/285/guides)
### RGB LED Weatherproof flexi-strip 60 LED/m- 5m

[RGB LED Weatherproof flexi-strip 60 LED/m- 5m](https://www.adafruit.com/product/346)
These LED strips are fun and glowy. There are **60** RGB LEDs per meter - twice as many as our other strip, and you can control the entire strip at once with any microcontroller and three transistors. The way they are wired, you will need a 9-12VDC power supply and then ground the R/G/B...

In Stock
[Buy Now](https://www.adafruit.com/product/346)
[Related Guides to the Product](https://learn.adafruit.com/products/346/guides)
### Analog RGBW LED Strip - RGB plus Cool White - 60 LED/m

[Analog RGBW LED Strip - RGB plus Cool White - 60 LED/m](https://www.adafruit.com/product/2440)
_A dream come true...an analog&nbsp;LED strip with both RGB and Cool White LEDs...It's so........bbbeeeaaaaauuuttttiiiifuuulllll!!!_

These LED strips are fun and glowy. There are **60** RGB and Cool White LEDs per meter - you can control the entire strip at once with any...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2440)
[Related Guides to the Product](https://learn.adafruit.com/products/2440/guides)
### Analog RGBW LED Strip - RGB plus Warm White - 60 LED/m

[Analog RGBW LED Strip - RGB plus Warm White - 60 LED/m](https://www.adafruit.com/product/2439)
_A dream come true...an analog&nbsp;LED strip with both RGB and Warm White LEDs...It's so........bbbeeeaaaaauuuttttiiiifuuulllll!!!_

These LED strips are fun and glowy. There are **60** RGB and Warm White LEDs per meter - you can control the entire strip at once...

In Stock
[Buy Now](https://www.adafruit.com/product/2439)
[Related Guides to the Product](https://learn.adafruit.com/products/2439/guides)
### Solderless DotStar and Analog RGB LED Strip Clip Sampler

[Solderless DotStar and Analog RGB LED Strip Clip Sampler](https://www.adafruit.com/product/1004)
These ingenious little clips make it easier than ever to use our analog RGB LED strips - no need to solder! The clips snap onto the ends of the LED strip and hold securely. They're not waterproof but you could cover them in heat-shrink to make them weatherproof.  
  
You get one...

In Stock
[Buy Now](https://www.adafruit.com/product/1004)
[Related Guides to the Product](https://learn.adafruit.com/products/1004/guides)
### TIP120 Power Darlington Transistors - 3 pack

[TIP120 Power Darlington Transistors - 3 pack](https://www.adafruit.com/product/976)
Transistors are powerful little electronic switches, and when our little NPN transistors aren't power enough for your project, we have been known to use these beefy TIP120 Darlington transistors. Great for whenever you need to control medium to high-power electronics such as motors,...

In Stock
[Buy Now](https://www.adafruit.com/product/976)
[Related Guides to the Product](https://learn.adafruit.com/products/976/guides)
### Breadboarding wire bundle

[Breadboarding wire bundle](https://www.adafruit.com/product/153)
75 flexible stranded core wires with stiff ends molded on in red, orange, yellow, green, blue, brown, black and white. These are a major improvement over the "box of bent wires" that are sometimes sold with breadboards, and faster than stripping your own solid core wires. Makes...

In Stock
[Buy Now](https://www.adafruit.com/product/153)
[Related Guides to the Product](https://learn.adafruit.com/products/153/guides)

## Related Guides

- [Make it Glow: NeoPixel and LED Diffusion Tips & Tricks](https://learn.adafruit.com/make-it-glow-neopixel-and-led-diffusion-tips-tricks.md)
- [Halloween Skeleton Transformation Illusion Prop](https://learn.adafruit.com/halloween-skeleton-transformation-illusion-prop.md)
- [Holiday Tree with Feather RP2040 Scorpio](https://learn.adafruit.com/holiday-tree-with-scorpio.md)
- [Bandolier of Light](https://learn.adafruit.com/bandolier-of-light.md)
- [Fog Machine with Motion Sensor and Adafruit IO](https://learn.adafruit.com/fog-machine-remote-trigger.md)
- [NeoPixel Bracelet](https://learn.adafruit.com/neopixel-bracelet.md)
- [HalloWing M4 Tombstone](https://learn.adafruit.com/hallowing-tombstone.md)
- [NeoPixel Remote: IR Control with WLED](https://learn.adafruit.com/neopixel-remote-ir-control-with-wled.md)
- [Make It Glow: How to Solder NeoPixels, A Beginner's Guide](https://learn.adafruit.com/make-it-glow-how-to-solder-neopixels-a-beginners-guide.md)
- [LED Tricks: Gamma Correction](https://learn.adafruit.com/led-tricks-gamma-correction.md)
- [Bike Wheel POV Display](https://learn.adafruit.com/bike-wheel-pov-display.md)
- [Pixie CyberWig - A Wearable WiFi LED Visualization ](https://learn.adafruit.com/wifi-pixie-cyberwig-wearable-visualization.md)
- [Digital LED Belt](https://learn.adafruit.com/digital-led-belt.md)
- [Glowing Mirror Mask](https://learn.adafruit.com/glowing-mirror-mask.md)
- [Laser-Cut Layered LED Art Panel (Wood + Acrylic) with WLED](https://learn.adafruit.com/laser-cut-layered-led-art-panel-wood-acrylic-with-wled.md)
