Bluetooth Project : Voice Controlled Led

by Ameya Angadi in Circuits > Arduino

63 Views, 1 Favorites, 0 Comments

Bluetooth Project : Voice Controlled Led

Voice Controlled LED Instructables.png

Turn Your Voice into Magic: Control LEDs with Simple Voice Commands!

Ever wanted to feel like a wizard, controlling lights with just a word? With this Bluetooth Project, you can do just that! This exciting and straight forward tutorial will show you how to control an LED using voice commands, all thanks to the HC-05 Bluetooth module and Arduino Uno.


Why This Project is a Must-Try:

  1. Beginner-Friendly: Perfect for newcomers to Arduino and Bluetooth technology.
  2. Gain practical knowledge of how to work with the HC-05 Bluetooth module.
  3. Endless Applications: Use this as a foundation for more complex voice-controlled projects.

Supplies

  1. Arduino Uno R3 x 1
  2. HC-05 Bluetooth Module x 1
  3. LED x 1
  4. Resistor (220 Ohms)
  5. Male-Female Jumper Wires x 4

Connect Your Hardware

Circuit Diagram.png

Follow the simple wiring diagram:

  1. Connect the HC-05 to the Arduino (TX to RX, RX to TX, VCC to 5V, GND to GND).
  2. Connect the LED to a digital pin (pin 13) with a 220 Ohms resistor in series.

Upload the Code

Use the Arduino IDE to upload the sketch to your Arduino.

NOTE - It is advised that Bluetooth module should be attached to Arduino board after uploading code to avoid errors and prevent possible damage to Bluetooth module.


Code -

/*CONTROLLING A LED WITH ARDUINO AND BLUETOOTH MODULE [HC-05]
THIS CODE DEMONSTRATES CONTROLLING A LED WITH VOICE COMMANDS [GIVEN FROM A MOBILE PHONE].
>> CONNECTIONS [LED TO ARDUINO]:
|------------|-----------|
| LED | ARDUINO |
|------------+-----------|
|1)POSITIVE | PIN 13 |
|------------+-----------|
|2)NEGATIVE | GND |
|------------|-----------|

>> CONNECTIONS [HC-05 TO ARDUINO]:
|------------|-----------|
| HC-05 | ARDUINO |
|------------+-----------|
|1)POSITIVE | +5V |
|------------+-----------|
|2)NEGATIVE | GND |
|------------+-----------|
|3)RX | TX |
|------------+-----------|
|4)TX | RX |
|------------|-----------|

NOTE-IT IS ADVISED THAT BLUETOOTH MODULE SHOULD BE ATTACHED TO ARDUINO BOARD AFTER
UPLOADING CODE TO AVOID ERRORS AND PREVENT POSSIBLE DAMAGE TO BLUETOOTH MODULE.

CODE CREATED BY - AMEYA ANGADI
LAST MODIFIED ON - 24/7/2021
*/

char input; //VARIABLE TO STORE INPUT.
int led1 = 13; //DECLARING "led1" PIN FOR A LED.

void setup() {
Serial.begin(9600); //STARTS SERIAL MONITOR AT 9600 BAUD RATE.
pinMode(led1, OUTPUT); //DEFINING "led1" AS A OUTPUT.
}

void loop() {
if ( Serial.available())
{
input = Serial.read(); //READS THE DATA AND STORES IT AS A VARIABLE.
Serial.println(input); //PRINTS THE INPUT.
}

if (input == 'X') //CHECKS WHETER THE RECIEVED VALUE IS EQUAL TO 'X'.
digitalWrite(led1, HIGH); //IF VALUE IS EQUAL TO 'X' THEN ARDUINO BOARD SETS "led1" TO HIGH.
else if (input == 'Y') //CHECKS WHETER THE RECIEVED VALUE IS EQUAL TO 'Y'.
digitalWrite(led1, LOW); //IF VALUE IS EQUAL TO 'Y' THEN ARDUINO BOARD SETS "led1" TO LOW.

delay(100);
}


Download the attached code file.

Pair and Control

Open the Arduino Bluetooth Control App (Link) on your smartphone, pair it with the HC-05 module. Follow the instructions in the video in the next step to setup the voice control.


Default name for Bluetooth module is " HC-05 ".

Default password for Bluetooth module is " 0000 " or " 1234 ".

Watch the Video:

ARDUINO PROJECT: VOICE CONTROLLED LED WITH HC-05

For step-by-step instructions, check out the above YouTube video and follow along as we bring this voice-controlled LED project to life!


Ready to Get Started?

This project is not just educational but also a lot of fun. You'll learn about Bluetooth communication, voice recognition, and Arduino programming, all while creating something you can show off to your friends. So, what are you waiting for? Dive in and bring your voice-controlled LED project to life!


If you want to explore more, check out my profile for related projects, and don’t forget to follow me for updates on new tutorials and advanced projects!