Module 01
Voice Automation Controller
Voice Automation Controller
Integrates Bluetooth Voice Module logic gates/configurations to trigger relay switching when serial command sensor matrix values narrow down. The Arduino receives voice commands such as LIGHT ON, FAN OFF, RELAY1 ON and toggles electrical loads through relay channels.
Hardware Pin Schematic
| Sensor Connection Point | Target Uno Pin |
|---|---|
| HC-05 TX =====> | D10 (Software RX) |
| HC-05 RX =====> | D11 (Software TX) |
| Relay Channel 1 =====> | D4 |
| Relay Channel 2 =====> | D5 |
| Relay VCC =====> | 5V |
| Relay GND =====> | GND |
Arduino IDE Sketch
#include <SoftwareSerial.h>
SoftwareSerial BT(10,11);
const int relay1 = 4;
const int relay2 = 5;
String command = "";
void setup()
{
Serial.begin(9600);
BT.begin(9600);
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
}
void loop()
{
while(BT.available())
{
char c = BT.read();
if(c == '\n')
{
command.trim();
command.toUpperCase();
if(command == "LIGHT ON")
{
digitalWrite(relay1, LOW);
}
else if(command == "LIGHT OFF")
{
digitalWrite(relay1, HIGH);
}
else if(command == "FAN ON")
{
digitalWrite(relay2, LOW);
}
else if(command == "FAN OFF")
{
digitalWrite(relay2, HIGH);
}
command = "";
}
else
{
command += c;
}
}
}