LED, Buzzer Control Using Bluetooth Module and Arduino

Published

Introduction: LED, Buzzer Control Using Bluetooth Module and Arduino

About: I'm Harshith. Electronics enthusiastic and traveller.

In this simple(basic) project one can learn interfacing Bluetooth with Arduino. Control your LEDs and buzzer using an app installed in smartphone. By sending data ( character "a" in our case) LEDs will glow and buzzer will sound.

Step 1: All You Need Is-

Arduino Uno(or clone),
Three Leds,
A Buzzer,
Bluetooth module(HC05,06..),
resistors 1k ohm - 3 numbers,
Jumper wires,
A 9v battery if needed,
A smart phone with Bluetooth terminal app.

Step 2: Testing Bluetooth Module

Connect +5V of HC05 to 3.3V,Rx of module to Tx of Arduino and Tx of module to Rx of Arduino. Ground the gnd pin. After connecting these pins, power the Arduino. Blinking of LED in Bluetooth module ensures working status.

Step 3: Connection

Connect the LED 1 to pin 13 through a resistor(1k),LED 2 to pin 8 through a resistor(1k),LED 3 to pin 7 through a resistor(1k) and ground the other(shorter edge). Positive end of Buzzer is connected to pin 4 and another pin is grounded.
Connection of Bluetooth module:
Connect +5V of HC05 to 3.3V,Rx of module to Tx of Arduino and Tx of module to Rx of Arduino. Ground the gnd pin.

Step 4: Coding

char cache;
String inputString="";
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(8,OUTPUT);
pinMode(7,OUTPUT);
pinMode(4,OUTPUT);
}
void loop()
{
if(Serial.available())
{
while(Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
}
Serial.printIn(inputString);
while (Serial.available()>0)
{
cache = Serial.read();
}
if(inputString == "a")
{
digitalWrite(13,HIGH);
digitalWrite(8,HIGH);
digitalWrite(7,HIGH);
digitalWrite(4,HIGH);
}
else if(inputString == "b")
{
digitalWrite(13,LOW);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(4,LOW);
}
inputString = "";
}
}


Follow the link to attach the code:

https://drive.google.com/file/d/0B7TrJQkVvDbAYjhnU21PalNRSlU/view?usp=drivesdk

Follow the link to view in PDF format:

https://drive.google.com/file/d/0B7TrJQkVvDbAaE9lY3FpMEtRTXM/view?usp=drivesdk

Step 5: Handling It With Smartphone

Download Bluetooth terminal app from Google playstore. It is available for free. On opening connect your smartphone with hc05 through Bluetooth. Now send the data to the Arduino. Data in our case is character "a"and character "b". Sending "a" will blink the three LEDs and will sound the buzzer. By sending"b" all the above action stops.

Share

    Recommendations

    • Make it Move Contest

      Make it Move Contest
    • Casting Contest

      Casting Contest
    • Planter Challenge

      Planter Challenge
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    0

    Anyway you can upload a schematic?

    4 Comments