• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / Arduino IR Remote Control Circuit

Arduino IR Remote Control Circuit

Last Updated on December 5, 2024 by Swagatam 10 Comments

In this post I will show how to construct a customizable Arduino based IR (infrared) based wireless remote control switch, which consists of IR remote and a receiver, you may modify according to your needs. In the later part of the article I have explained about an upgraded foolproof version of an IR remote control which will respond only to an uniquely assigned frequency.

If you are above beginner level you can accomplish it with ease. The proposed circuit illustrated here just has three controls on remote and 3 relays on receiver end. You may modify the code and circuit diagram to fulfill your needs.

You’ll need two Arduino boards, which act as remote and another act as receiver. I would recommend Arduino pro mini for this project, since the sizes of them are pretty small and the overall size of the remote could be shirked.

You may use 3.3V based Arduino pro mini for remote so, that you can be powered with two button cell or two AA size batteries, according to your needs.

The IR transmitter circuit has 3 push to on buttons and an IR LED for sending commands to receiver. Each button has programmed with unique hexadecimal code, the same hexadecimal code is programmed on receiver side too.

When a button is depressed the IR LED sends out the hexadecimal code to receiver, the receiver will recognize which of the button is pressed and it switches the corresponding relay ON/OFF.

The proposed remote uses RC5 protocol for communicating with receiver; you may change everything by modifying the code.

If you are just beginner in Arduino, you can still accomplish it just follow the diagram and upload the code without modifying.

The circuit and program:

Arduino Remote Transmitter:

Foolproof IR Remote Control Circuit

The above circuit illustrates how to build the Arduino IR remote transmitter.

The three 10K resistors are pull down resistors, which prevent accidental triggering of the remote due to static charge and a 220ohm current limiting resistor is employed for IR LED.

Program for Remote Transmitter:

//---------Program developed by R.Girish--------//
#include <IRremote.h>
IRsend irsend;
const int button1 = 4;
const int button2 = 5;
const int button3 = 6;
void setup() {
pinMode(button1, INPUT);
pinMode(button2, INPUT);
pinMode(button3, INPUT);
}
void loop()
{
if (digitalRead(button1) == HIGH)
{
delay(50);
irsend.sendRC5(0x80C, 32);
delay(200);
}
if (digitalRead(button2) == HIGH)
{
delay(50);
irsend.sendRC5(0x821, 32);
delay(200);
}
if (digitalRead(button3) == HIGH)
{
delay(50);
irsend.sendRC5(0x820, 32);
delay(200);
}
}
//---------Program developed by R.Girish--------//

Arduino Receiver:

IR2BReceiver

The IR Arduino receiver circuit as shown above consists of TSOP1738 sensor few transistors, current limiting resistors for transistor, relays and diodes for absorbing high voltage spike from relay coils.

The circuit diagram is self explanatory.

Program for Arduino receiver:

//-----------------Program developed by R.Girish-----------//
#include<IRremote.h>
int input = 11;
int op1 = 8;
int op2 = 9;
int op3 = 10;
int intitial1;
int intitial2;
int intitial3;
IRrecv irrecv(input);
decode_results dec;
#define output1 0x80C // code received from button A
#define output2 0x821 // code received from button B
#define output3 0x820 // code received from button C
void setup()
{
irrecv.enableIRIn();
pinMode(op1,1);
pinMode(op2,1);
pinMode(op3,1);
}
void loop() {
if (irrecv.decode(&dec)) {
unsigned int value = dec.value;
switch(value) {
case output1:
if(intitial1 == 1) {
digitalWrite(op1, LOW);
intitial1 = 0;
} else {
digitalWrite(op1, HIGH);
intitial1 = 1;
}
break;
case output2:
if(intitial2 == 1) {
digitalWrite(op2, LOW);
intitial2 = 0;
} else {
digitalWrite(op2, HIGH);
intitial2 = 1;
}
break;
case output3:
if(intitial3 == 1) {
digitalWrite(op3, LOW);
intitial3 = 0;
} else {
digitalWrite(op3, HIGH);
intitial3 = 1;
}
break;
}
irrecv.resume();
}
}
//--------------Program developed by R.Girish-----------//

