Voice controlled home automation using Arduino

In this project, we’ll design a Voice controlled home automation using Arduino and the Elechouse V3 Voice Recognition Module. The system will also integrate a WiFi smart plug for wireless appliance control and an infrared-based remote control module to command legacy IR appliances like TVs and air conditioners.

This project enables hands-free, wireless, and remote control of multiple home devices using locally processed voice commands—no internet or cloud APIs required for core operations.


🔧 Voice controlled home automation using Arduino Hardware Components

ComponentDescription
Arduino Uno R4 WiFiMicrocontroller with built-in WiFi
Elechouse Voice Recognition Module V3Local voice command processing module
WiFi Smart Plug (Tuya / ESP-based)Wirelessly controlled plug via MQTT or HTTP
IR Transmitter ModuleFor sending IR commands to home appliances
IR Receiver Module (TSOP1838 or similar)For capturing IR remote codes (learning function)
Relay Module (Optional)For controlling high-voltage appliances
Jumper Wires, Breadboard, 5V RegulatorStandard prototyping components
USB CableFor Arduino programming

 

System Architecture

The Arduino voice recognition project is built on three main pillars:

  1. Voice Command Recognition using the Elechouse V3 Module

  2. Command Execution via:

    • WiFi Smart Plug (HTTP/MQTT over WiFi)

    • IR Transmission to control remote devices

    • Relay for manual AC loads

  3. Arduino Uno R4 WiFi acts as the central controller and interface


Elechouse V3 Voice Module Setup

The Elechouse V3 is a compact voice recognition module that can store and recognize up to 80 commands, but only 7 can be active and recognized at the same time. Each command can have a duration of 1500 milliseconds (1.5 seconds).
This board has 2 controlling ways: Serial Port (full function), General Input Pins (part of function). General Output Pins on the board could generate several kinds of waves while corresponding voice command was recognized.

 It’s important to note that the module can be trained to recognize various types of sounds—not just human voices. For example, it can detect sounds like rainfall, a dog barking, and more. This functionality opens up a range of possibilities; for instance, automatically closing windows when it rains or triggering a mechanism to feed the dog when barking is detected.

Pin Configuration:

Module PinArduino Pin
VCC5V
GNDGND
RXD11
TXD10

 

The module continuously listens for commands, eliminating the need to press a button in Elechouse V3 voice recognition with Arduino to initiate voice recognition. Since it operates offline and records only short sound fragments, it ensures user privacy and avoids internet-related concerns. Additionally, its offline functionality enables rapid response times, as no server communication is required for recognition.
  • Use SoftwareSerial on pins 10 and 11 for communication.

Training Voice Commands

  1. Connect the module via Arduino serial monitor or Elechouse GUI tool.

  2. Train commands such as:

    • “Turn on light”

    • “Turn off fan”

    • “Activate TV”

  3. Each command is stored in a group (Group1, Group2…) and can be activated accordingly.

🌐 Arduino Uno R4 WiFi Integration

The Arduino Uno R4 WiFi includes the RA4M1 32-bit microcontroller and ESP32-S3 coprocessor, ideal for lightweight network communication.

WiFi Smart Plug Control

Use HTTP requests or MQTT to communicate with an ESP-based plug (like Tuya converted with Tasmota or ESPHome).

Example HTTP command to turn on a smart plug:

WiFiClient client;
if (client.connect(“192.168.1.150”, 80)) {
client.println(“GET /cm?cmnd=Power%20On HTTP/1.1”);
client.println(“Host: 192.168.1.150”);
client.println(“Connection: close”);
client.println();
}

 

Pre-requisites:

  • Configure smart plug with static IP

  • Flash with Tasmota/ESPHome firmware if needed


IR Remote Device Control

Use an IR LED (TSAL6200 or similar) to send commands captured via an IR receiver.

IR Learning:

  1. Use IRreceiver and IRremote library to read codes from your existing remote.

  2. Store and assign codes to voice commands.

  3. Send them using the IRsend class.

#include <IRremote.h>
IRsend irsend;

void sendTVPower() {
irsend.sendNEC(0x20DF10EF, 32); // Example NEC code for TV Power
}

 

Example Workflow

  1. User says: “Turn on light”

  2. Elechouse recognizes the phrase and sends command ID to Arduino.

  3. Arduino:

    • If mapped to a relay, activates it

    • If mapped to smart plug, sends HTTP/MQTT command

    • If mapped to TV, sends IR command

To connect an Arduino Uno R4 WiFi to a smart plug, you’ll typically need to communicate with the smart plug over Wi-Fi using its API or control protocol.

1. Choose a Compatible Smart Plug

Make sure the smart plug supports local control (like HTTP or MQTT) or is Tasmota/ESPHome-flashable. Popular options:

  • TP-Link Kasa (local HTTP API possible with hacks)

  • Sonoff plugs (flashable with Tasmota for MQTT control)

  • Tuya plugs (can be flashed or controlled via Tuya Cloud API)

2. Connect Arduino Uno R4 WiFi to Your Network

Use the WiFiS3.h library:

#include <WiFiS3.h>

const char* ssid = “Your_SSID”;
const char* password = “Your_PASSWORD”;

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println(“Connecting…”);
}

Serial.println(“Connected to WiFi”);
}

3. Control the Smart Plug

Option A: Via HTTP (Local API)

If your smart plug supports local HTTP control, send a request like:

#include <WiFiS3.h>
#include <WiFiClient.h>

const char* plug_ip = “192.168.1.100”; // IP of your smart plug

void loop() {
WiFiClient client;
if (client.connect(plug_ip, 80)) {
client.println(“GET /plug/on HTTP/1.1”);
client.println(“Host: 192.168.1.100”);
client.println(“Connection: close”);
client.println();
}
delay(10000);
}

