Electronics Champ
Published © GPL3+

RGB LED Light with HC 05 Bluetooth Module and Arduino

This project shows how to control an RGB SMD LED with HC-05 Bluetooth Module and Arduino

BeginnerFull instructions provided2,026
RGB LED Light with HC 05 Bluetooth Module and Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor 2
MIT App Inventor 2

Story

Read more

Schematics

Schematic

Code

Code

Arduino
/*
  This program reads the the data received
  by the HC-05 Bluetooth Module from the Android
  app and writes the specific values to the RGB
  LED. This creates different colors on the LED.
 
  This program is made by Shreyas for
  Electronics Champ YouTube Channel.
  Please subscribe to this channel
  Thank You
*/
 
//Including the library
#include <SoftwareSerial.h>
 
//Creating a SoftwareSerial object
SoftwareSerial HC05(3, 4);
 
//Initialize the variables
String data = "";
int red;
int green;
int blue;
 
void setup() {
 
  //Start Serial Communication
  Serial.begin(9600);
  HC05.begin(9600);
 
  //Assign modes to the specific pins
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
 
}
 
void loop() {
 
  //If HC-05 has received data...
  if (HC05.available()){
 
    //Reads the data
    data = HC05.readString();
 
    //Gets the value of each color
    red = data.substring(0, 3).toInt();
    green = data.substring(3, 6).toInt();
    blue = data.substring(6, 9).toInt();
 
    //Writes the values to the specific pins
    analogWrite(A0, red);
    analogWrite(A1, green);
    analogWrite(A2, blue);
    
  }
 
}

Credits

Electronics Champ
4 projects • 11 followers
Projects based on breadboard electronics and Arduino with clear step-by-step instructions, circuit diagrams, schematics, and source code.
Contact

Comments

Please log in or sign up to comment.