Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Tech Terms
    • Webinars & Digital Events
  • Resources
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • White Papers
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Arduino-based RGB LED strip controller

By Ashutosh Bhatt March 3, 2021

RGB LED strips are nowadays used everywhere in decorative lighting. They are used in different functions like birthday celebrations, marriage, reception, parties, etc. They are also used for decoration in festivals like DIWALI, CHRISTMAS, etc. Even modern houses, luxurious flats, restaurants, and hotels use RGB LED strips for illumination and decoration. The decoration using these RGB LED strips serves as “cheery on a cake” for every occasion or festival.

There are two types of RGB LED strips available in the market:

  1. RGB strip with addressable RGB LEDs: these types of RGB strips have only three wires for connections (1) +12 V (2) Gnd and (3) DI-Data input
  2. RGB strip with separate R, G, B inputs: these types of RGB strips have three separate inputs for Red, Green, and Blue colors with one more common input as +12V. So such strips have 4 connections (1) +12 V (2) R – for Red LED (3) G – for Green LED (4) B – for Blue LED

These RGB LED strips can generate almost all the colors and their shades using different combinations of RED – GREEN – BLUE.

Even they can generate different “eye-catching” illuminating effects like multicolor, rainbow, LED chaser, fading, etc.

I bet you all might have seen somewhere the “jaw opening” multicolor led chasing, fading, and animation effect.

Yes or no?

All these are possible using such RGB LED strips.

So do you want to build something like this? Like a multicolor LED chaser, fading, and other animation effects using multicolor LEDs?

What if I say all these you can do with our ARDUINO? Sounds interesting…….?!?!!!???

Yes. You can do all these and play with such RGB strips using ARDUINO, and it’s very easy and simple. So let us start.

  1. Before directly jumping to the LED strip, first, let us understand the single-cell – the building block of the strip – and that is one RGB LED SMD type

RGB SMD LED

As you can see in the above figure, a single RGB SMD LED is a combination of 3 tiny individual RED, GREEN, and BLUE LEDs. It has 6 terminals. Three terminals are for RED (2), GREEN (4), and BLUE (6) LEDs, while the other 3 terminals are common terminals.

This common terminal can be either anode or cathode, and based on it, there are two types of such LEDs (1) common cathode and (2) common anode. Please have a look at the figure given below.

It is understood that to turn on any LED in common cathode type RGB SMD LED, we have to apply +Ve supply to R, B, or G terminal, and the common terminal is connected to the ground. While in common anode SMD RGB LED, common terminal is connected with +Ve supply and R, G or B terminal has to be connected to ground.

Now you all might be thinking that there are only 3 LEDs in this, and we can have only 3 colors RED, GREEN, and BLUE. What about other colors? How can we get (generate) all colors from RGB LED?

So here is the logic to generate other colors.

If we turn on two LEDs together, then we have 3 more colors.

RED + GREEN = YELLOW

RED + BLUE = MAGENTA

GREEN+BLUE = CYAN

And if we turn ON all 3 LEDs together, then? Yes, it’s a white color.

But still, 3 + 3 + 1 = 7 colours! What about more colors like PINK, ORANGE, SKYBLUE, LIGHTGREEN, etc.?

To generate other colors, we have to vary the amount of RED, GREEN, and BLUE color because we know the mixing of these three basic colors in different amounts will generate all colors.

So next question is how to vary the amount of these three colors? (It is possible in painting as we can change their amount or dilute them, but here it is not so!)

Here, in our case – the color amount is color intensity – which means the brightness of RED/GREEN/BLUE LED. To generate different colors from RGB LED, we have to vary the intensity (brightness) of RED/GREEN/BLUE LED.

Now, is the picture clear? Got the idea?

To generate different colors in RGB LED, we are going to vary the brightness of RED, GREEN, and BLUE LEDs from 0 to 100%

And we know Arduino can easily vary the brightness of LED! So that’s it……

Arduino has an analog output (PWM output) that will vary LED brightness. Its 3 analog outputs are connected with R, G, and B terminals and change all three LEDs’ brightness.

This much is enough to give you a complete idea. Now let us see how we can control the RGB LED strip using Arduino.

Circuit diagram

As shown in the figure, the RGB LED strip contains 100 to 120 SMD LEDs. And it requires only two components, Arduino NANO and the current driver chip ULN2003A. The analog outputs D9, D10, and D11 drive G, R, and B inputs of the strip through the current driver chip. The ULN2003A chip is required to provide the required current to the LED strip. The LED strip is a common anode type, so its common terminal is given a +12 V supply. The same 12 V supply is given to the Arduino NANO board and ULN chip also.

Circuit operation

