Arduino IR Remote Hack

Hey guys, welcome back to RootSaid. How about hacking an IR Remote Controller? In this post, I will show you how you can hack an IR Remote Controller and create a device using Arduino that will act as an IR Remote Controller. 

I will explain the circuit, explain the code and tell you everything you need to know to make your own Arduino IR Remote Controller.

Online PCB Manufacturer – JLCPCB

JLCPCB is one of the best Online PCB manufacturing company from where you can order PCBs online without any hassle. The company works 24 hours a day, 7 days a week nonstop. With their high tech machinery and automated work stream, they can manufacture huge quantities of high-class PCBs within hours.

Automated PCB Manufacturing Process

JLCPCB can develop PCBs of various complexity. They develop Simple and cheap PCBs with Single layer board for hobbyists and enthusiasts as well as complex multi layer board for high standard industrial applications. JLC works with large product manufacturers and may be the PCB of devices you are using such as laptop or mobile phones were made at this factory.

Components Needed

  • Arduino Board
  • IR Hack PCB
  • TSOP 1738 IR Receiver
  • IR LED
  • 7805 Voltage Regulator

Objective

Here, what we are going to do is, 

1) Figure out what is being sent by the remote when you press a particular button on the remote controller

2) Replay the code using our device with push of a button.

How to make an IR Remote Hacker using Arduino

The Circuit

This is a simple circuit comprising of a TSOP 1738 IR receiver, IR LED and an Arduino Nano. The input power is connected to a 7805 regulator. 7805 is a 5V regulator which will convert an input voltage of 7- 32V to a steady 5V DC supply.

So, you can connect an input voltage of anywhere between 7V to 32 to this circuit. For my bot, I prefer an 11.1V Lipo Battery. There are indicator LEDs across various points for easy troubleshooting.

  • IR LED – D2 of Arduino
  • Output of IR Receiver – D11
  • Button 1 – A0
  • Button 2 – A1
  • Button 3 – A2
  • Button 4 – A3

Designing the PCB

To get Started, First Go to EasyEDA website and create a free account. Go to “Editor” and create a new project. For now, JLCPCB have 689 Basic components and 30k+ Extended components at your disposal. See the complete list of components here.

Make sure you add the components from this list while drawing the schematics in EasyEDA. You can even search for the components and check its availability. Now you can get your layout done using inbuilt tools in EasyEDA.

You can now download the Gerber file and use it to manufacture your PCB from JLCPCB. Gerber File contains information about your PCB such as PCB layout information, Layer information, spacing information, tracks to name a few. BOM File or Bill Of Material contains the list of all components in the Layout. CPL file(Component Placement List / Pick & Place File (PNP) file), it is used by automated SMT Assembly machines to determine where each part should be located on the board.

PCB Manufacturing

Go to JLCPCBs website and Click on “Quote Now” and upload your Gerber File.

Once the Gerber file is uploaded, it will show you a preview of your circuit board. Make sure this is the PCB Layout of the board you want.

Below the PCB preview, you will see so many options such as PCB Quantity, Texture, Thickness, Color etc. Choose all that are necessary for you. Click on “Assemble your PCB boards”.

Now, you will have to upload the BOM and CPL file that we downloaded earlier.

Select all the components you want JLCPCB to assemble in your PCB. Simply click on the confirm box to select the components.

In this page, you can review your order. You can check the layout, see all the components and if there is any problem, you can click on “Go Back” to edit your order.

Once everything is done, click on “Save To Cart”. In the next page, you can choose a shipping and payment option and Check Out Securely. You can either use Paypal or Credit/Debit Card to pay.  

The PCB will be manufactured and shipped within days and will be delivered to your doorstep within the mentioned time period.

Once you get the PCB in hand, all you have to do is solder the header pins and connect the all the components.

Part 1 – Reading the Code from IR Remote

When we push a button on our remote controller, it sends some codes through the IR LED. In order to send those codes from our device, we first need to know them. For that we are going to use a TSOP 1738 IR receiver and an Arduino. Here I will be using an Arduino Nano. Connect the output pin of the IR receiver, which is on the left side, to pin 11 on the Arduino.

Installing the Arduino IR Remote Library

Now we will install the IR remote library. Simply go to Sketch->Include Library->Manage Library and search for Arduino IR Remote. Once it is done, go to examples and upload the IR demo sketch to the Arduino. Once it is done, start the serial monitor.

Now when we press the button on a remote pointing towards the receiver we should be able to see code in hexadecimal format in the serial monitor. Make a note of that and we are done with first step.

Code for Reading IR

#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  Serial.println("Enabling IRin");
  irrecv.enableIRIn();
  Serial.println("Enabled IRin");
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume();
  }
  delay(100);
}

Now start the serial monitor, point the remote controller to the IR receiver and press a button. You should see the HEX code in the serial monitor.

Part 2 – Replaying the Code

Now we know what to send. Let’s test it first on a breadboard. You will find the circuit diagram below.

Code for Replaying

#include <IRremote.h>
IRsend irsend;

void setup()
{
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);
}

void loop() {

  if(digitalRead(A0)==1)
  {
    irsend.sendSony(0xa90, 32); //enter the code here <----------
    delay(40);
  }
  
  else if(digitalRead(A1)==1)
  {
    irsend.sendSony(0xa90, 32); //enter the code here <----------
    delay(40);
  }  
  
  else if(digitalRead(A2)==1)
  {
   irsend.sendSony(0xa90, 32); //enter the code here <----------
    delay(40);
  }  
  
  else if(digitalRead(A3)==1)
  {
   irsend.sendSony(0xa90, 32); //enter the code here <----------
    delay(40);
  }
}

The program for the remote. Every button has its own if statement. If the button is pressed it will try to send its code by using the IR send through the IR LED.

Testing

Now point the remote to the gadget and press on buttons one by one and give it a quick test.

New to Robotics?

We have a beginners guide on “Getting Started with Robotics” which will give you a kick start in this field. Check out our free video tutorial below for a brief introduction.

Top Arduino Projects You can Try this Summer Vacation


Top Robotics Projects You can Try this Summer Vacation

Did you find this page useful? Help us to improve by rating this page.

[RICH_REVIEWS_FORM]

[RICH_REVIEWS_SNIPPET stars_only=”true”]

That’s It Guys!! Have Fun!

Similar Posts

Leave a Reply

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