How to Control an RGB LED Strip - Arduino Tutorial

44,160

176

8

Introduction: How to Control an RGB LED Strip - Arduino Tutorial

About: Arduino Tutorials by Codebender.cc Team

In this tutorial we will use one strip with 8 RGB LEDs with the Arduino uno board. We will use the Adafruit's NeoPixel library to change the color of each led.

Let's get started!

Step 1: What You Will Need

For this project you will need:

  • Arduino uno
  • RGB LED strip
  • 3 breadboard cables

Step 2: The Circuit

The connections are pretty easy, see the above image with the breadboard circuit schematic.

Step 3: The Code

Here's the code, embedded using Codebender!

Try downloading the Codebender plugin and clicking on the "Run on Arduino" button to program your Arduino board with this sketch. And that's it, you've programmed your Arduino with this sketch!

Press the "Edit" button and:

  • change the color of LEDs at lines 16 to 18
  • change the brightness of LEDs at line 23 "pixels.setBrightness(value 0-100);"
  • change the delay time at line 32

Step 4: Well Done!

You have successfully completed one more "How to" tutorial and you learned how to use an RGB LED strip with Arduino!

I hope you liked this, let me know in the comments.

There will be more of them, so make sure to click Follow button!

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    8 Discussions

    0
    JasperD23
    JasperD23

    Question 2 years ago

    can you let light one led at the time so like you light only led number 3?

    0
    elis_204
    elis_204

    3 years ago

    I was able to make this, and it was easy. However, I have to pair it with a uv sensor. How do I set the LED stick for output? Thanks!

    0
    ThomasVDD
    ThomasVDD

    4 years ago

    Nice overview. Just be careful that you don't connect a second strip. It would draw too much current (arduino is rated at 200 mA). This could easily be solved with an external powersupply. Maybe mention this in the instructable, we don't want fried arduinos ;)

    0
    headslant
    headslant

    Reply 4 years ago

    I think 200 ma is the max for the GPI/O pins. USB ports can generally provide 500ma of power which would be used by the LEDS. It appears as if the LEDs are powered by the 5 volts, and are controlled by a GPI/O pin, meaning that there isn't a significant load on the GPI/O pin. If you power the Arduino from another source (barrel jack, or VIN pin), you can source 1-2 amps.

    0
    TanveerM2
    TanveerM2

    4 years ago

    Guys If want to buy some electronics stuff then visit this fb page https://www.facebook.com/hamzaelectronics12?_rdr

    0
    TanveerM2
    TanveerM2

    Reply 4 years ago

    to much low price

    0
    sanjaykray
    sanjaykray

    4 years ago

    I'm using 30rgb LEDs (ws2812b) in a strip and the uno is doing quite well for last six months or so.

    0
    ThomasVDD
    ThomasVDD

    Reply 4 years ago

    This highly depends on how you provide power: via usb from a pc, usb from battery bank or wall power, via Vin pin or via the power plug. Just be careful.