The circuit operation is very simple. The Arduino varies the brightness of all the RGB LEDs by applying PWM output through its D9, D10, and D11 pins. As the PWM output gives 0 to 5 V output, LED brightness varies from 0 to 100% – which means varies the amount of that color from 0 to 100%. See the following table for how different colors are generated by varying LED brightness (color amount)

Software program


We have seen a simple RGB LED strip with individual R, G, and B inputs.

Now let us see another type of RGB LED strip with addressable LEDs. In this strip, also same RGB SMD LED is used as a single cell. Still, it has an inbuilt microcontroller that takes direct data from the host microcontroller (Arduino in our case), illuminates the entire strip, generates different colors, generates chasing and fading effects, etc. In such a strip, it is possible to get a different color of each LED (That was not possible in the previous type. We can get only one color in an entire strip)

So controlling this strip using Arduino will become more interesting.

Getting excited!?!…..

Hold on for a while. Because to program Arduino to control such strip, you need to download its library. But that is on the programming side. Let us first see the circuit diagram and its operation.

Circuit diagram

As you all can see, the circuit diagram has become simpler. Now there is no need for the current driver chip. Any digital output pin of Arduino can be directly connected to the LED strip’s DIN (Data Input) pin.

  • These LED strips have 3 wire interface (1) 12 V (2) Gnd and (3) DIN
  • DIN pin is connected with D13 pin of Arduino directly
  • Both Arduino and Strip are given 12 V supply from an adapter (12 V @ 2A)

Circuit operation

As the name suggests, it’s an addressable RGB LED strip – which means all the LEDs have an address. We can turn ON/OFF LEDs, set their color, and vary their brightness by sending data to that address. That means we can set the color and brightness of any individual LED.  Actually, we cannot control a single LED but a set of 3 LEDs because one address is assigned to a set of 3 LEDs (in other words, we can say, in such LED strip single-cell consist of 3 SMD RGB LEDs)

So now, it’s time to prepare your Arduino IDE software to make a program for an addressable RGB LED strip.

  1. You have to download the “FastLED” library from the internet.
  2. Search for “FastLED library for Arduino” and you can find it easily on Github (or somewhere else)
  3. Download FastLED zip folder into your Arduino folder (like C:\arduino-1.6.7\libraries)
  4. Go to your Arduino IDE software, and from the “sketch” menu, go to sketch->include library->add zip library.
  5. Select the FastLED ZIP folder, and it’s done!

Here I am giving you some sample programs. Try it, test it, modify it and have FUN (isn’t it like “LEARN with FUN”?).

You can also try example programs given along with the library from File->Example->FastLED->…..

In the next article of this series, we shall learn how to operate these RGB Strip using any IR remote and Arduino.

Program 1


Program 2


Program 3


You may also like:


  • Generating Different Colours from RGB LED using Arduino PWM

  • LED chaser using AVR ATMega16

  • How to build an IR remote-operated RGB LED strip using…

Filed Under: Arduino Projects, Microcontroller Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

Log in to leave a comment:

Lost your password?

Don't have an account? Register here

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Wide Bandgap Semiconductors
Moving from silicon to GaN or SiC feels like a whole new ballgame, doesn’t it? It isn’t just about faster switching; it’s about managing the layout parasitics and thermal realities that come with that speed. This month’s Tech Toolbox features a curated eBook that tackles these design hurdles head-on.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions.

RSS Electro-Tech-Online.com Discussions

Featured Tutorials

Learn - AWS IoT Tutorials

  • Arduino compatible coding 03: Basics of Arduino sketches and Embedded C
    Arduino compatible coding 03: Basics of Arduino sketches and Embedded C
  • Arduino compatible coding 04: Interfacing and driving LED by digital output
    Arduino compatible coding 04: Interfacing and driving LED by digital output
  • Arduino compatible coding 05: Interfacing buttons for digital input
    Arduino compatible coding 05: Interfacing buttons for digital input
  • Arduino compatible coding 06: Analog output (PWM) on Arduino and LED fading
    Arduino compatible coding 06: Analog output (PWM) on Arduino and LED fading
  • Introduction to batteries and their types
    Introduction to batteries and their types
  • Controlling IoT Devices through Emails over IMAP Protocol – IOT Part 48
    Controlling IoT Devices through Emails over IMAP Protocol – IOT Part 48
More Tutorials >

Recent Articles

  • Understanding the different types of AI
  • Bourns adds 0402 TVS diodes for surge protection
  • Acromag releases 6U VMEbus SBC
  • Bourns adds LTCC diplexer for GNSS front ends
  • Raltron expands SAW filters for GPS and Wi-Fi

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Tech Terms
    • Webinars & Digital Events
  • Resources
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • White Papers
  • Guest Post Guidelines
  • Advertise
  • Subscribe