Controlling RGB strips with Arduino
Controlling RGB strips with Arduino
Controlling RGB strips with Arduino
Controlling RGB strips with Arduino

READ TIME

READ TIME

4 min

4 min

4 min

POSTED ON

POSTED ON

Mar 9, 2020

Mar 9, 2020

Mar 9, 2020

AUTHOR

AUTHOR

Lalithkumar Rameshkumar

Lalithkumar Rameshkumar

Lalithkumar Rameshkumar

SHARE

SHARE

RGB strips

RGB strips
RGB strips
RGB strips
RGB strips

The RGB (Red Green Blue) LED can be controlled using Arduino programming also we can bring the varies colors in a single strip.

Today, I want to show you how you too can control that powerful little LED in your own and make your place as smarter.

Incandescent light bulbs are slowly becoming a thing of the past with LEDs kicking in, especially RGB LEDs. So, why not learn how to control your RGB LEDs the way you want?

Our RGB and multi-color LED strip light allows customers to have full control over the color of their lighting. With three or more LEDs on each node, users can seamlessly blend colors to achieve the perfect hue. … Use your imagination and choose your desired color to set the mood

What is a light strip?

An LED strip light (also known as an LED tape or ribbon light) is a flexible circuit board populated by surface mounted light-emitting diodes (SMD LEDs) and other components that usually comes with an adhesive backing.

What is RGB color value?

Circuit Diagram for connecting RGB strip with Arduino UNO
Circuit Diagram for connecting RGB strip with Arduino UNO
Circuit Diagram for connecting RGB strip with Arduino UNO
Circuit Diagram for connecting RGB strip with Arduino UNO

A color’s RGB value indicates its red, green, and blue intensity. Each intensity value is on a scale of 0 to 255, or in hexadecimal from 00 to FF. RGB values are used in HTML, XHTML, CSS, and other web standards.


Install FastLED library from Arduino Library Manager


#include "FastLED.h"
#define NUM_LEDS 60
#define DATA_PIN 6
CRGB leds[NUM_LEDS];
void setup() {
 FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
}
void loop() {
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(0, 255, 0);
 FastLED.show();
 delay(5);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(255, 0, 0);
 FastLED.show();
 delay(5);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(0, 0, 255);
 FastLED.show();
 delay(5);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(51, 0, 102);
 FastLED.show();
 delay(5);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(245, 30, 30);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(55, 255, 0);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(0, 102, 51);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(250, 0, 190);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(55, 255, 10);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(0, 243, 122);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(255, 0, 255);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(122, 106, 0);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(135, 255, 12);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
 for (int i = 0; i < NUM_LEDS; i++) {
 leds[i] = CRGB(255, 255, 255);
 FastLED.show();
 delay(15);
 leds[i] = CRGB(0, 0, 0);
 FastLED.show();
 }
}


When the circuit get completed compile and run the program in a circuit

Color codes for controlling RGB LED to various colors

Color codes
Color codes
Color codes
Color codes

These are some of the color code for controlling RGB led to bring various color, you can use these values and change the color code as your convenience.