Pages: [1]   Go Down
Author Topic: New library: IR remote send/receive  (Read 16464 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've written a new IR remote control library.  It handles both sending and receiving codes, and supports the Sony, NEC, RC5, and RC6 protocols.  For more details see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html

Please take a look and let me know if you have any suggestions, bugs, etc.
Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Anxious to try this. Very nice writeup.  smiley You might want to put it on the Playground.
Thanks!
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great work! Does it support multiple IR receivers on the same arduino board?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It doesn't currently support multiple IR receivers.

The easiest thing would be to AND the receiver outputs together (since the sensors are active-low) and provide this as a single input to the Arduino.  This would work if only one receiver is being used at a time, or if they are receiving the same signal.  You could also use multiple Arduino inputs and do this AND logic in the interrupt routine, testing if any of the inputs are low.

It would be fairly difficult to support multiple IR receivers that could receive different signals simultaneously, as each one would need to be tracked independently.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have tried your library and it works great. However when I used the  same arduino board for both sending and receiving IR data I noticed the following:
1. I couldn't receive the data I was sending, but I could receive data from other IR sources. The explanation probably here is that while IR data is sent, arduino is busy and the IR reception subsystem doesn't get a chance to record data.
2. I was receiving fine up until I sent the first byte via IR. From that point and further reception of IR data from any IR source stopped. Could this be some sort of "API interference" between IRsend and IRrecv?

The program is:

#include <IRremoteInt.h>
#include <IRremote.h>

// IRSendPin fixed to 3 (PWM)
int IRRecvPin = 11;

IRsend irsend;
IRrecv irrecv(IRRecvPin);
decode_results results;

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

void loop() {
  if (Serial.read() != -1) {
    for (int i = 0; i < 3; i++) {
      irsend.sendSony(0x90, smiley-cool; // Sony TV power code
      delay(100);
    }
  }
 
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}
« Last Edit: September 08, 2009, 06:20:52 pm by alsterg » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't use sending and receiving at the same time.  When you do a send, the receiving is disabled.  To re-enable it after sending you need to call:
 irrecv.enableIRIn(); // Start the receiver

Ken
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Ken,

I've tried your code and its work. I got this raw code "2FD807F"  when I press no 1 button on the remote. I am trying to make a small robot that can be control by remote.
Can you or somebody who read this  help me to trnslate this code to light an Led.

I will publish this project in my blog.

Thanks.
Logged


          http://arduinostudio.wordpress.com/

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,

does anyone have an idea, who to convert the codes from Adafruits TV-B gone, to be used by this library, for an Arduino based TV-B gone clone.

Alex
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm really confused. How do you put LIRC data into the library so that it detects it as a protocol and not as raw data?


This is the remote in question:
http://lirc.sourceforge.net/remotes/samsung/BN59-00940A
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 310
Posts: 40382
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How would you send RC5 : 820 ?  What needs to be replaced in your Sony example to make it work?  

Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 310
Posts: 40382
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got it.  To send RC5 (the magnavox protocol)  And code 20 (for turning the channel up) you would use this code:
Code:
#include <IRremote.h>
IRsend irsend;

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

void loop() {
  
    for (int i = 0; i < 3; i++) {
      irsend.sendRC5(0x20, 12); // 20 is the channel up code
      delay(50);
    }
}
Logged

The Big Smoke
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
Hacking and Slashing
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Had a bash with this Library myself, looks good and recognises my Sky Remote.


It does seem as 90% of the codes from the remote come through as "Unknown" whilst a few come through as the correct RC6 code.

I've picked up an TV controller (an IR extender basically). Cut the receiver cable, wired that up to the Arduino and stuck the signal cable (which runs back to the blaster) in the "transmit" pin.


ie:
Receiver >>>>>>>>> Blaster >>>>>>>> TV

Now

Receiver >>>> Arduino >>>> Blaster >>>> TV

The return path from the Arduino to blaster isn't working. I've tried the "Replay" feature of this library but no joy.

Hopefully I can figure it out. Does anyone have any tips? I notice the library doesn't technically support RC6.
Logged

Kuala Lumpur, Malaysia
Offline Offline
Full Member
***
Karma: 4
Posts: 175
Anything is possible
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I made the IR remote controller using the IR remote library and IR record examples... together with a 2x16 LCD on a breadboard.

It seems only NEC & Yamaha codes are working for me...whereas other IR signals once it is recorded, I am not able to produce the recorded IR signal ..

How to I troubleshoot this ?

How to I save those unknown signals to a header files ?

How can I boost or increase the IR signal ? I am using 220R between the Pin 3 to the IR transmitter..

Should I use a lower resistor for this ?

Thank you for reading this ...  smiley

Logged

Pages: [1]   Go Up
Jump to: