Anda di halaman 1dari 15

٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

May 8, 2018

MaxPhi
Arduino Projects & Tutorials

 MAIN MENU
1.3k
Shares
Loggly uni es log monitoring, analysis,
1.3k
New Loggly 3.0 and the ability to x code in GitHub

‫ﺗﺣدﯾد اﻟﻠﻐﺔ‬
‫ﺗرﺟﻣﺔ‬ ‫ﺗدﻋﻣﮫ‬
ARDUINO PROJECTS

How to Decode IR Remote Control Signals using


Arduino
August 31, 2017 - by admin - 12 Comments.

We are going to decode the IR Remote Control using the arduino and IR remote library. We can also
decode any tv remote control. And use those tv remote control code in the arduino sketch to run any
application. As we have seen, some devices are running using the ir remote. There is some kind of IR
communication between the ir remote and the receiver devices who receive the ir signal. This is not the
simple IR transmitter and receiver as we use in different robotics and embedded sensors.

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 1/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

The transmitter IR  sends a frequency signal instead of a simple IR light. TV remote control or ir
remote send the signal at long distance it sends the signal at some frequency like 38KHz.

At the receiver side, we use the IR receiver which is compatible to receive the frequency signal sent from
the transmitter. If a signal is transmitted with a frequency of 38KHz then we need a receiver which is
capable of receiving the signal of 38KHz.

Available TSOP with Different Carrier Frequencies

TSOP  Frequency

TSOP1730 30KHz

TSOP1733 33KHz

TSOP1736 36KHz

TSOP1737 36.7

TSOP1738 38KHz

TSOP1740 40KHz

TSOP1756 56KHz

TSOP IR sensor receives a speci c frequency signal as given in the table.

The TSOP1733 receiver will receive the only 33KHz signal.

Why use TSOP Based IR Receiver

The simple IR sensor gives false detection when using in presence of the sunlight. The signal sends from
the normal IR led can not cover a long distance. TSOP is a complex IR sensor which can
differentiate between the actual signal send from IR remote and the sunlight. The data bits at transmitter
side are modulated at some frequency like 38KHz. TSOP receives it lter the noise and extract the original
signal.

Table of Contents [hide]

1 TSOP1738 Pinout
2 TSOP1738 Block Diagram
3 TSOP1738 Application Circuit
4 IR Remote Control Decoder Arduino Connection

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 2/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

5 TSOP IR Remote Control Receiver Arduino Circuit


5.1 IR Remote Control Decoded Output at Arduino Serial Terminal

TSOP1738 Pinout

TSOP1738 Block Diagram

TSOP1738 Application Circuit

Download IR Remote Library and place in Arduino/libraries folder.

IR Remote Control Decoder Arduino Connection

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 3/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

TSOP IR Remote Control Receiver Arduino Circuit

To decode the IR Remote Control we use the IRrecvDemo arduino sketch as given with the IR Remote
Library. And connect the TSOP1738 to the arduino as given in the circuit.

IRrecvDemo.ino

/* IRremote:
IRrecvDemo - demonstrates receiving IR codes with IRrecv

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 4/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder
An IR detector/demodulator must be connected to the input RECV_PIN.
Version 0.1 July, 2009
Copyright 2009 Ken Shirriff * http://arcfn.com
*/

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

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

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


}
}

Connect the output pin of TSOP1738 to Arduino digital pin 11 to get the decoded output
Write the IRrecvDemo.ino sketch to the Arduino
The open serial terminal at 9600 baud rate.
Press the IR Remote button while pointing remote towards the IR Receiver
You will see some hex value when pressing the button
Note Down
Repeat few times and make sure you are getting the same hex value for a single button.

IR Remote Control Decoded Output at Arduino Serial


Terminal

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 5/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

Here the hex value 1FE50AF is for button 1 and hex value 1FED827 is for button 2. So nally we decoded
the button from 0-9 with all hex code given in the table below.

Button Hex Value

0 0x1FEE01F

1 0x1FE50AF

2 0x1FED827

3 0x1FEF807

4 0x1FE30CF

5 0x1FEB04F

6 0x1FE708F

7 0x1FE00FF

8 0x1FEF00F

