I developed this infrared remote control decoder for Arduino on my Arduino-compatible STK500 evaluation board for Atmel’s AVRs.

The sketch is pretty much standard C code so porting to non-arduino dev systems is almost immediate.

Remote control receiver / decoder for Arduino

I actually developed the code in C for a smaller ATtiny24 for a specific project underway thenI adapted it for Arduino and made available to anyone whom might need it.

The sketch expects the IR receiver on digital pin 8 and is in the form of a demo where 4 LEDs on digital output 4, 5, 6 and 7 are turned ON on my STK500 (microprocessor’s output connected to LEDs’ cathodes) when keys 1 2 3 and 4 are received from the remote. The power button on the remote turns all LEDs OFF.

The code also ouputs the received code to the serial port to be read on the serial console (9600 Baud-8-N-1) .

Any RC5 Philips TV remote control seems to be fine and the few programmable ones I tried work fine. Feedbacks are welcome.

…yes, one day I`m buying a real Arduino !

The sketch for Arduino is here.

IMPORTANT : should you experience problems with random resets, read Mark Arduino’s comment on Jan 24, 2010 at 1:06 pm.

Enjoy.

53 Responses to “Infrared remote control receiver for Arduino”

  1. admin says:

    Thank you.
    It should work fine with other AVRs. The resources needed are basic and are present on most of them.
    Actually it started as code for the ATtiny24 but, silly me, I modified the source when moved to Arduino. I remember very well that the steps needed to do the move where just a few.
    If you do the job and intend to publish somewhere, just remember to include the CC license heading !
    Ciao
    A.

  2. sebula says:

    Hi Admin
    It seems that once we are using this library, pin 3 and 11 cannot be used in PWM anymore
    this may be related to the library “tweaking” timer2

    do you have any information on that, is it a known “bug” and is there a way to have all PWM outputs work when running irremote library ?

  3. admin says:

    Hello,
    My code actually uses Timer0, so its relevant PWM outputs (OC0A and OC0B, PD6 and PD5 of the ATmega168, J1 pin5 and pin6 of the Arduino NG Diecimila) cannot be used for PWM, just for regular I/O as long as they are kept disconnected from Timer0 (registers TCCR0A, my code takes care of this).
    I don’t know what use of Timer2 do other libraries. I may say that it is not easy to know what Arduino’s libraries do with the micro’s resources, one might look at the code, but a sort of heading with the libraries descriptions would be quite helpful for the tweakers.
    Hope this helps
    Best
    Alessandro

Leave a Reply

(required)

(required)

Spam Protection by WP-SpamFree