By following the above explanations you can accomplish three controls, if you want to add more controls and relay, you need to edit the code and circuit diagram.

You can assign output and input for unused pins in the receiver and remote in the program and connect number of transistor and relay for the respective pins in receiver and similarly connect number of switches and pull down resistor in remote.

You can use random hexadecimal code for assigning more number of buttons.

For example: 0xA235, 0xFFFF, 0xBA556 and so on. And also add the same hexadecimal value in receiver code too. For example: #define output4 0xA235, #define outout5 0xFFFF and so on.

Making a IR Remote Control with Unique Frequency

In the above sections I have explained about a simple IR remote control that will work with any IR remote transmitter.
In the following article I have explained how to make an upgraded version of the above concept for a foolproof control of the home appliances using arduino microcontroller, which will work with a unique frequency and never operate with common IR handset.

Foolproof IR Remote Control

This circuit can turn on/off your gadgets using TV remote’s unused buttons or any other unused remote that may be lying in your junk box for ages.

The motto of this project is to help physically challenged persons, and help them to access the ON/OFF switching of the basic home appliances such as fans or lights independently.

The second objective is to enable the user to control the gadgets “Like a boss” without having to move from his or her existing position.

The circuit utilizes traditional IR based communication between transmitter and receiver.

This circuit is cent percent foolproof to other IR remotes, and other IR sources and less susceptible to errors.

The major problem with non-microcontroller based IR remote control circuit, which is found around the internet, is that it could turn ON/OFF with any IR based remote and can only control one device at an instant and also more susceptible to errors.

This circuit overcomes above specified issues, and we can control several gadgets on one remote and assign keys for specific gadgets.

Before proceeding this project you need to download the library files for arduino form this link and follow the instruction given below: github.com/z3t0/Arduino-IRremote

Instructions:

1) Click “clone or download” button form the given link and hit “Download ZIP”.

2) Extract the file and move “IRremote” folder to your library folder of Arduino.

3) Delete “RobotIRremote” folder from your arduino library. “RobotIRremote” has similar definition of “IRremote” library which clash and not able to upload the code to Arduino so, deletion/removal is mandatory.

By duplicating the above instruction your Arduino IDE software is ready for any/most of the IR based projects.

Assign keys for remote:

In our TV remote each key has unique hexadecimal code, which is used to recognize which key is pressed for an operation. Before uploading the final code to Arduino, you need to find what the hexadecimal codes for your keys are.

To do this construct the following circuit in breadboard and follow the instruction.

Scan1 1

1) Open Arduino IDE and upload example code “IRrecv Demo”

2) Open serial monitor and press the key on remote that you want to use.

You’ll see hexadecimal code pop up as soon as you press the key. That’s the hexadecimal code for that particular key.

3) Do the same for other two keys (3 keys are given in this project for controlling 3 devices)

· We are going to use these hexadecimal codes in the main program and upload to arduino.

Program:
//-----------------Program developed by R.Girish-----------//
#include<IRremote.h>
int input = 11;
int op1 = 8;
int op2 = 9;
int op3 = 10;
int intitial1;
int intitial2;
int intitial3;
IRrecv irrecv(input);
decode_results dec;
#define output1 0x111 // place your code received from button A
#define output2 0x112 // place your code received from button B
#define output3 0x113 // place your code received from button C
void setup()
{
irrecv.enableIRIn();
pinMode(op1,1);
pinMode(op2,1);
pinMode(op3,1);
}
void loop() {
if (irrecv.decode(&dec)) {
unsigned int value = dec.value;
switch(value) {
case output1:
if(intitial1 == 1) {
digitalWrite(op1, LOW);
intitial1 = 0;
} else {
digitalWrite(op1, HIGH);
intitial1 = 1;
}
break;
case output2:
if(intitial2 == 1) {
digitalWrite(op2, LOW);
intitial2 = 0;
} else {
digitalWrite(op2, HIGH);
intitial2 = 1;
}
break;
case output3:
if(intitial3 == 1) {
digitalWrite(op3, LOW);
intitial3 = 0;
} else {
digitalWrite(op3, HIGH);
intitial3 = 1;
}
break;
}
irrecv.resume();
}
}
//--------------Program developed by R.Girish-----------//

