RGB LED Strip Lights Control using Arduino

In this project, we are going to make an RGB LED Strip Lights Control using Arduino platforms. Smart bulbs have been increasing in the market. Nowadays the Mi lanches there smart bulb. So that I decided to make a smart led wall for my room. I just planned my projects design and also its features.

Mainly I focused in remote control access like to control color in my mobile phone.There are two types of controls are there

  • Analog
  • Digital

For an analogue control, we use Variable resistor or Potentiometer. In digital control, PWM signal will help.PWM signal can able to make a Timer circuit. But in this circuit, I need to control light using my mobile phone. So that I need to find a good microcontroller. Without any doubts, I started to working ATMEGA328 with help of Arduino IDE. Because the Arduino is an open-source platform with a lot of tutorial and Libraries.

The RGB Led strips are very cheap and also easy to control via microcontroller.A normal led strip have 4 pins,To varying the voltage of these pins which changes the colour to the leds.We are going to control this led pin voltage with the help of the microcontroller.

In Microcontroller, a Bluetooth Module (HC-05) is used to receive data from the Mobile Phone. The HC-05 Bluetooth Module have 4 pins, VCC, GND, Tx and Rx Pins. It would be connected with the help of the jumper wires.

There is only few componets are used.so that the soldering and connection are simple.

The Working of Led is very simple and also they easy compactable with a microcontroller. Here we use a power NPN or N-Channel MOSFET for the controlling of voltage to each terminal. The selection of MOSFET will vary according to the length of the LED strip

Circuit Diagram:

Program:

The Program of the RGB LED Strip Lights Control using Arduino is coded by Arduino IDE

char color=0;
 //define the RGB pind
int red = 11;
int green = 10;
int blue = 9;

void setup()  { 
  Serial.begin(9600);     //Start the serial comunication for the bluetooth module
  pinMode(red, OUTPUT);   //Red color pwm pin defined as output
  pinMode(green, OUTPUT); //Green color pwm pin defined as output
  pinMode(blue, OUTPUT);  //Blue color pwm pin defined as output
  
  //Give first value of the PWM 0, we start with the RGB LEDs off
  analogWrite(red,0);
  analogWrite(green,0);
  analogWrite(blue,0);

 } 
void loop()  { 
  
  if(Serial.available()>0){
    // read the bluetoot data and store it
    color = Serial.read();
    char Rec = char(color);
    if (Rec != '0')
    {
    Serial.println(Rec); //This is to visualise the received character on the serial monitor
    }  
  }
   //LEDs off
  if (color == 'n')
  {
    analogWrite(red,0);
    analogWrite(green,0);
    analogWrite(blue,0);
  }
  //White
  if (color == 'w')
  {
    analogWrite(red,255);
    analogWrite(green,255);
    analogWrite(blue,255);
  }
  //Red
  if (color == 'r')
  {
    analogWrite(red,255);
    analogWrite(green,0);
    analogWrite(blue,0);
  }
  //Green
  if (color == 'g')
  {
    analogWrite(red,0);
    analogWrite(green,255);
    analogWrite(blue,0);
  }
  //Blue
  if (color == 'b')
  {
    analogWrite(red,0);
    analogWrite(green,0);
    analogWrite(blue,255);
  }
  //Orange
  if (color == 'o')
  {
    analogWrite(red,255);
    analogWrite(green,153);
    analogWrite(blue,0);
  }
  //Violet
  if (color == 'p')
  {
    analogWrite(red,102);
    analogWrite(green,0);
    analogWrite(blue,153);
  }
  //Cyan
  if (color == 'c')
  {
    analogWrite(red,0);
    analogWrite(green,255);
    analogWrite(blue,255);
  }
  //Yellow 
  if (color == 'y')
  {
    analogWrite(red,255);
    analogWrite(green,204);
    analogWrite(blue,0);
  }  
}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

മലയാളം