9 0x1FE9867

Now use these codes in arduino sketch. When these codes match with the stored one do something. Here
we have written the code that decodes the IR remote control button and shows the button number on the
serial monitor.

Decoding_0-9_Buttons.ino

/* Decode the IR Remote Control signal and display


the button/key name on the serial monitor using the
IRremote: IRrecvDemo https://www.pjrc.com/teensy/td_libs_IRremote.html.
www.maxphi.com April, 2017
*/

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) {
// Serial.println(results.value, HEX); //showing decoded data on serial t

switch(results.value)
{
case 0x1FE50AF: Serial.println("This is 1"); break; // Button 1
case 0x1FED827: Serial.println("This is 2"); break; // Button 2
case 0x1FEF807: Serial.println("This is 3"); break; // Button 3
case 0x1FE30CF: Serial.println("This is 4"); break; // Button 4
case 0x1FEB04F: Serial.println("This is 5"); break; // Button 5
case 0x1FE708F: Serial.println("This is 6"); break; // Button 6
case 0x1FE00FF: Serial.println("This is 7"); break; // Button 7

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 6/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder
case 0x1FEF00F: Serial.println("This is 8"); break; // Button 8
case 0x1FE9867: Serial.println("This is 9"); break; // Button 9
case 0x1FEE01F: Serial.println("This is 0"); break; // Button 0
}
irrecv.resume(); // Receive the next value
}
}

So from the above sketch, we can decode the button from 0-9 and displayed their name on the arduino
serial monitor.

Infrared Silicon Window Price -


optics-si.com
Ad China Leader Manufcturer For Optical
Silicon Products, Excellent Quality!
optics-si.com

Learn more

So nally we have learned how to decode the IR remote signal using the Arduino. We can make different
Arduino projects once we know the ir remote decoding. 

In our next Arduino tutorial, you can learn

How to make ir remote control car using Arduino


IR Home Automation using Arduino

RELATED POSTS

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 7/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

LM35 Temperature Sensor Arduino Project


August 31, 2017

GSM Based Home Security System Project using Arduino PIR Sensor
August 31, 2017

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 8/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

PIR Motion Sensor Alarm using Arduino


August 31, 2017

PREVIOUS ARTICLE NEXT ARTICLE


Arduino Software IDE How to Make a Motion Sensor Light Switch using
Arduino

About admin

View all posts by admin →

12 Comments on “How to Decode IR Remote Control Signals using


Arduino”

farming simulator 17 money October 21, 2017 at 3:55 pm

This i like. Thanks!

REPLY

Pingback: IR Remote Control Car | How To Make Remote Control Car Using Arduino

Chris J November 17, 2017 at 11:37 pm

can you explain please where the 0x comes from which is placed in front of the derived
codes

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 9/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

REPLY

admin November 24, 2017 at 5:14 am

Hello Chris J,
The received values are in hexadecimal as shown in the picture.
And while using those values in programming we should add the 0x before the
values.
This is simply a notation to write hexadecimal values so that compiler and IDE can
understand.

Comment on any other issues.

Thanks

REPLY

farzin January 9, 2018 at 12:35 am

I want to receive remote TV signal by Arduino and send it back to Ardino to tv the program
code show me?

REPLY

admin January 12, 2018 at 12:36 pm

Hello farzin,
Step 1: Receive/Decode the TV signal according to the tutorial.
Step 2: Use the below code to generate/transmit the IR signal from arduino.
#include

IRsend irsend;

void setup()
{
Serial.begin(9600);
}

void loop() {
irsend.sendNEC(0x1FE50AF,56); // replace 0x1FE50AF hex code by your received
code
delay(40);
}
Step 3: Apply some condition when to execute the irsend.sendNEC(); function

Try this and ask if you have any doubt.


Thanks

REPLY

farzin January 13, 2018 at 1:01 pm

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 10/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

Hello admin
you send cod ialternative hex code tv samsung remote control
E0E040BF key power but No effect on performance.

i want recieve remote controle signal byIR reciever and send it to IR


transmitter for commonicate between remote control and TV by IR
transmitter . i use arduino and need a code to planning this one . what should i
do ?

REPLY

admin January 16, 2018 at 9:04 am

