Help needed transmitting IR remote codes

So I bought an Arduino Uno last week and worked through the basic tutorials i could do with the equipment the kit i bought came with. Those went fine and I enjoyed them.

Now I'm working on my first project and the reason i bought an Arduino board in the first place. My goal is to use the Arduino, with the ethernet shield, to create an IR blaster for my home theater. The Arduino would wait for a connection from a program on my computer or an App on a smartphone and once connected, the program would send the Arduino codes which it will output via a few IR LED's therefore controlling my home theater.

To start, I'm trying just to read codes from my remotes and output them via the arduino. So far, the only thing that works is reading and repeating the codes from an Apple remote and controlling my Mac Mini. I was able to turn on my Xbox360 once but it wouldn't turn off and after that, it wouldn't work at all. My surround sound system and my TV have not responded to anything.

I've tried using Ken Shirriff's libraries but I can't get them to work. I've also tried using Ken's xbox360 update but that never worked.

When I read the power code from my Panasonic TV remote (N2QAYB000570), the code that's read by the Receive demo in Ken's Library isn't recognized, and I'm given the raw code.
Raw (76): 12726 3500 -1700 500 -400 450 -1250 500 -400 500 -350 500 -400 450 -400 500 -400 450 -400 500 -400 450 -400 500 -400 450 -400 500 -350 500 -1250 500 -400 450 -400 500 -400 450 -400 500 -400 450 -400 500 -350 500 -400 450 -400 500 -1250 500 -400 450 -400 500 -400 450 -400 500 -350 500 -400 500 -350 500 -400 450 -1300 450 -400 500 -1250 500 -1250 500

I could just use the "sendRaw" function but that requires the frequency the remote uses and I don't know that. I also have no idea how to find out.

Also to note: For my surround sound receiver, the code reader from the library reads it as NEC while the remote itself says its RC6. I tried sending it as both but neither worked.

I noticed in the comments on the blog post with the IR library, someone wrote a panasonic protocol but i couldn't get it to work. The receive function still didn't recognize code from my Panasonic TV remote. The send function produced compiler errors.

I have also tried using these tutorials from Ladyada (Here and here) but those also only worked for the Mac Mini again.

My circuit has been Arduino pinout -> 100 Ohm resistor -> IR LED -> Gnd. When checking to make sure the IR LED was even transmitting (with a camera), i noticed that the LED on the Arduino is much dimmer than the real remote. I removed the resistor and sure enough, it was brighter but still much dimmer than the real remote. I've seen places recommend a transistor and i plan on buying one to add but i don't see how it would help my current problems seeing as, even without the resistor, only the mac mini would work.

I apologize for the long post but I have spent 45 of the last 72 hours working on this to no avail. So my questions are these:

How can I get the IR libraries to work?
How can I find the frequency of IR signals without an oscilloscop?
What do i need to do to get the Panasonic protocol added and working?
Any general tips on getting this working or Arduino's in general?

sevs753:
My circuit has been Arduino pinout -> 100 Ohm resistor -> IR LED -> Gnd. When checking to make sure the IR LED was even transmitting (with a camera), i noticed that the LED on the Arduino is much dimmer than the real remote. I removed the resistor and sure enough, it was brighter but still much dimmer than the real remote. I've seen places recommend a transistor and i plan on buying one to add but i don't see how it would help my current problems seeing as, even without the resistor, only the mac mini would work.

Check the specs on the IR LED. Most plain red LED's operate on about 20 mA so a simple current limiting resistor is enough. The "High=power IR LED" from Radio Shack operates on 100 mA. If your particular LED draws more then about 30 mA you will need a transistor switch to protect the Arduino output which can only provide 40 mA maximum.

How can I find the frequency of IR signals without an oscilloscop?

Rig up a simple sensor directly into a digital pin. Now use the pulseIn() function to measure the period of the IR modulation from the remote.

The way you have wired your LED you will have a VERY low range; somewhere around 2-10 cm. So make sure your LED is literality touching the IR receiver of the device you are trying to control. This is why the LED will seem dimmer.

You can increase the range using an external power source and a transistor, but you can add that after you get everything working.

You can test the output frequency with trial an error if needed, but it is likely to be 36 or 38khz.

If you can’t decode the Panasonic code correctly then maybe try my version of Ken’s library. I made it so I could send and receive in the same sketch, but I have also added some extra protocols, Panasonic is one of them. That might help.

johnwasser:
Check the specs on the IR LED. Most plain red LED's operate on about 20 mA so a simple current limiting resistor is enough. The "High=power IR LED" from Radio Shack operates on 100 mA. If your particular LED draws more then about 30 mA you will need a transistor switch to protect the Arduino output which can only provide 40 mA maximum.

The IR LED i bought had these stats.
Radiant power output(100ma): 16mW min
Forward Voltage: 1.2V
Forward current: 100mA
Viewing angle to 1/2 intensity: 45deg
Wavelength: 940nm

