IRLib Updated to Version 1.3

A new version of IRLib is now available on GitHub at

Down three IRLib is a library of code for Arduino-based microcontrollers that facilitates sending, receiving, decoding and analyzing infrared remote signals. Here is an overview of the changes.


    • Added new file IRLibRData.h and moved irparams structure and related items to that file. Allows users to create custom IRrecv classes
    • Rewrote Samsung36 example to include both send and receive
    • Added new examples for new protocols DirecTV and GIcable
    • Added new example IRanalyze gives more detailed analysis of timing. Useful in analyzing the protocols
    • Added new example IRfreq reports modulation frequency of a signal. Requires TSMP58000 IR learner chip
    • Cleanup of other example routines.
    • Created IRrecvBase class to allow custom receiver classes. IRrecv is now a derived class from it.
    • Created IRrecvLoop class which receives IR signals without using any hardware interrupts or timers. Also created IRrecvPCI class which uses Pin Change Interrupts to receive IR signals. These new receivers are more accurate than the 50µs timing of the original IRrecv. However they also have other limitations described in comments.
    • In IRrecvBase added “unsigned char Mark_Excess” with default value 100. Was a define macro but now is user settable.
    • In IRrecvBase added method “unsigned char getPinNum(void);” which retrieves the pin number used from irparams.recvpin. This value not normally accessible to end user.
    • Globally available function “void do_Blink(void);” blinks pin 13 LED. For use by user created extensions of IRrecvBase.
    • Data collected by IRrecvBase classes in irparams.rawbuf is now converted to actual microseconds rather than clock ticks of 50 µs each. IRrecvBase::GetResults has a new parameter “Time_per_Ticks” that is used to convert ticks into actual microseconds if needed.
    • Adjustments to mark and space to deal with overreporting and underreporting of intervals is now done once in IRrecvBase::GetResults eliminating the need for MATCH_MARK(d,v) and MATCH_SPACE(d,v). Just use MATCH(d,v) everywhere.
    • Modified IRLibsendBase::mark() and IRLibsendBase::space() to overcome limitations of “delayMicroseconds()”.
    • Changed many int to char or unsigned char to save memory
    • Eliminated DEBUG macro in IRLib.h and its use elsewhere. Macro TRACE is more useful.
    • Changed IRTYPES to unsigned char and a list of #defines rather than an enum (even though I still really like enums, changing it saves memory)
    • Code changes result in memory savings of approximately 54 bytes in code space and 39 bytes of RAM.

    For more information see my IRLib page.

Programmable Christmas Lights Using Arduino and Neopixels

satb100I have a little Christmas tree that I put up in my office every year that I call my “Charlie Brown tree”. It’s a scrawny looking little artificial tree with a little white Christmas balls on it and a strand of cheap flights. This year I decided to fancy it up a little bit by adding a 3 meter strand of Adafruit neopixels containing 90 pixels. I started out with the standard strand test sketch that is available from Adafruit and then modified it to add my own special patterns. I showed it on a recent Adafruit Saturday night Show-and-Tell Google+ video chat. There were a number of other Christmas displays shown that night but people seem to especially like my candy stripe pattern.

One viewer liked it so much he wrote me and asked me for the candy stripe code. He then incorporated it into his outdoor display and showed it in a subsequent Show-and-Tell a few weeks later. I had always intended to write a blog post about it and to include the code but I got so busy over the holidays that I didn’t have time to clean up the code and make it suitable for public sharing. The holidays are over and I’m finally getting around to sharing the code.

Here is a YouTube video showing a slightly earlier version of the pattern.

Here is the Adafruit Show-and-Tell on Google+ where I showed off the tree and my blinking Christmas card.

Here is the Show-and-Tell of the other guy named Kenneth who borrowed my candy stripe code. His display used a full 10 meters of pixels. Unfortunately there were bad audio problems that evening but I will put the video here anyway. His segment starts at about six minutes into the video.

Here are some links to the products used in this project. All were purchased from

Now finally here is the code edited for public consumption with comments.

Hope you find this code useful. Have a very Merry Christmas and a blessed new year.

Constant Current IR Driver Circuit

Our friends at AnalysIR who make Windows software to assist in decoding IR signals have come up with a nice schematic for a constant current IR LED driver circuit that we thought would be of interest to our users here. Here is a link to their blog post describing the circuit. We’ve not tested it out here yet but we have seen similar schematics and we trust these guys to do it right anyway. Their explanation of the circuit is outstanding.

  • AnalysIR blog post on constant current IR LED driver

They also have many other interesting articles in their blog and they have a user forum with lots of interesting information and exchange of ideas between users.