arduino home automation
arduino home automation
(MAKAUT,WB)
BACHELOR OF COMPUTER APPLICATION 2ND YEAR
1
Introduction
2
Hardware Components
1 4
Detects and processes voice
The central microcontroller.
commands.
2 5
Act as switches for lighting Represent or implement the
circuits. lighting system.
Relays LEDs/Bulbs
3 6
For circuit assembly and
Powers all components.
connections.
3
Power Supply Connecting Wires & Breadboard/PCB
Software Requirements
1 2
To program and upload code. Processes commands.
3 4
Debugs the system during Maps voice commands to
development. lighting actions.
4
Working
1 User gives a command like 2
Module captures and digitizes
“Turn on the light.”
the command.
3 4
Matches the input to Toggles the light circuit based
predefined instructions. on the command.
5
Lights turn on/off as
instructed.
5
Lighting Output
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX, TX
HOW IT WORKS:
(Connect to TX, RX of HC-05) 1. The HC-05 Bluetooth module
#define LIGHT_PIN 13 // LED connected to pin 13
void setup() connects to your smartphone.
{ 2. You use a voice-to-text app that
pinMode(LIGHT_PIN, OUTPUT); // Set LIGHT_PIN as an output sends commands like "ON" or
digitalWrite(LIGHT_PIN, LOW); // Ensure the light is off initially
"OFF" to the Arduino via Bluetooth.
// Initialize serial communications 3. The Arduino receives these
Serial.begin(9600); // Arduino Serial Monitor
BTSerial.begin(9600); // HC-05 default baud rate commands and controls the light
Serial.println("Voice Controlled Lighting System"); accordingly:
Serial.println("Waiting for commands..."); 1. ON: Turns the light on.
}
void loop() 2. OFF: Turns the light off.
{ 4. Feedback is sent back to the
// Check if data is received from the Bluetooth module
if (BTSerial.available()) smartphone for confirmation.
{
String command = BTSerial.readStringUntil('\n'); // Read the command
command.trim(); // Remove any extra spaces or newlines
WIRING
Serial.println("Received command: " + command); // Process the command
if (command.equalsIgnoreCase("ON"))
{ • HC-05 to Arduino:
digitalWrite(LIGHT_PIN, HIGH); // Turn the light on • VCC → 5V
Serial.println("Light ON");
BTSerial.println("Light is now ON");
• GND → GND
} • TX → Pin 10 (Arduino RX)
else if (command.equalsIgnoreCase("OFF")) • RX → Pin 11 (Arduino TX via a
{
digitalWrite(LIGHT_PIN, LOW); // Turn the light off voltage divider for 3.3V logic)
Serial.println("Light OFF"); • LED to Arduino:
BTSerial.println("Light is now OFF");
}
• Long leg (anode) → Pin 13 via
else a 330Ω resistor
{ • Short leg (cathode) → GND
Serial.println("Unknown command");
BTSerial.println("Invalid command. Say 'ON' or 'OFF'.");
} 6
}
}
7
References
https://www.arduino.cc
https://www.electronicshub.org/
https://www.electronicshub.org/