How to Make a Cheap Home Automation System
by geekrex in Circuits > Arduino
20855 Views, 297 Favorites, 0 Comments
How to Make a Cheap Home Automation System
Well Automated Home are a dream to every DIY er, But they Cost much
So here is a solution to make a low budget Automated system
======================================================
Cost of building the project:
- Relay module (0.32$)
- transistor bc548 (0.016$)
- perfboard (0.16$)
- screw terminal (0.08$)
- arduino or arduino compatible device(12$)
Total : For two switch it will be 13$ max
======================================================
So Lets make it :)
Also like my page for support
https://www.facebook.com/makewithRex
Circuit Diagram
The working is very simple and is divided into 3 part
- Arduino
- IR Communication/IR data reception
- Relay module
=================================================
The Arduino will be covered at the last part of this Instructable
We will start the relay module
Relay Module
A relay is a electromechanical switch.
It has 5 pin
- Cmn-Common Terminal
- C1-Coil 1
- C2- Coil 2
- NC- Normally Connected
- NO - Normally Open
C1 will be connected to the 6v via transistor bc548
C2 to ground
Cmn will be the Line input
and lastly NO will be at output
=================================================
The relay module cost much so i made the custom relay module
you can use a ready made relay module.my relay operate at a voltage of 6v
so i had operate those with a transistor.
The transistor acts as a switch when a HIGH is send to the base connecting the 6V power circuit to the relay module.
We are using relay to provide a connection between 220v and arduino without any direct electrical connection of the both the system.
IR Communication
IR communication has been made so easy thanks to Ken Shirriff
Download the library for the ir module or sensor.
https://github.com/shirriff/Arduino-IRremote
************************************************************************
Note: Vs is the data out for which is to be connected to pin 11
************************************************************************
Steps to install the library
- Close the Arduino ide
- Open the Arduino folder
- Locate libraries
- Extract the files as a folder named IRremote
- Open Arduino ide
The library has installed
Now to get an idea of how remote works
Try the example of IRrecvDemo in the ir library
Note: Erase the Hex in parameter in the program
After uploading the sketch u can see the the data in for the switch u press on the remote
press the switch and get the value for u button note it :
For my case
1 is 33444015
2 is 33478695
now since u have the value its time to code
Coding Time
The code is given in the attachment
Change it as per requirement
=======================================================
Connection are as follow
- vs of ir receiver to pin 11
- relay coil pin to 8
- vc to 5v of arduino
- gnd to gnd of arduino
----------------------------------------------------------------------------------------------------
READY TO CODE
========================================================
/*
Author :Prajjwal Nag
Contact:https://www.facebook.com/prajjwal.nag
*/
#include
int RECV_PIN = 11;// data reception pin
int relaypin=8;// To relay 1
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
pinMode(relaypin,OUTPUT);
}
void loop()
{
if (irrecv.decode(&results))
{
switch(results.value)
{
case 33444015:// for 1 button on remote
digitalWrite(relaypin,HIGH);
break;
case 33478695:// for 2 button on remote
digitalWrite(relaypin,LOW);
break; }
irrecv.resume(); // Receive the next value
} }
==================================================
Downloads
Working
Here is the working video of the model
I Hope You guys Enjoy
And Feel free to ask Anything if seem to be complicated