Today we will show you how to make a Home Automation System using Arduino microcontroller. Through this system, you can control your home appliances with your cellphone by downloading a simple Android App on them. The Bluetooth module is used to send commands from cellphones to Arduino, which is connected to the relay.
Hardware Components
Following are the necessary hardware items required for Home Automation circuit:
S.No | Component | Value | Qty |
1. | Arduino | Uno R3 | 1 |
2. | USB Cable A/B | – | 1 |
3. | Relay module | – | 1 |
4. | Bluetooth Module | HC-05 | 1 |
5. | Breadboard | – | 1 |
6. | Connecting Wires | – | 1 |
Connection
Bluetooth module connections
- Connect VCC of the Bluetooth module to the VCC of Arduino.
- Connect GND of Bluetooth module to GND of Arduino.
- Connect RX of Bluetooth module to TX (D1) of Arduino.
- Connect TX of Bluetooth module to RX (D0) of Arduino.
Relay module connections
- Connect VCC to VCC of Arduino.
- Connect GND to GND of Arduino.
- Connect IN Pin to D8 of Arduino.
Lamp connections
- Connect outputs (C & NC) of the relay in series with the plug of the lamp.
Upload Code
- Download code and upload it to the Arduino board using Arduino IDE software.
- Download the app and pair it using password 1234 or 0000.
Working Explanation
Arduino Uno Rev is used in this project to control different components like the relay network and Bluetooth module. The range of the Bluetooth module is approximately 10 meters and it can be used with Bluetooth enabled phones. The operating voltage of this module is 3.3V, so it has an onboard 5V to 3.3V regulator.
When we apply power to the Bluetooth module, the LED on the module starts blinking. We should start the Bluetooth controller app on our cellphone and try connecting it to the module. If the pairing is successful, the LED becomes stable. Now, we can control home appliances connected to the relay with our cellphones.
CAUTION: Relay module can only handle current up to 10 Amp. Which is enough for most devices but not for high power devices live heaters and Air-conditioners.
Application
- By connecting cellphones to the internet we can control home appliances from a remote location over the internet.
- By using this system, we can prevent electric shocks by not touching any switches physically.
Circuit Diagram
Code
int state; int relay=8; void setup() { Serial.begin(9600); pinMode(relay, OUTPUT); // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: if(Serial.available()>0) { state = Serial.read(); if(state==1) { digitalWrite(relay,LOW); //OFF } if(state==0) { digitalWrite(relay,HIGH); //ON } } delay(50); }