Bluetooth Controlled LED

1,846

35

5

Introduction: Bluetooth Controlled LED

About: I am an electronic hobbyist on Arduino, Photon, Raspberry Pi and common electronics.A passionate cook.Any assistance in electronics and web development feel free to contact me at appytechie.at@gmail.com.

Hi, I'm Sridhar Janardhan back with another tutorial today I am going to teach you wireless electronics.To be precised I am going to show how to control a led using HC-05 Bluetooth module.Bluetooth module is a wireless technique used to send data from receiver to transmitter wirelessly.So let's get started by building the Circuit before that let's collect the required components.

Note: If you have missed my previous Ibles please click here

Step 1: Collecting Components:

The components are:

  • Arduino Uno
  • HC_05 Bluetooth module
  • LED of different color
  • Jumper wire
  • Breadboard

Now, After collecting the electronics let's start implementing it.

Step 2: Interfacing HC-05 Bluetooth Module:

The HC-05 Bluetooth module has generally four pins:

  • TX pin - Transmitting pin which is used to transmit the data to the reciever
  • RX pin - the pin that recieves data from reciever.
  • VCC pin - the power supply pin
  • GND pin - The power supply pin

The connection or interfacing of the module is as follows:

  • TX pin to the digital pin 0 (RX pin of arduino)
  • RX pin to the digital pin 1 (TX pin of arduino)
  • VCC pin to the Positive railings of the breadboard
  • GND pin to the negative railings of the breadboard

Now let's get into the final Interfacing of LED

Step 3: LED Interfacing:

The LED usually have two terminal varying in their size:

  • The longer leg which is called as positive or Anode
  • The shorter leg which is called as negative or cathode

Interfacing LED1:

  • The shorter leg to the negative railings of the breadboard.
  • The longer leg to the Digital pin 10.

Interfacing LED2:

  • The shorter leg to the negative railings of the breadboard.
  • The longer leg to the Digital pin 11.

Interfacing LED3:

  • The shorter leg to the negative railings of the breadboard .
  • The longer leg to the Digital pin 12.

Now let's get into coding.

Step 4: Coding:

int ledB = 13;

int ledG = 12;

int ledR = 11; int state;

void setup() {

pinMode(ledG, OUTPUT);

pinMode(ledB, OUTPUT);

pinMode(ledR, OUTPUT);

Serial.begin(9600);

}

void loop() {

if(Serial.available() > 0){

state = Serial.read();

}

if (state == '1') {

digitalWrite(ledG, HIGH);}

else if (state == '2') {

digitalWrite(ledG, LOW);}

else if (state == '3') {

digitalWrite(ledB, HIGH);}

else if (state == '4') {

digitalWrite(ledB, LOW);}

else if (state == '5') {

digitalWrite(ledR, HIGH);}

else if (state == '6') {

digitalWrite(ledR, LOW);}

delay(100);

Serial.println(state);

}

Step 5: Bluetooth Application :-

The app is made of using MIT app inventor that represents three bulbs indicating three LEDs.So the bulbs are toggle behavior and press them to turn them on and again press for turning it off.The apk for the app is attached in the document below.

If any peeps find difficulty in following the please leave a comment below, I can improve my future ibles.

Thank You.

Makerspace Contest 2017

Participated in the
Makerspace Contest 2017

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

    5 Discussions

    0
    Lalit janwa
    Lalit janwa

    2 years ago

    There is a problem of troubleshooting..

    0
    Usman M
    Usman M

    3 years ago

    Nice project.

    Can we use Nodemcu instead of

    Arduino Uno? If yes, what changes are required?

    0
    Veda88
    Veda88

    3 years ago

    Could you maybe also post the sources of the apk file?

    0
    AlinG14
    AlinG14

    Reply 3 years ago

    right. we need the source :)

    0
    vmars316
    vmars316

    3 years ago

    Hello & Thanks,

    <<The app is made of using MIT app inventor that represents three bulbs indicating three LEDs.>>

    I have no idea what the above means . Also *.apk ?

    Are you using a smartphone [windows/android] ?

    I have an idea for a project, it seems to me related to yours

    (no smartphone needed) :

    Guitar pickup (probably needs some sort of amplifier)

    sends 1-6 bluetooth signals

    depending on which guitarString is struck.

    (Arduino?) picks up signal

    and 'blinks on' 1 or more colored LEDs (corresponding to Strings 1 thru 6) .

    Is this something you could Tutorial ?

    Thanks...Vern