Hello Farzin,
You just try to decode the code of your TV Remote. If yes, then give me
all the code.
Then I can help you later.
or
Here my remote work for(NEC) irsend.sendNEC();
{irsend.sendNEC(0x1FE50AF,56);}
What work for you try it.
There are a few common protocols the IR Arduino library supports.
They are: NEC, Sony SIRC, Philips RC5, Philips RC6, and raw formats.
Here are the methods you can use in your Arduino code for different
manufacturers:

sendNEC();
sendSony();
sendRC5();
sendRC6();
sendDISH();
sendSharp();
sendPanasonic();
sendJVC();
sendRaw();
Hope you got my point.
Thanks

REPLY

farzin January 19, 2018 at 1:14 pm

Hello admin
I can give you all of codes.
I want planning that send information from all remote control to
their reciever . my target is reciever sattlite.
Thank you very much for your help

farzin January 26, 2018 at 9:05 pm

Hello admin
my cod
power 20DE50AF
OK 20DEB04F

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 11/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

mute 20DE9867
1 20DE807F
2 20DE40BF

/* send.ino Example sketch for IRLib2


* Illustrates how to send a code.
*/
#include // First include the send base
//Now include only the protocols you wish to actually use.
//The lowest numbered protocol should be rst but remainder
//can be any order.
#include
#include
#include // After all protocols, include this
// All of the above automatically creates a universal sending
// class called “IRsend” containing only the protocols you want.
// Now declare an instance of that sender.

IRsend mySender;

void setup() {
Serial.begin(9600);
delay(2000); while (!Serial); //delay for Leonardo
Serial.println(F(“Every time you press a key is a serial monitor we will send.”));
}

void loop() {
if (Serial.read() != -1) {
//send a code every time a character is received from the
// serial port. You could modify this sketch to send when you
// push a button connected to an digital input pin.
//Substitute values and protocols in the following statement
// for device you have available.
mySender.send(NEC,0x20DE50AF, 32);
//mySender.send(NEC,0x20DE50AF,32);//NEC TV power button=0x20DE50AF
Serial.println(F(“Sent signal.”));
}
}

Infrared Silicon Window Price


- optics-si.com
Ad China Leader Manufcturer For Optical
Silicon Products, Excellent Quality!
optics-si.com

Learn more

Given the above code, how can I send the same code by pressing the same button?

REPLY

ike February 22, 2018 at 1:12 pm

please, I want to design an infrared remote control system for 1 light and fan with speed
regulation using ardruino. can you please help me out.

REPLY

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 12/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

admin February 23, 2018 at 7:13 am

Hi ike,
I can help you, but without speed regulation of FAN.
The system will simply ON and OFF both the systems with two respective switches.
If you are interested then comment below.

Thanks
MaxPhi.com

REPLY

Leave a Reply
Your email address will not be published. Required elds are marked *

COMMENT

NAME *

EMAIL *

WEBSITE

 +  6  = 

POST COMMENT

Search … SEARCH

Need Help in Your Electronics Project?


Are you facing problem in making your electronics project? We can make a project and guide you at the very affordable amount. Enquiry about your
project.

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 13/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

Name

Email

Mobile

Project Title

Write about your project...

SEND

CATEGORIES

Arduino Books

Arduino Projects

Arduino Tutorials

AVR Projects

Project Ideas

Ad qatarairways.com More ▼

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 14/15
٢٠١٨/٥/٨ IR Remote Control Decoder Using Arduino | IR Remote Decoder

RECENT POSTS

5 Arduino Cookbooks Review: Why You Should Read Before Buying

10+ Arduino Programming Books for Beginners – A Complete Review

Electronics Projects List

Arduino Buzzer Tutorial And How To Use It With Arduino Board

DTMF Controlled Home Automation using AVR Microcontroller and LCD Display

New Loggly 3.0


Loggly uni es log monitoring,
analysis, and the ability to x code
in GitHub

About Us

Contact Us

Copyright © 2018 MaxPhi. All rights reserved. | Privacy Policy | Sitemap

Powered by WordPress and HitMag.

https://www.maxphi.com/ir-remote-control-decoder-using-arduino 15/15