Option B: Via MQTT (for Tasmota or ESPHome)

Use an MQTT client library like PubSubClient to publish ON/OFF commands.


4. Test the Setup

  • Monitor the serial output.

  • Confirm the smart plug toggles state when expected.

Since you’re using an ESP8285-based smart plug, you have a few good integration options depending on how the device is set up.

Option 1: Flash the ESP8285 Plug with Tasmota

Recommended if you want full local control.

🔧 Steps:

  1. Flash Tasmota Firmware to your ESP8285 plug (via serial interface).

  2. Configure Tasmota to connect to your Wi-Fi and set up MQTT.

  3. Install an MQTT broker like Mosquitto on a local server or use a cloud broker.

Arduino Uno R4 + MQTT Example:

Using the PubSubClient library:

#include <WiFiS3.h>
#include <PubSubClient.h>

const char* ssid = “Your_SSID”;
const char* password = “Your_PASSWORD”;
const char* mqtt_server = “192.168.1.x”; // Your MQTT broker IP

WiFiClient wifiClient;
PubSubClient client(wifiClient);

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) delay(500);

client.setServer(mqtt_server, 1883);
while (!client.connected()) {
client.connect(“arduinoClient”);
}

// Turn ON plug
client.publish(“cmnd/plug/power”, “ON”);

// Or Turn OFF
// client.publish(“cmnd/plug/power”, “OFF”);
}

void loop() {
client.loop(); // Keep connection alive
}

NOTE: The topic “cmnd/plug/power” depends on your Tasmota plug configuration.


Option 2: Control via Tuya Cloud API

If your plug is Tuya-based and not flashed, you can use Tuya’s cloud API. However, Arduino doesn’t natively support HTTPS requests easily, and cloud APIs introduce latency.

You’ll likely need an intermediate device (like a Raspberry Pi) to bridge the cloud commands.


Option 3: ESP8285 Plug with Custom Firmware for example ESPHome

If you’ve flashed ESPHome, use Home Assistant or a direct REST API or MQTT call.


Final Notes:

  • Flashing firmware requires disassembling the smart plug and using a USB-to-Serial converter (be cautious with AC wiring!).

  • MQTT is the most efficient and Arduino-friendly way to control ESP8285-based smart plugs.

Arduino Sketch (Simplified):

#include <SoftwareSerial.h>
#include <IRremote.h>
#include <WiFiS3.h>

SoftwareSerial voiceSerial(10, 11); // RX, TX
IRsend irsend;

const char* ssid = “Your_SSID”;
const char* password = “Your_PASSWORD”;

void setup() {
Serial.begin(9600);
voiceSerial.begin(9600);
irsend.begin();
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println(“WiFi Connected”);
}

void loop() {
if (voiceSerial.available()) {
int command = voiceSerial.read();
switch (command) {
case 0x01:
digitalWrite(5, HIGH); // Relay ON
break;
case 0x02:
digitalWrite(5, LOW); // Relay OFF
break;
case 0x03:
sendSmartPlugCommand(“On”);
break;
case 0x04:
sendTVPowerIR();
break;
}
}
}

void sendSmartPlugCommand(String state) {
WiFiClient client;
if (client.connect(“192.168.1.150”, 80)) {
client.println(“GET /cm?cmnd=Power%20″ + state + ” HTTP/1.1″);
client.println(“Host: 192.168.1.150”);
client.println(“Connection: close”);
client.println();
}
}

void sendTVPowerIR() {
irsend.sendNEC(0x20DF10EF, 32); // Example code
}

 

Testing & Calibration the Elechouse V3 voice recognition with Arduino

  • Use serial monitor for debug output.

  • Verify each command matches the expected action.

  • Train multiple phrases for each device for redundancy.

 

Voice controlled home automation using Arduino


✅ Pros

AdvantageDescription
Local voice processingWorks without internet
Expandable to multiple devicesRelay, IR, and WiFi plug supported
Secure & customizableNo dependency on cloud voice APIs
ESP32 co-processor supportEnables future AI or OTA features

❌ Cons

LimitationMitigation Tip
Limited to 7 active commandsUse command grouping in Elechouse module
Voice recognition less accurate in noiseTrain in quiet environment
Requires good WiFi setup for plugsUse static IP and strong signal
Infrared requires line-of-sightMount IR LED in clear line to target device

 

home automation with voice commands Future Improvements:

  • Integrate Google Assistant or Alexa via IFTTT for extended voice control.

  • Add OLED display to show system status or recognized commands.

  • Use Bluetooth fallback mode in case of WiFi failure.

 

Watch this video for Arduino voice recognition project additional information

 

 


Conclusion

This voice-controlled home automation project demonstrates the capability of Arduino Uno R4 WiFi in combination with the Elechouse V3 Voice Recognition Module to create a reliable, offline, and expandable system. By integrating WiFi smart plugs and infrared modules, it offers a full suite of control options for both modern and legacy appliances.

FAQ:

  1. Can I create a voice controlled home automation system using Arduino without internet access?
    Yes. home automation with voice commands using Arduino with the Elechouse V3 module works offline since the voice recognition is processed locally.
  2. Is the Arduino Uno R4 WiFi suitable for voice controlled home automation using Arduino?
    Yes. The Arduino Uno R4 WiFi is ideal for voice controlled home automation using Arduino due to its built-in WiFi capabilities and compatibility with voice modules.
  3. Do I need programming experience to build a voice controlled home automation using Arduino?
    No. Basic programming knowledge is helpful, but many voice controlled home automation using Arduino projects come with ready-to-use code and wiring guides.

 

See Also: 

Build a Smart Pet Feeder Using Arduino Uno R4 Essential Guide