Go Down

Topic: Help needed to understand and make an IR Remote. (Read 4730 times) previous topic - next topic


Hi friends,
I'm new to electronics so please be patient with me ;)

I have a Leonardo board and i'm trying to make it communicate with my Samsung TV.
I've connected IR Led to PIN3 and tried to use IRremote library, but it seems that no singal is outputted (timer problem?!).

I've read a milion texts about IR and protocols, but I haven't found any SIMPLE (so I can see what is what) program to send signal.

IRremote dump from my Samsung remote gave:

Code: [Select]
E0E020DF (32 bits)
Raw (68): -28516 4450 -4450 550 -1650 600 -1650 550 -1650 600 -500 600 -550 550 -550 550 -550 600 -500 550 -1650 600 -1650 550 -1650 600 -500 600 -550 550 -550 550 -550 600 -500 600 -500 600 -500 600 -1650 550 -550 600 -500 600 -500 600 -550 550 -550 550 -1650 600 -1650 550 -550 550 -1650 550 -1650 600 -1600 600 -1650 600 -1600 600

Here's my remote:


And here is something that I think should be useful:


Thanks for all Your help :)


Jun 01, 2013, 12:48 pm Last Edit: Jun 02, 2013, 07:35 pm by power7net Reason: 1
Hi,you test it with IRrecord from Ken Shirriff's IR library? You must connect a button to send back the IR signal...or test it with IRsendDemo....change Sony with NEC protocol  and 32 bit....look my site for Samsung TV example....
Code: [Select]
irsend.sendNEC(0xE0E020DF, 32); // Samsung TV power code without for....loop...
I think the problem is the header pulses.Samsung header is 4450 -4450 ( look your raw ), NEC header is 9000 -4500 in this case you can follow this way.....http://learn.adafruit.com/ir-sensor/reading-ir-commands it definitely works...
but needs more work from user....modify this example...

Code: [Select]
   // This sketch will send out a Nikon D50 trigger signal (probably works with most Nikons)
   // See the full tutorial at http://www.ladyada.net/learn/sensors/ir.html
   // this code is public domain, please enjoy!
   int IRledPin = 13; // LED connected to digital pin 13
   // The setup() method runs once, when the sketch starts
   void setup() {
   // initialize the IR digital pin as an output:
   pinMode(IRledPin, OUTPUT);
   void loop()
   Serial.println("Sending IR signal");
   delay(60*1000); // wait one minute (60 seconds * 1000 milliseconds)
   // This procedure sends a 38KHz pulse to the IRledPin
   // for a certain # of microseconds. We'll use this whenever we need to send codes
   void pulseIR(long microsecs) {
   // we'll count down from the number of microseconds we are told to wait
   cli(); // this turns off any background interrupts
   while (microsecs > 0) {
   // 38 kHz is about 13 microseconds high and 13 microseconds low
   digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen
   delayMicroseconds(10); // hang out for 10 microseconds, you can also change this to 9 if its not working
   digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds
   delayMicroseconds(10); // hang out for 10 microseconds, you can also change this to 9 if its not working
   // so 26 microseconds altogether
   microsecs -= 26;
   sei(); // this turns them back on
   void SendNikonCode() {
   // This is the code for my particular Nikon, for others use the tutorial
   // to 'grab' the proper code from the remote
   delay(65); // wait 65 milliseconds before sending it again

My Toshiba TV , header pulses : 9000 4500
Code: [Select]
name  Toshiba_CT-9573
  bits           16
  eps            30
  aeps          100

  header       9107  4413

and works fine with sendNEC command (Ken Shirriff's IR library).....for NEC protocol...

Another solution is edit/modify the Ken Shirriff's IR library inside NEC protocol header, change it with 4500,4500...or make new protocol Samsung protocol....to help and others users...


thanks for Your help!!

I've tried IRrecord, still no good. I've also tried adding Samsung protocol (from Maarten Damen project). Also tried RC5 protocol on my other TV. As I said - it's seems that there is no output signal on IR LED (the diode doesn't flash when watching through camera). That's why I think the best way would be if I write my own program.

Some useful stuff You send me - thanks!! I'll get down to reading as soon as I have a while. But could You tell me, what can I read from that raw dump that I have from IRdump?
Does it tell for example: pulse IR for X time and wait for Y ?

Once again thank You for Your help.


Hi, Yes... pulseIR is On pulses PWM....delay() is wait...off...nothing...

Code: [Select]

    pulseIR(4450);//On PWM

Reply me if it works....check your IR LED also you must use PWM digital output...


Jun 02, 2013, 05:28 pm Last Edit: Jun 02, 2013, 05:29 pm by tbradt Reason: 1
Check out Ken Shirriff's IR library. It's very easy to use and quite stable. I beat my head over getting reliable IR signals back and forth forever before I found that.

He has a link to the code, along with some samples, on his blog.



Yes, yes, yes :) full success!! I used the plusIR and worked great! Three more, additional questions:
1) And what does this tell me? E0E020DF (32 bits) and could it be converted to raw singal?
2) Do You have any experience with RF remotes? The next step is to control my LED RGB stripe (I have a driver controlled by RF Remote)
3) Will You be in Poland any time soon? I'd like to buy You a beer or two for all Your help :)


I've tried IRremote lib - didn't work


Nice....Thanks....look....Your pulse is ....
Code: [Select]

pulseIR(4450);//On PWM Header
    delayMicroseconds(4450);//Off Header
    delayMicroseconds(1650); bit 1
    delayMicroseconds(600); bit 0

E0E0....is HEX number if you convert to binary is....1110000011100000......

If you visit my site i have a project to control IR devices from android via arduino and bluetooth module....
with extra RF module you can expand the range....

Go Up