Build a Voice Controlled Home Automation System with Arduino
Imagine walking into a room and saying “lights on” — and they turn on. No switches, no apps, just your voice. This smart home STEM project combines speech recognition, Arduino programming, and relay control to create a genuinely useful home automation system. Students across India are building similar projects for science fairs, college submissions, and personal use.
This guide walks you through building a voice controlled light switch using Arduino and a Bluetooth-based voice recognition app. You will learn about serial communication, relay modules, and how to interface mobile apps with microcontrollers — skills directly relevant to IoT engineering careers.
Why Voice Control for a STEM Project?
Voice controlled systems represent the convergence of several engineering disciplines: signal processing, wireless communication, embedded systems, and software development. When you build a voice controlled light, you are not just wiring a relay — you are understanding how data flows from sound wave to digital command to physical action.
For STEM competitions and college projects in India, this project stands out because it is both technically rigorous and practically demonstrable. Judges can interact with your project directly, which makes for a compelling presentation.
Components Required
- Arduino Uno or Nano
- HC-05 or HC-06 Bluetooth module
- 5V single-channel relay module
- LED (for safe demonstration) or AC lamp with proper enclosure
- Jumper wires and breadboard
- Android smartphone (for voice recognition app)
- USB cable and 9V battery or USB power bank
- Optional: BC547 transistor + 1kΩ resistor (if relay module lacks onboard driver)
How the System Works
The architecture is straightforward:
- You speak a command on your smartphone
- A free app (Arduino Voice Control or AMR Voice) converts speech to text
- The text is sent over Bluetooth to the HC-05 module
- Arduino reads the text via Serial and parses the command
- Arduino triggers the relay ON or OFF accordingly
- The relay switches the connected lamp or LED
This approach avoids cloud dependencies — everything happens locally between your phone and Arduino, so it works without internet connectivity.
Circuit Connections
HC-05 Bluetooth Module to Arduino
| HC-05 Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| TX | D2 (SoftwareSerial RX) |
| RX | D3 (via voltage divider to 3.3V) |
Important: HC-05 RX pin is 3.3V logic. Use a voltage divider (1kΩ and 2kΩ) between Arduino D3 and HC-05 RX to avoid damaging the module.
Relay Module to Arduino
- VCC → 5V
- GND → GND
- IN → D7
Connect your LED (with 220Ω series resistor) between the relay’s Normally Open (NO) and Common (COM) terminals for safe testing.
Arduino Code
#include <SoftwareSerial.h>
SoftwareSerial BT(2, 3); // RX=D2, TX=D3
const int RELAY_PIN = 7;
String command = "";
bool lightState = false;
void setup() {
Serial.begin(9600);
BT.begin(9600);
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, HIGH); // Relay OFF (active low)
Serial.println("Voice Light Control Ready");
}
void loop() {
while (BT.available()) {
char c = BT.read();
if (c == 'n' || c == 'r') {
processCommand(command);
command = "";
} else {
command += c;
}
}
}
void processCommand(String cmd) {
cmd.trim();
cmd.toLowerCase();
Serial.print("Received: ");
Serial.println(cmd);
if (cmd == "lights on" || cmd == "turn on" || cmd == "on") {
digitalWrite(RELAY_PIN, LOW); // Relay ON
lightState = true;
BT.println("Lights turned ON");
Serial.println("Light ON");
}
else if (cmd == "lights off" || cmd == "turn off" || cmd == "off") {
digitalWrite(RELAY_PIN, HIGH); // Relay OFF
lightState = false;
BT.println("Lights turned OFF");
Serial.println("Light OFF");
}
else if (cmd == "status") {
String state = lightState ? "ON" : "OFF";
BT.println("Light is " + state);
}
else {
BT.println("Unknown command: " + cmd);
}
}
Setting Up the Android App
Several free apps work well for this project:
- Arduino Bluetooth Controller (Google Play) — Has a dedicated voice mode that sends recognised text over Bluetooth
- AMR Voice — Continuously listens and sends recognised speech
- BT Voice Control for Arduino — Purpose-built for exactly this use case
Steps to connect:
- Power your Arduino circuit
- Pair HC-05 in Android Bluetooth settings (default PIN: 1234 or 0000)
- Open the voice control app and connect to HC-05
- Enable voice mode and speak commands
Extending the Project
Control Multiple Lights
Use a 4-channel relay module and assign different voice commands to each channel:
const int RELAY_PINS[] = {5, 6, 7, 8};
if (cmd == "bedroom on") { digitalWrite(RELAY_PINS[0], LOW); }
if (cmd == "kitchen on") { digitalWrite(RELAY_PINS[1], LOW); }
if (cmd == "all on") {
for (int i = 0; i < 4; i++) digitalWrite(RELAY_PINS[i], LOW);
}
Add ESP8266 for WiFi Voice Control
Replace the HC-05 with an ESP8266 (NodeMCU) and use Google Assistant via IFTTT webhooks. This enables true internet-based voice control without needing your phone nearby. The ESP8266 receives HTTP requests from IFTTT and triggers the relay accordingly.
Add Feedback with LCD
A 16×2 LCD display connected over I2C can show the current state of each light, last command received, and system status. This improves your project presentation significantly.
Safety Considerations for AC Mains
If you choose to control real AC lights (beyond safe LED demonstrations):
- Use a relay module rated for your mains voltage (230V AC in India)
- Enclose all high-voltage wiring in a proper electrical box
- Use properly rated wire and connectors
- Never work on live circuits — always power off before modifying connections
- Have an experienced adult supervise all mains wiring work
- For competition demonstrations, always use LED loads — safer and sufficient to prove concept
Most STEM competition judges will actually prefer an LED-based demo as it shows awareness of electrical safety practices.
Project Enhancements for Competition
| Enhancement | Complexity | Impact |
|---|---|---|
| Multiple light zones | Low | High |
| LCD status display | Low | Medium |
| Timer/schedule feature | Medium | High |
| Motion sensor override | Medium | High |
| WiFi + remote control | High | Very High |
| Energy monitoring | High | Very High |
Frequently Asked Questions
Can I use ESP32 instead of Arduino for this project?
Yes, and ESP32 is actually better for this application. It has built-in Bluetooth (both classic and BLE) and WiFi, eliminating the need for the HC-05 module. The code structure remains similar but uses ESP32’s built-in BluetoothSerial library.
Does this project require internet connectivity?
The basic Bluetooth version works entirely offline. The ESP8266/IFTTT extension requires internet. For competitions with no WiFi access, the Bluetooth version is more reliable.
What is the range of the HC-05 Bluetooth module?
The HC-05 has a range of approximately 10 metres in open space. Walls reduce this to 5-7 metres. This is sufficient for controlling lights in a single room.
Can this control fans or air conditioners too?
Relay modules can switch any AC load within their rated current. A standard 10A relay module can control fans, air conditioners, and water heaters. Use appropriate wire gauges for higher current loads.
How do I handle command recognition errors?
Google’s speech recognition is generally accurate for short commands. Use short, distinct commands (“on”, “off”, “bedroom”) rather than long phrases. Avoid commands that sound similar to each other.
Conclusion
This voice controlled lights project is one of the most impactful STEM builds a student can create — it is practical, demonstrable, and teaches core IoT concepts. Starting with a Bluetooth-based Arduino implementation and then extending to WiFi and multi-room control gives you a natural progression that works for both first-time builders and experienced students looking for competition-worthy complexity.
The skills you develop — serial communication, relay control, mobile app integration — directly apply to professional IoT development roles. Indian technology companies are actively hiring engineers with hands-on embedded systems experience, and a well-documented project like this one is excellent evidence of that capability.
Add comment