Home Automation Bluetooth System
Home Automation Bluetooth System
My goal was to make a prototype Bluetooth-enabled Home Automation System and a user-friendly app that controls it. Such a system allows users to control their electric appliances by a simple click. The main components of this project were an Arduino UNO, a relay module and a HC-05 Bluetooth Module.
WORKING
I connected the bulb to the relay module which was further connected to the Arduino UNO. The relay acts as an electrical switch for the current in the switch board and it gets activated when input signal gets energized. The HC-05 is responsible for the communication via Bluetooth to the Arduino.
I made a user-friendly app using the MIT app inventor that was compatible with the Bluetooth Automation System. The app is coded to allow the user to pair the HC-05 module on their devices by clicking on the Bluetooth icon. When the Light on or Light off icon is pressed, the app sends a character value to the Arduino via Bluetooth*. More specifically, when the user presses ‘Bulb On’ icon, the app sends the character ‘N’ to Arduino via Bluetooth communication and when the user presses ‘Bulb off’ icon, the app sends the character ‘F’ to Arduino. Thereafter, Arduino processes the character input and executes commands accordingly.
FUTURE DEVELOPMENTS
For representation purpose I used only 1 bulb, but multiple devices can be connected if more relay modules are used. The app can also be voice command enabled. Some of the devices (like fan, TV, etc.) can also be controlled by IR Remote Control. This can be done by connecting an IR sensor to the Arduino so that it receives the IR signal from the remote and execute functions accordingly.
CODE
int r = 5; char bt;char c;String voice;void setup() { // put your setup code here, to run once:pinMode(r, OUTPUT);Serial.begin(9600);}void loop() { // put your main code here, to run repeatedly: if(Serial.available()) { bt= Serial.read(); Serial.println(bt); } if(bt=='N') { digitalWrite(r, HIGH); Serial.println("You pressed the ON button"); delay(2000); } if(bt=='F') digitalWrite(r, LOW); delay(1000);}