NOTE:

In the program:

#define output1 0x111 // place your code received from button A

#define output2 0x111 // place your code received from button B

#define output3 0x111 // place your code received from button C

· Place your 3 unique codes from your remote in this place of 111, 112, and 113 and upload the code. Hexadecimal codes will be from 0 to 9 and A to F, for example: 20156, 26FE789, FFFFFF.

· Place your code with “0x” (zero x).

Circuit diagram:

· Pressing key trips the relay ON and by pressing again it will turn off the relay.

Scan 4

You'll also like:

  • 1.  Vehicle Speed Detector Circuit for Traffic Police
  • 2.  Interfacing SD Card Module for Data Logging
  • 3.  Quadcopter Remote Control Circuit without MCU
  • 4.  Introduction to I2C LCD Adapter Module
  • 5.  GSM Fire SMS Alert Project
  • 6.  L298N DC Motor Driver Module Explained

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « Natural Mosquito Repellent Using High Watt Resistor
Next Post: Deep Soil Metal Detector Circuit – Ground Scanner »

Reader Interactions

Comments

  1. MIKE BENNETT says

    July 20, 2021 at 11:51 pm

    I am looking for a 6 channel IR remote control with 7 non latching relays. I want each of the 6 buttons to operate a corresponding relay and the 7th relay to operate when any button is pressed. I would be prepared to pay for a design. I have found similar online but they are all latching.

    Reply
    • Swagatam says

      July 21, 2021 at 8:52 am

      Six channel IR remote can be readily procured from any online electronic store. The 7th relay can be put externally, and the supply to its coil can be fed through separate diodes, whose input side may be integrated with supply voltage arriving from the rest of the 6 relays, so that when any of the relay activates, the 7th relay also activates.

      Reply
      • Kaz2598 says

        July 21, 2021 at 2:31 pm

        I have found many online and even bought a few but they are all latching. I don’t know how to modify them.

        Reply
        • Swagatam says

          July 21, 2021 at 5:39 pm

          there’s a small switch on the PCB, which needs to set up to implement either a latching mode or a temporary ON mode

          Reply
          • Kaz2598 says

            July 21, 2021 at 7:08 pm

            I don’t know if there is a facility to send photographs to you but there is no switch on this Pcb’s

            Reply
            • Swagatam says

              July 22, 2021 at 9:32 am

              If you couldn’t find the switch then probably there’s no such facility available on your circuit board. Actually this mentioned switch is commonly available on RF remote control units, I am not sure about the IR type remote controls. In such a situation you may have diagnose the transistor stage of the relay driver and then modify the circuit so that the latching feature is disabled.

              Reply
  2. Luigi says

    April 8, 2021 at 6:21 pm

    Hello,
    interesting topic. 🙂
    I would like to ask if I can use the hex code found in this way to build my own Attiny85-based remote controller?
    I would like to build a remote controller only with a sleep timer function. (this function is missing on my TV)
    Thanks for the reply…

    Reply
    • Swagatam says

      April 8, 2021 at 8:34 pm

      Hi sorry, I am not good with Arduino stuff, so can’t suggest much!!

      Reply
  3. Manowar Hossain says

    September 15, 2018 at 12:03 am

    Could you supply circuit diagram, parts name, used code, library name for controlling celling fan’s speed by infrared remote and Arduino UNO? Hence I will be grateful to you.

    Reply
    • Swagatam says

      September 15, 2018 at 8:30 am

      Thanks, If it is possible I’ll surely try and update it here!

      Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (82)
  • Datasheets and Components (102)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (100)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on Simple Delay Timer Circuits Explained
  • Swagatam on The Role of Inductor Coil in SMPS
  • Swagatam on 7 Modified Sine Wave Inverter Circuits Explored – 100W to 3kVA
  • Swagatam on 7 Modified Sine Wave Inverter Circuits Explored – 100W to 3kVA
  • Victor on 7 Modified Sine Wave Inverter Circuits Explored – 100W to 3kVA

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations