Introduction: 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
Step 1: 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.
Step 2: 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
Step 3: 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
} }
==================================================
Attachments
Step 4: 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
Attachments

Participated in the
Home Automation

Participated in the
Bedroom Contest
32 Comments
7 years ago
Great tutorial. I appreciate the time and effort it took to create this tutorial!
I do not see the remote/transmitter in the parts list.
Do I just pick any remote, and use the data in test shown above?
Thank you.
7 years ago
What is the brown board with holes in it called?
Reply 7 years ago
Perfboard
8 years ago on Introduction
can u please direct me this same for controller 89c51 instead of arduino.
with circuit diagram and program.
it would be a great thanx.............
plzzzzzzzzz
Reply 8 years ago on Introduction
Not an issue. The circuit will 100% work for your 89S52 or 89C51. The code will be as you like.
8 years ago
can u please help me pious
8 years ago
I have a question why you put the diode
Thanks
Reply 8 years ago on Introduction
AhmedA27 The diode returns current back to the supply when a magnetic field collapses, and generates a current spike. Without the protection diode the current goes backwards in the circuit, and reverse biases everything it flows through.
Reply 8 years ago on Introduction
First thank you for the first reply and second what is current spike I search it on google and I didn't find it useful third when the current goes backwards to the circuit what is bad thing can happen because I will make this circuit without the diode to see what's gone to happen
Reply 8 years ago
current spike are unwanted instantaneous current that occur when the switch is turned off
if u don't use diode nothing will happen but slowly it will damage your transistor and then microcontroller
Reply 8 years ago on Introduction
thanks a lot pious123
8 years ago on Introduction
wat is the problem ??
8 years ago on Introduction
BC548 is supposed to be NPN right? the transistor used in ckt diagram is PNP. What am I supposed to use? please help
Reply 8 years ago on Introduction
BC548 is NPN only .
I made a slight mistake which changed the transistor in schematics .
now do u need any thing else
8 years ago
I have a question why you put the diode
Thanks
8 years ago on Introduction
You're not a big believer in back EMF with the lack of a protection diode across the relay coil I see.
Reply 8 years ago
this module is built to handle dc
should i have also include a extra diode bcz my line is already having filter circuit ?
Reply 8 years ago on Introduction
Actually, pfred2 is right. If you don't add that protection diode, either your transistor won't survive or your arduino can get damaged.
One more thing. NC terminal on relay means normally open which means that it is connected to the pole terminal when the coil is not getting a supply. NO means normally open which gets connected to pole when the coil gets a supply. You really need to correct that.
Reply 8 years ago
saiyam i have use a different terminology here but the meaning is same .
and about relay do i need diode if the line are ready in dc ??
Reply 8 years ago on Introduction
A protection diode is not a rectifier. A protection diode returns current back to the supply when a magnetic field collapses, and generates a current spike. Without the protection diode the current goes backwards in the circuit, and reverse biases everything it flows through. You can do a web search to learn more about what a protection diode is, and how it is used in a circuit.
But for a brief description you put a protection diode reverse to current flow across an inductor. Go look it up, to see what that means.