How to make a Voice-Controlled Room Light with ESP32 DEVKIT V1 and Bluetooth | Step by step Guide

Hello and welcome back. In this project, we will learn how to make a voice-controlled room lighting system using the ESP32 DEVKIT V1 board. We have used the Bluetooth technology built into the ESP32 for communication. For testing, I used an AC(Alternating Current) light bulb, but you can choose any type of bulb you prefer.
I used the SriTu Hobby Bluetooth control app to manage the light. To simplify the assembly, I designed a custom PCB with JLCPCB. Therefore, we can assemble this project easily. The circuit includes a 3V 10A relay module, which can control both AC and DC devices. It’s important to ensure that the current doesn’t exceed 10 amps to avoid damage. This project is most suitable for controlling your room light with voice commands while you’re in bed. You can use phrases like “turn on the bulb” or “turn off the bulb” to operate the light. You can change the voice commands as you like.
- What is the ESP32 board and how to use it step by step – click on me.
Ok, let’s do this project step by step. The required components are given below.
- ESP32 board x 1 — Our store / Amazon
- 3v Relay x 1 — Our store / Amazon
- Female header x 1 — Our store / Amazon
- Three-pin terminal x 1 — Our store / Amazon
- DC barrel jack x 1 — Our store / Amazon
- 5v Buzzer x 1 — Our store / Amazon
- 102 SMD Resistor x 3 — Our store / Amazon
- 2A Transistor x 1 — Our store / Amazon
- 1N4148 diode x 1 — Our store / Amazon
- Red SMD LED x 1 — Our store / Amazon
- Green SMD LED x 1 — Our store / Amazon
- 9v Battery x 1 — Our store / Amazon
- 9v Battery clip x 1 — Our store / Amazon
- Bulb holder x 1 — Our store / Amazon
- Bulb x 1 — Our store / Amazon
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, let’s order PCBs for this project. For that, follow the steps below.
- First, go to the JLCPCB official website and log in to your account. If you are a new customer, please use my link here to register and get a $60 new user coupon.


- Now, click the instant quote button and upload the Gerber file. You can download it using the link below.
- Gerber file — Download
- I have ordered 5 PCBs with Green color. Then, select the build time and shipping. Finally, click the save to cart button.





Step 3
Thirdly, when received the package unbox and first solder the SMD components. For that, you can use a hot air gun or hot plate.







Step 4
Now, solder the other components one by one.






Step 5
After that, install the ESP32 board on the PCB and connect it to the computer. Then, copy and paste the following program to Arduino IDE.


- Program and Gerber file — 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 the board and port. After upload this code to the ESP32 board.



Step 6
After uploading the program, remove the USB cable and connect the bulb holder to the relay module. I used a plug top to connect the AC voltage. Be careful when working with AC voltage.









Step 7
Next, power up this circuit using a 9v battery. (9v battery life is very short) Then, install the bulb on the holder and provide an AC voltage using the plug top.




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



Step 9
Finally, tap the mic button and say “turn on the bulb ” and “turn off the bulb”. If you want to change it please change it in the program and upload the program again.
if (value == "turn on the bulb") { // You can change it
digitalWrite(relay, LOW);
Serial.println("on");
} else if (value == "turn off the bulb") { // You can change it
digitalWrite(relay, HIGH);
Serial.println("off");


Now you can test this project using your voice commands. The full video guide is below. So, we hope to see you in the next project. Have a good day.
Troubleshooting
- Check the status of these components.
- Check the power sources.
- Select the correct board and port.
- Say the correct voice command.
How to make a Voice-Controlled Room Light with ESP32 DEVKIT V1 and Bluetooth | Step by step Guide