What kind of transistor would i need to get? I went to radioshack today and no one there knew anything about this stuff. All they wanted to do was try to sell me a cell phone.

Targettio:
The way you have wired your LED you will have a VERY low range; somewhere around 2-10 cm. So make sure your LED is literality touching the IR receiver of the device you are trying to control. This is why the LED will seem dimmer.

You can increase the range using an external power source and a transistor, but you can add that after you get everything working.

You can test the output frequency with trial an error if needed, but it is likely to be 36 or 38khz.

If you can’t decode the Panasonic code correctly then maybe try my version of Ken’s library. I made it so I could send and receive in the same sketch, but I have also added some extra protocols, Panasonic is one of them. That might help.

I tried your library but i ran into problems. When i was testing all of this, i was literally holding the IR LED to the IR receiver on the device.

When I tried your IRrelay sketch, it couldnt decode my Panasonic TV remote. I noticed in the code that it seemed to only be checking the protocols that the original library had and not the new ones you added.

When i tried the IRReceiveDump sketch, it gave me these compiler errors:

IRrecvDump.cpp: In function 'void dump(decode_results*)':
IRrecvDump:44: error: 'SAMSUNG' was not declared in this scope
IRrecvDump:47: error: 'JVC' was not declared in this scope
IRrecvDump:50: error: 'Panasonic' was not declared in this scope

I tried sending the Raw code from my panasonic remote, but that didnt work either. I tried once with the negatives left in from the decode and once with the negative signs removed and that didn't work either. I grabbed the remote for my surround sound system and that decoded as NEC but the sendNEC function didn't work for that either.

I'm getting really frustrated with this project. I'm beginning to think it may be easier to make a quadcopter than to get this to work.

sevs753:

Targettio:
The way you have wired your LED you will have a VERY low range; somewhere around 2-10 cm. So make sure your LED is literality touching the IR receiver of the device you are trying to control. This is why the LED will seem dimmer.

You can increase the range using an external power source and a transistor, but you can add that after you get everything working.

You can test the output frequency with trial an error if needed, but it is likely to be 36 or 38khz.

If you can’t decode the Panasonic code correctly then maybe try my version of Ken’s library. I made it so I could send and receive in the same sketch, but I have also added some extra protocols, Panasonic is one of them. That might help.

I tried your library but i ran into problems. When i was testing all of this, i was literally holding the IR LED to the IR receiver on the device.

When I tried your IRrelay sketch, it couldnt decode my Panasonic TV remote. I noticed in the code that it seemed to only be checking the protocols that the original library had and not the new ones you added.

When i tried the IRReceiveDump sketch, it gave me these compiler errors:

IRrecvDump.cpp: In function 'void dump(decode_results*)':

IRrecvDump:44: error: 'SAMSUNG' was not declared in this scope
IRrecvDump:47: error: 'JVC' was not declared in this scope
IRrecvDump:50: error: 'Panasonic' was not declared in this scope




I tried sending the Raw code from my panasonic remote, but that didnt work either. I tried once with the negatives left in from the decode and once with the negative signs removed and that didn't work either. I grabbed the remote for my surround sound system and that decoded as NEC but the sendNEC function didn't work for that either. 


I'm getting really frustrated with this project. I'm beginning to think it may be easier to make a quadcopter than to get this to work.

The IRrelay is the same as Ken's original, I never got round to updating that one.

I have just checked IRReceiveDump and Panasonic should all be in capitals (I will update the git version later).

The fact if can't find samsung or jvc makes me think that it is still using Ken's IRremote.cpp and IRremote.h. Make sure you have completely removed his library from the library folder and then install my copy.

You will need to manually edit IRReceiveDump so panasonic in capitals.

Targettio:
The IRrelay is the same as Ken's original, I never got round to updating that one.

I have just checked IRReceiveDump and Panasonic should all be in capitals (I will update the git version later).

The fact if can't find samsung or jvc makes me think that it is still using Ken's IRremote.cpp and IRremote.h. Make sure you have completely removed his library from the library folder and then install my copy.

You will need to manually edit IRReceiveDump so panasonic in capitals.

I tried again tonight and I fixed the Panasonic capitalization problem and replaced thefiles in the library folder with yours. I had forgotten i put the files there.

IRReceiveDump compiled but my Panasonic TV remote is now showing up as "Unknown". It gets me a code in hex and the bits but thats it. Any ideas on why its not detecting as panasonic? Also, how would i find the address and dta for the send Panasonic function without using the decodePanasonic function?

I am not sure why it wouldn't detecting correctly. I simply copied the code from a blog, unfortunately I don't have a panasonic remote to test it with.

You can look up your remote on the LIRC list, if you can find it on there then you can use the hex code or possibly edit the library so it works for your remote.

http://lirc.sourceforge.net/remotes/panasonic/