Control Home Lights With an IR Remote




Introduction: Control Home Lights With an IR Remote

About: Watch this space for projects on science, engineering, and tech. I explain how and why things work, by breaking apart everyday objects and DIY-ing the heck out of them.

Infrared Receviers and Transmitters are cool. They are the same combo used in TV remotes; are easy to setup, and reliable to use.

I decided to hook one up to my mains power supply, more specifically to the lights of my room (but you can hook it up to any utility, or appliance) to automate them.

Below is a step-by-step instructable but in case you dont like reading, here's the video for the complete tutorial:

Step 1: SAFETY!


Before we start, let me warn you that playing with your mains power supply can be fatal; do not attempt this until you are sure of what you are doing, and have proper protection (gloves, insulation, proper fuses in your house mains). Get help if you are unsure. It's not worth it if you are not safe!

Step 2: The IR Transmitter (Remote) and Recevier

First thing you would need is (DUH!) the Infrared transmitter and receiver pair. You can purchase the pair on ebay or Aliexpress for about a Dollar, and they work great. Alternatively, you can also use your TV remote or any other infrared remote (some phones also have an IR transmitter built in) you like.

Step 3: Relays Help You Control Home Appliances With Arduinos

The other important component required is a relay.
Relays help control high voltage and current appliances with low voltage electronics like Arduinos.

Make sure your relay is properly sized, and is SAFE!

Here's an easy tuorial on relays; how to use them, and which ones to buy:

Step 4: What You Need

In addition to the components mentioned above, you would (obviously) need your Arduino board, and a 9V battery.
However, after extensive testing, I figured out that the 9V batteries drain too fast, and therefore, it is better to plug your Arduino with a power adapter to AC power.

Step 5: The Circuit

The Circuit is really simple:

I have connected the Relay to pin 12, and the IR receiver to pin 13 (see schematic).

The 5V power from the Arduino is given to the Relay, and teh 3.3V power from the Arduino is given to the IR Receiver.

The Relay is then inserted between the live wire of the switch that you want to control (as shown).

The grounds are connected as shown, and that is it!

Step 6: The Sketch/ Code

Here is the Arduino Sketch that you would need to upload to the board:

//Developed by Fungineeers, the YouTube channel//
//begin code//

#include //include the library

#define ON 0xFF6897

#define OFF 0xFF9867

int receiver = 13; //initialize pin 13 as recevier pin.
uint32_t Previous;

IRrecv irrecv(receiver); //create a new instance of receiver
decode_results results;

void setup() {

irrecv.enableIRIn(); //start the receiver

pinMode(12, OUTPUT);


void loop() {

if (irrecv.decode(&results)) { //if we have received an IR signal
if (results.value==0xFFFFFFFF) {



switch(results.value) {
case ON: digitalWrite(12, LOW);


break; //Relay connected as Normally Closed, so Low signal means lights are ON.

case OFF: digitalWrite(12, HIGH);

delay (5000); break;//Lights will be OFF when a HIGH signal is applied and the relay OPENS the circuit. }

irrecv.resume(); //next value

Previous=results.value; }


Step 7: Voila! Your LIghts Are Now One Button Away

Enjoy your new remote controlled lights!



    • Water Contest

      Water Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Oil Contest

      Oil Contest