Home Automation Using Arduino UNO through Android Device

Programming, Tutorial, Coding, New Design, and/or any project for your Arduino and Raspberry Pi can post your topic /suggestion here.
User avatar
Diy
Admin
Admin
Contact:
Location: Philippines
Posts: 185
Joined: Sat Apr 23, 2016 10:32 pm

Home Automation Using Arduino UNO through Android Device

Sat Feb 24, 2018 7:49 am

This project is based on Interfacing an android application to Arduino Uno board using Bluetooth. The result is a home automation system with minimal electronic components without complex soldering and simple and flexible design.

Parts List

- Arduino Uno R3 Development Board (or a trusted working clone would work fine)
- Bluetooth Module (Preferably HC-05)
- Android Device (Preferably one running v4.0 or above)
- Relays (R1 – R6 in Schematic diagram)
- Connectors
- USB cable for Arduino

The diagram of the relay in the above figure is placed upside down for easy reference to the relay pin connections shown in the below figure.
HA2.png
Connections
- Connect pins 2-7 of Arduino to Relays R1-R6 at pin “x” of each relay respectively.
- Interconnect all the “y” pins of each relay and connect one of them to the GND pin of Arduino.
- Connect VCC of Bluetooth module to 5v power pin of Arduino and likewise GND pin of Bluetooth module to GND pin of Arduino.
- Interconnect all the “t1” pins of each relay and connect one of them to 220V input of main power supply.
- Connect any one terminal of each of the devices to be controlled to pin “t2” of each of the relays R1-R6 respectively.
- Connect the other remaining terminals (Ground terminals) of all the devices to be controlled to GND of the main power supply.
- Connect Tx of Bluetooth module to Rx of Arduino and Rx of Bluetooth module to Tx of Arduino.

Software
The code for Arduino Uno is available Below: (Home_Automation.ino)

Code: Select all

byte val;

void setup()
{
  Serial.begin(9600);
	
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
}

void loop()
{
	int a=0;
	if(Serial.available())
	{
		val=Serial.read();
		Serial.println(int(val));
		
		if(int(val)==97)
			digitalWrite(2,HIGH);
		
		else if (int(val)==98)
			digitalWrite(2,LOW);
		
		if(int(val)==99)
			digitalWrite(3,HIGH);
		
		else if(int(val)==100)
			digitalWrite(3,LOW);
		
		if(int(val)==101)
			digitalWrite(4,HIGH);
		
		else if(int(val)==102)
			digitalWrite(4,LOW);
		
		if(int(val)==103)
			digitalWrite(5,HIGH);
		
		else if(int(val)==104)
			digitalWrite(5,LOW);
		
		if(int(val)==105)
			digitalWrite(6,HIGH);
		
		else if(int(val)==106)
			digitalWrite(6,LOW);
		
		if(int(val)==107)
			digitalWrite(7,HIGH);
		
		else if(int(val)==108)
			digitalWrite(7,LOW);
	}
}

Also, QR code for the same is:
HA5-150x150.png
HA5-150x150.png (5.63 KiB) Viewed 558 times

The Android app is available Below:
HomeAutomation.zip
(1.44 MiB) Downloaded 58 times

Also the QR code for the app is:
HA5-150x150.png
HA5-150x150.png (5.57 KiB) Viewed 558 times

I hope you like this new project. and Enjoy!


Return to “ARDUINO AND RASPBERRY PI”

Links

In total there are 10 users online :: 1 registered, 0 hidden and 9 guests
Registered users: Bing [Bot]
Most users ever online was 156 on Sun Jun 17, 2018 7:42 am
Total posts 439
Total topics 318
Total members 62
Our newest member anonymous-kali
No birthdays today