How to Make a Cheap Home Automation System





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

Step 1: Circuit Diagram

The working is very simple and is divided into 3 part

  1. Arduino
  2. IR Communication/IR data reception
  3. 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 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.


Note: Vs is the data out for which is to be connected to pin 11


Steps to install the library

  1. Close the Arduino ide
  2. Open the Arduino folder
  3. Locate libraries
  4. Extract the files as a folder named IRremote
  5. 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




Author :Prajjwal Nag




int RECV_PIN = 11;// data reception pin

int relaypin=8;// To relay 1

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup() {


irrecv.enableIRIn(); // Start the receiver



void loop()


if (irrecv.decode(&results))




case 33444015:// for 1 button on remote



case 33478695:// for 2 button on remote


break; }

irrecv.resume(); // Receive the next value

} }


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



  • Trash to Treasure

    Trash to Treasure
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Pro Tips Challenge

    Pro Tips Challenge

We have a be nice policy.
Please be positive and constructive.




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.

What is the brown board with holes in it called?


can u please direct me this same for controller 89c51 instead of arduino.
with circuit diagram and program.
it would be a great thanx.............

Not an issue. The circuit will 100% work for your 89S52 or 89C51. The code will be as you like.

I have a question why you put the diode

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.

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

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