How to make a Bluetooth voice control Home Automation project with DEVKIT V1 ESP32 board

Hello and welcome back. In this project, we will learn how to make a Bluetooth voice control Home Automation project with the DEVKIT V1 ESP32 board. For that, I have used the built-in Bluetooth technology on this board. Therefore, we don’t need an additional Bluetooth module for that. That’s a good point for us.

Also, in this project, I have used the Bluetooth voice control remote provided on the SriTu Hobby app. Therefore, we can control home appliances using our voice. I used the one-channel relay module for the example. But you can extend it as you like. In this project, I connected a 230VAC bulb to the relay module and you can try it out if you want. Especially, you must be careful with using AC voltage. Also, please select the correct relays matching your project. Ex-: Ampere value

OK, let’s do this project step by step. The required components are given below.

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Secondly, place the ESP32 board on the breadboard. And then, connect it to the computer.

Step 3

Thirdly, copy and paste the following program into the Arduino IDE.

  • Program and circuit diagram — Download

//Include the library file
#include "BluetoothSerial.h"

BluetoothSerial SerialBT;
#define relay 2 // Relay pin
#define buzzer 4 // Buzzer pin

void setup() {
  Serial.begin(115200);
  SerialBT.begin("SriTu Hobby"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");

  pinMode(relay, OUTPUT);
  pinMode(buzzer, OUTPUT);
  digitalWrite(relay, HIGH);
}
void loop() {
  if (SerialBT.available()) {
    String value = SerialBT.readString();
    Serial.println(value);
    if (value == "turn on the bulb") {
      digitalWrite(relay, LOW);
      Serial.println("on");
    } else if (value == "turn off the bulb") {
      digitalWrite(relay, HIGH);
      Serial.println("off");
    } else {
      digitalWrite(buzzer, HIGH);
      delay(100);
      digitalWrite(buzzer, LOW);
      delay(100);
      digitalWrite(buzzer, HIGH);
      delay(100);
      digitalWrite(buzzer, LOW);
      delay(100);
      digitalWrite(buzzer, HIGH);
      delay(100);
      digitalWrite(buzzer, LOW);
      delay(100);
    }
  }
}

  • Now, select board and port. And then, click the upload button.
  • When the following message is displayed, press and hold the boot button for two or three seconds.

Step 4

OK, now remove the USB cable. And then, connect the relay module and buzzer to the ESP32 board. For that, use the circuit diagram below.

Step 5

Now, let’s connect the AC bulb holder to the Relay module. If you don’t need this. Please skip this step. Use the circuit diagram above for that.

  • Next, connect the plug top to the ends of the wires. It is safe when working with AC voltage. Then, put the bulb into the bulb holder.

Step 6

Now, provide an AC voltage using the plug top. And then, connect the 5V power supply to the ESP32 board. For that, I used a USB cable.

Step 7

Finally, let’s set up the Bluetooth Voice Control app. Follow the below steps for that.

  • First, download and install the SriTu Hobby app from the play store.
  • SriTu Hobby app — Download
  • Next, open this app and click the control button. And then, select the voice control remote and click the gear wheel icon.
  • Next, click the “Find Device” button and select your device. In this case, location and location permission should be enabled. Then, we can see the green indicator.

Step 8

Now, click the mic icon button and say “Turn on bulb” / “Turn off bulb”. You can change these keywords as you like. For that, see the code.

    if (value == "turn on the bulb") {
      digitalWrite(relay, LOW);
      Serial.println("on");
    } else if (value == "turn off the bulb") {
      digitalWrite(relay, HIGH);
      Serial.println("off");
    }

How to make a Bluetooth voice control Home Automation project with DEVKIT V1 ESP32 board

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Select your currency
USD United States (US) dollar
EUR Euro
Scroll to Top