Introduction: Bluetooth Controlled LED

Picture of Bluetooth Controlled LED

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:

Picture of 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:

Picture of 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:

Picture of 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:

Picture of 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.

Comments

Veda88 (author)2017-06-29

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

AlinG14 (author)Veda882017-12-05

right. we need the source :)

vmars316 (author)2017-08-19

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

About This Instructable

931views

32favorites

License:

Bio: 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 ... More »
More by callmeappytechie:PIR Controlled Buzzer Using ArduinoDIY LampshadeTasty Egg Bonda
Add instructable to: