Project tutorial
IR Remote Controlled Home Automation

IR Remote Controlled Home Automation

Build a simple automation project using Arduino Uno and IR remote.

  • 11,275 views
  • 7 comments
  • 20 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

Introduction

Welcome to another of my tutorials.

Today in this tutorial we are going to make something really useful and very cool thing a IR Remote Controlled Home Automation System.

The reason I come up with this idea is, I hate to turn on and off my switches in my garage. Because the switch board is little far away from my work bench, so every time to turn on or off my light or something I really need to stand up and go to switch board. It is a horrible problem when I am working with something in my garage. So I decided to find a way to solve my problem. I come up with a home automation device.

The best way is to use a IR remote to control through this, I can control multiple devices. The work bench and switch board is approximately about 3 meter away so it will work fine. Using this device you can also control any home appliances like TV, Fan, Lights etc.

It didn't cost me too much, I just spend about 15$ or less to make this device. So guys it is super cheep and very useful.

So what you waiting for? Let's roll!

Step 1: Collect The Parts.

The first and primary step is to collect the necessary parts that we needed to do this project. The parts are super cheap. You can collect from your nearest radio shack.

Here Is The Parts You Needed To Collect:

  • Arduino Uno
  • Relay Module
  • Mini BreadBoard
  • Jumper Wire (male to male)
  • TSOP1738 (or any equivalent)
  • Buzzer (optional, used for notification)
  • General Purpose PCB (only need a small piece).
  • Male Header Pin (three pin).

Other Tools Needed:

  • Soldering Iron
  • Soldering Wire
  • Soldering paste
  • Box(used as enclosure for the device)
  • Utility Knife and glue

I think that's all we needed.

Warning: In this tutorial we are dealing with high voltage so, do not proceed this tutorial without wearing safety glass and gloves.

Now lets head to the next step.

Step 2: Solder IR sensor On The PCB.

In this step we need to solder the TSOP1738 IR sensor to a small piece of PCB. Like the image given above. I know it can directly plug to Arduino but some cases the pin will break and the sensor will useless to us, to prevent this I just soldered the TSOP1738 on a small piece of PCB with male header pins, so i can use it like a sensor module.

It is not hard enough to make, see the above images and make one yourself. After you make one lets jump to the next step.

Step 3: Download and install IR library

Before we proceeding to next upcoming steps. We need to install IRremote library in Arduino IDE.This library is necessary to do this tutorial.

To install the Library in your Arduino IDE follow the steps below:

After extracting you will get a folder named IRremote. Copy the folder to your Arduino installed folder, in my case it is C:/Program Files/arduino-16.8 Then open the folder called Libraries.

  • First download the IRremote library file from here.
  • Extract the file using the winrar or 7zip.
  • Paste the IRremote folder there.

We done we just installed the IRremote library. Lets go to the next step now.

Step 4: Get Hex Code From Remote

Now in this step we need to take the hex code of the remote button.

The IR remote have unique hex codes for every button, it helps to uniquely identify witch button is pressed on the remote. So first we need to take the hex codes of button that we are going to use on the remote.

Follow This Step To Get The Hex Code From IR Remote:

  • Wire the Arduino and TSOP1738 sensor (I gave the pin out of the sensor in above images) as shown the above schematic diagram.
  • Open Arduino IDE and copy the below code and paste there.
  • Upload the Sketch.
  • Then open Serial Monitor Window.
  • Press the button on the remote that you need to get the hex code.
  • At that moment you will get a piece of hex code in your serial monitor, note it down any where we need that.
#include 
int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receive
}
void loop() {
  if (irrecv.decode(&results)) {
  Serial.println(results.value, HEX);
 irrecv.resume(); // Receive the next value
 }
}

After you get the Hex code we can move to the next step.

Step 5: Wire The Arduino

Now its time for wiring the Arduino and other components together! See the above schematics and carefully connect all the parts to the Arduino. I used some jumper wires to wire the components.

It is pretty easy, does not have any complicated connections. You can use a mini breadboard to wire up the Arduino and component together easily.

Here I explain it by parts:

  • TSOP1738 GND(pin1)
  • To Arduino GNDTSOP1738 VCC(pin2)
  • To Arduino 3.3vTSOP1738 OUT(pin3)
  • To Arduino D12 Buzzer GND
  • To Arduino GNDBuzzer VCC
  • To Arduino D10 Relay Module GND
  • To Arduino GNDRelay Module VCC
  • To Arduino 5vRelay Module OUT
  • To Arduino D7

Warning: Do not connect the bulb or any home appliances to the relay module out now!

After wiring the parts together lets move to the next step!

Step 6: Arduino Sketch.

Now its the time for uploading the sketch to the Arduino.

Simply just download the below Arduino sketch called FDXUWSFIU9UX6WL.ino, then simply open in your Arduino IDE and upload it.

Please note: Replace the hex code of remote buttons that you took from your remote and also using this code you can control up to 4 relay module.

Step 7: Powering The Circuit.

So we are uploaded the Arduino sketch to Arduino board. Now we should check if it is work or not. Check carefully if any wrong connections exist, if not then just power up your Arduino board. Now take your IRremote and press the button that you used in the previous steps.

If the relay turn on and hear a beep sound from buzzer, its all fine lets go to the next step. Else is there any problem in working, carefully check once again the connections and also the Arduino sketch.

Then power the Arduino once again and check it. After the successful testing lets go to the next step.

Step 8: Find A Enclosure.

Now we are almost done.

In this step we need to put all our electronics in a box for a safety, because we are using high AC voltage.

Its not a hard step. Find a box yourself that we can use to put all our electronics together. I always make my own custom box myself using form board sheet (here I used an old box that I made for one of my previous tutorials.

Please note: Do not use metal box.

Step 9: Done

At last we made our IR remote Home Automation Device.

Fix it in your garage or bedroom to remotely operate your home appliances or place it any where that you need a remote control.

Good luck guys!

Code

Code snippet #1Plain text
#include 

int RECV_PIN = 8;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

{

 Serial.begin(9600);

 irrecv.enableIRIn(); // Start the receive

}

void loop() {

  if (irrecv.decode(&results)) {

  Serial.println(results.value, HEX);

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

 }

}

Comments

Similar projects you might like

IR Remote Controlled Power Switch for Rapsberry Pi 3

Project tutorial by Vilém Kužel

  • 1,498 views
  • 1 comment
  • 7 respects

Remote Controlled Bulb With Arduino

Project tutorial by muhammed shameel k.v

  • 2,860 views
  • 0 comments
  • 12 respects

Developing an IR Remote and Software Controller

Project tutorial by Steve

  • 18,069 views
  • 0 comments
  • 35 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,826 views
  • 17 comments
  • 75 respects
Add projectSign up / Login