The Ultimate Remote is Dead. Long Live the Ultimate Remote 2.0

In late 2015 I built a piece of assistive technology that I called my Ultimate Remote. The device was an infrared remote for controlling my TV and cable box. It also had infrared mouse control for my computers. There were also limited keyboard commands mostly arrow keys, enter key, backspace and some control keys for doing cut-and-paste. Finally it was a Bluetooth device for doing accessibility switch control on my iPhone. I wrote about it in this blog post from January 2016.

The Ultimate Remote Control and Why I Built It

The core of it was an Adafruit Micro BLE device which was discontinued shortly after I purchased it. Adafruit replaced it with the Adafruit Feather 32u4 BLE. The Micro BLE also had an ATMega32u4 which is one of my favorite 8-bit processors.

The display was a monochrome 1.3 inch 128×64 OLED graphic display. It also contained one of my infrared I/O boards although it only did output. I didn’t really need to read any IR codes. On the end of a long wire were three lever micro switches that I would hold in my right hand to control the device.

The device served me well for well over a year. It was critical to me during my recent hospital stay where I was on a ventilator and could not talk. I used the switch control to type notepad messages on my iPhone and communicate with the nurses and doctors. You can read about that adventure here.

Pray That They Listen to the Man with No Voice

The micro switches have always been the weakest link in my devices. I have to use switches that have a feather touch to them and that means they are very fragile. The switches get knocked around quite a bit and so it was inevitable that one of them would break. About a week ago one of the switches failed and we had to replace them.

I had planned for many months to rebuild the entire device. I had used up all of the program memory in the device and could not add any new features or any new IR commands. I did not have codes installed for my Blu-ray player and there wasn’t any room left. In fact one time I had tried to recompile the code and because one of the included libraries had been updated, the code wouldn’t fit anymore. I don’t know if it was the Bluetooth BLE library or the graphics display library but something changed. I had to go through my code and try to free up some space by eliminating some error messages or shortening other messages. I finally got it to recompile but the writing was on the wall that I needed to upgrade.

The obvious choice was to use a new Adafruit Feather M0 BLE. Instead of the traditional 8-bit 32u4 running at 16 MHz with 32K flash memory and 2.5K RAM, I would have a 32-bit ARM Cortex M0+ running at 48 MHz, with 256K flash memory and 32K of RAM. The main problem was that my infrared library IRLib did not support these newer 32-bit ARM processors.

I had just recently spent weeks researching the new processor and converting my infrared library to support the newer chips. The timing and frequency modulation portions of my IR code are extremely dependent on the internal timers of the processor and that is very hardware dependent. I had to learn a whole new system of timers and PWM frequency control to rewrite the code. Fortunately I got it running just in time.

Although I had the infrared code working on the new processor, and had a Feather M0 BLE available to build a new device, it should not have been necessary to rush the new device into construction. All we had to do was repair the old remote by replacing the micro switches. I already had another set of switches assembled in anticipation of building the new remote. All we had to do was cut the cable on the old one, splice in the new cable and everything would be fine.

Dad decided that rather than having a stiff, unsightly splice in the middle of my cable, he would open up the box, unsolder the old cable and solder on the new cable. He ended up completely disassembling everything to get at the wires that needed replacing. I appreciated that he would go to that trouble even though this device was going to get replaced probably in a month or two. Unfortunately this was a bad decision.

Above are photos of the interior of my original ultimate remote. As you can see the wiring is pretty complicated. Unfortunately I only have about four different colors of wires available so we had to use the same color wires for different purposes. For example there are multiple green wires used for different purposes. After replacing the cable to the micro switches, dad tried to plug everything back in the way it was. We plugged in the device and I tried pushing the buttons but nothing would happen. In the course of trying to figure out what was wrong he touched one of the infrared LEDs and discovered that it was very nearly becoming more red than infra. It was too hot to touch. Although we did not get a visit from the infamous “Blue Smoke Monster”, if we had left it connected very long we would’ve had at least smoke and possibly fire as well.

It didn’t take us long to find out that the culprit was 2 green wires that had been crossed. We fixed the wiring and plugged it back in. No heat this time. The device worked intermittently for about five minutes and then quit working altogether. It was obvious that we had burned out the IR LED at least and possibly the transistors driving them.

Fortunately I had sufficient parts to build a new IR output board so we spent the next afternoon building it and installing it. It would not work either! One of the problems we were facing was that we had assembled and disassembled the box many times. I had been using small gauge stranded wire with silicone insulation. That is very flexible and made it easy to route the wires in a tiny box. However several of these wires were soldered into through hole locations on the circuit boards. Right at the point where they are soldered in, they are extremely susceptible to breaking if they are bent back and forth too many times. A better solution would have been to put a header pin in the hole. Then we could solder the stranded wire onto the pin and cover it with a piece of heat shrink tubing. At this point it was too late to do that.

We tried repeatedly to diagnose the problem with the new IR board but every time we fixed one thing, something else would break. There was also the possibility that we had damaged the Adafruit Micro BLE board itself. As I mentioned earlier, that board has been discontinued so there was no possibility of replacing it. After two full afternoons of working on it, I decided to throw in the towel and put all of our efforts into building the completely new device that had been planning for months.

I had all of the necessary parts. The new device would have a much larger 2.4 inch TFT color graphics display instead of the 1.3 inch monochrome OLED. This device also features a resistive touchscreen however I don’t have any use for that feature. It also includes a slot for an SD memory card. I may come up with a future use for that.

One of the nice things about the Feather Wing TFT board is that the feather board plugs into a socket in the backside. You don’t have to run wires from the main processor to the display board. However one of the disadvantages is that there is only one power and one ground pin on the device. So I was going to have to cut up a little piece of prototype board to make a power and a ground bus. This would bring in power from the outside, connected to the Feather and display boards, and run power to the infrared board. Similarly I needed ground wires to all of those parts plus a ground wire for the micro switches. We also needed to solder a jumper so that I can turn the backlight of the display off and on. There is a solder pad available but you have to jumper it to one of your Feather pins.

Although the Feather boards have a built-in battery connector and a battery charging circuit, I decided to power the device from an external 5v battery source. My old Ultimate Remote was a 5v device throughout while the Feather system runs on 3.3v. In the old system I had a short cable with a barrel jack running from the remote into a battery pack I call a Printy Boost. The Printy Boost is a device which I designed for the Adafruit Learning System as seen here. The Printy Boost also provides extended battery life to power my iPhone. So rather than have a separate battery for the remote and for the iPhone backup power I decided I would stick with the old system and run a cable from the Printy Boost into the remote just like I did before. Rather than connect to the +3.3v pin I connected to me “USB” pin which was the same as powering it through the USB cable at 5v.

There are some differences between the Feather TFT board and the old monochrome OLED graphics board so I had to tinker with the software to get things to run. Most of it was compatible because Most of the Boards operate on the Adafruit Graphics library but there are still differences. Once I had display software converted I tried using the device. Unfortunately it didn’t work again! You would think I would be more careful about crossed wires after the previous fiasco. It turns out we had the infrared I/O board wired backwards. I had drawn the wiring diagram looking at the front side of the IR board. That means on the right 2 pins are power and ground. Then moving to the left you skip one pin and the next one is the IR output. However the way the board is oriented in the device, the backside of the board is facing upwards. We wired it with power and ground on the right but that was wrong. Fortunately this just meant that the power lines were going to the receiver pins which were not being used in this application. So nothing burned out. We reversed the wiring and everything worked fine.

The final step was to design a 3D printed enclosure for the device. That took another afternoon or so.

We mounted the TFT display into the lid of the box using black nylon plastic screws and nuts out of this kit sold by Adafruit. They are really handy because they are selected to fit in the 0.1 inches diameter mounting holes used in most Adafruit boards. When that box of screws was first added to the Adafruit catalog I knew I would need them someday and purchased it right away. They work perfectly so it was a great purchase.

The rest of the box is held together by 5/8 inch sheet metal screws. I like using sheet metal screws because they have a pointy end that taps really well into 3D printed PLA plastic. Here are some more photos of the completed project.

There are still lots of software tweaks I have to implement. It takes longer to erase a 320×240 color display than it does to erase a 128×64 monochrome display. The monochrome device required you to call a “display” method to update the display after writing to it. The new color device updates as you write to it. The result is you can see the screen update where the old one would update instantly. I think the updates actually slow down the entire process a little bit. So I’m going to have to optimize the code so that it only updates the screen when absolutely necessary and only does it in small pieces. In the old system it was easy to just erase everything and redraw it from scratch every time but that won’t work very well in the new system.

Of course I also have to add all the features I’ve been wanting to add but didn’t have sufficient memory under the old system. I have to add all the codes for my Blu-ray player and there are some additional keyboard codes that I want to add. I may end up implementing an entire keyboard system so that I can type anything using IR codes. I’ve developed a special protocol for my IR library that allows me to use any mouse or keyboard commands possible. I’ve only been using a fraction of that capability.

One other difference between the old and new system involves the power output of the IR board. When I originally designed my infrared I/O board I ran the LEDs with no current limiting resistors. Because the LEDs are only intermittently running (assuming you don’t cross your wires), it’s safe to put more than 1 amp through them. But my experience is that sometimes USB power can’t supply enough power when that current spikes during transmission. So I’ve added some 33 ohms current limiting resistors in line with the LEDs on the latest version of my infrared I/O board. The old device did not have these resistors but it ran well because it was powered by a battery pack rather than a USB plug. Now that I’ve worked with the new remote I’m realizing it doesn’t have the power of the old one. I’m going to try shorting across those resistors and see if it helps.

I still have fond memories of my original Ultimate Remote. It served me well for over a year and was literarily a lifesaver while I was in the hospital. But I’m also looking forward to the new things I will be able to do with the new improved Ultimate Remote 2.0.

Afterward: After I completed the project I presented it on the weekly Adafruit Show-and-Tell. I was the first guest in the video below.

IRLib 2.02 Increases Support for SAMD 21

A few weeks ago we released IRLib 2.01 with preliminary support for SAMD 21 processors such as used in Arduino Zero and Adafruit Feather M0 boards. Then initial release had many hardcoded values. For example output was only available on pin 9 and the timer interrupt for the 50 µs receiver class was hardcoded to use TC3.

In our latest release IRLib 2.02 you now can use any available PWM pin on your platform for output by editing values in IRLibProtocols/IRLibSAMD21.h

You can now also choose to use TC4 or TC5 to drive the hardware interrupt for the 50 µs receiver class.

Both sending and receiving use GCLK0. Note that typically GCLK0-GCLK3 are reserved for internal Arduino infrastructure use however we are using GCLK0 with its default clock source of 48 MHz and a divisor of 1. Because we are not modifying those defaults, it is safe to use. That allows you complete freedom to use GCLK4-GCLK7 for other purposes.

The code has been tested on Arduino Zero, Arduino M0 Pro, and Adafruit Feather M0 BLE boards successfully.

The code is available now on GitHub at

Announcing the Release of IRLib2

We are pleased to announce a new version of IRLib library for receiving, decoded, and sending infrared signals using an Arduino. This represents months of work and is a major restructuring of the code to make it easier to include only those protocols that your application actually uses. Unfortunately the restructuring is so significant that it is not backwards compatible with our original IRLib1. It is however relatively easy to update your applications to use the new libraries. We will continue to leave IRLib 1.x in its original repository on GitHub. We have created a new repository for IRLib2. There will be no new updates to the original version of the code. Because we have changed the name to IRLib2 it is possible to have both versions available in your Arduino libraries folder at the same time without conflict.

Also included is a new feature called “auto resume” which ensures that you can continue receiving a second frame of data while processing the first frame.

The users manual has been expanded to 117 pages and not only includes the complete reference to all classes, methods, and variables that we had before, it also contains a new tutorial section which thoroughly explains all of the sample sketches. And finally we have the long-awaited tutorial on how to create new protocols for the library. You will also want to check out Appendix A which explains the changes between IRLib1 and IRLib2 as well as my rationale for the restructuring and the need to make it no longer backwards compatible.

The users manual is available in Microsoft Word, Adobe PDF, and EPUB formats in the GitHub repository. We will no longer be maintaining online HTML version of the documentation because it was too difficult to split into individual webpages and maintain it for this blog. However the supplied formats should be sufficient for all users.

Although we have thoroughly tested the code, it technically is version beta 0.1. If no major bugs are reported in a month or two we will upgrade it to official version 2.0 release.

We can’t wait to see what all of you will do with IRLib2. Please let us know how you are using the code.

R.I.P. Pinoccio… It Was Fun While It Lasted


Pinoccio Wi-Fi Development Board

I’m a tiny bit sad to report the death of Pinoccio. Note that the missing “H” is deliberate. I’m not talking about Pinocchio the beloved character from children’s literature. I’m talking about “Pinoccio” (without the “H”) open-source semi-Arduino-compatible hardware and software platform. Actually to say that I’m reporting it is a bit of yesterday’s news. It was actually reported here in a blog post on their website dated March 30, 2015. The reason I didn’t see that blog post right away is that I had pretty much given up on the system several months earlier.

Here’s a bit of history… In late 2012 or early 2013 I became aware of this Indiegogo campaign titled “Pinoccio – A Complete Ecosystem Building of the Internet of Things” It was a small 1″ x 2″ Arduino compatible board using a chip similar to the one used by the Arduino Mega. This variety had a built in mesh radio such as used by the X-Bee system. It had a built-in LiPo battery, an RGB LED, a temperature sensor and a Wi-Fi backpack. You could connect to one of the units called a Lead Scout via Wi-Fi and then it would communicate to the other units over mesh radio which were known as Field Scouts. I quickly signed up at the $149 support level which would get me a Lead Scout and a Field Scout. Although the units were a bit pricey, if you added up what it would cost to buy an Arduino Mega, battery, charger circuit, X-Bee radio, and Wi-Fi module it seemed like a bargain at the time. They were seeking $60,000 in funding and end up raising over $105,000. Put this in proper context note that this was several months before Spark Core appeared on Kickstarter. Note that Spark Core has recently rebranded as

Had Pinoccio made its original delivery date of July 2013 they would’ve beaten everyone to market and would’ve been a major player in the Internet of Things movement. There were plans for a smaller version without the battery and sensors that would’ve been easier to embed into production products. There were plans for a variety of backpacks or shields including the one I was most anxious to see… infrared LED and receiver. My goal was to use it to create an Internet capable IR remote. I wanted to create an inexpensive alternative to the RedEye IR Remote from ThinkFlood. And it was a good thing I was planning such because ThinkFlood was shutting down as seen here.

My Pinoccho boards upon arrival.

My Pinoccho boards upon arrival.

The folks from Pinoccio quickly learned the hard lessons of crowd sourced funding. Lesson number one is inevitably “If you’ve got a great idea it’s easier to raise money then it is to bring a product to market.” I won’t bother to recount the litany of things that caused multiple delays but the bottom line is that backers did not get their units until April 2014 a full 10 months past the initial estimated delivery. The reasons were the usual things: finding suppliers, finding someone to make the boards, setting up the business itself. It seemed that the main reason/excuse for delays was that “We want to get the software right.” Here is my blog post which gave my initial positive reaction to the devices when they finally arrived.

The software that we waited so long to finally get was indeed quite extensive. There was an Internet portal called that allowed you to do many things without even writing any code. And it included an extensive script language that you could write small programs directly from the HQ application without having to use the Arduino IDE or do any C++ coding. They wanted you to be able to plug the thing in and do something with it right away. That ability is one of the key things that led to the success of the original Arduino. With a built in RGB LED and temperature sensor, you could do more than just blank the LED on pin 13 like you can with Arduino out-of-the-box.

However if you wanted to write your own applications, the learning curve at least for me was very steep. I had no experience in connecting devices to the web. I did know quite a bit of JavaScript programming, CSS, and DOM HTML programming which was useful. I had a little bit of experience with PHP however that did not apply in this case. What I did not have any idea how to do what is called “asynchronous communication” with Web servers.

I was taught as a programmer from day one that execution of a program started at the top of the main module and went step-by-step through the module sequentially unless modified by the if/then/else or some sort of loop structure. But asynchronous coding is something significantly different. You make a request to a Web server and within that request, you send it the code that you want to execute when it finishes the job. That seems simple enough. I figured it would call the code when it was ready and then move on to the next step. But it doesn’t work that way. You move on to the next step immediately after making the request and you have no idea when it’s going to complete that request and invoke your callback function. I would make a request from the server for a piece of information. My callback function would tell the server where to put that information in my program. Then I would try to display that information on the webpage. But it was never there. When I would insert debugging code to see why it wasn’t there, it was there. It reminded me of the paranoid poem about the little man on the stair.

“Last night I saw on the stair
The little man who wasn’t there.
He wasn’t there again today.
Oh how I wish he’d go away.”

I was being haunted by the returned data that wasn’t there 🙂

What I didn’t understand was that this callback function wasn’t a normal subroutine where you call it, it executes, and when it returns you carry on. You have to carry on immediately after the request and you don’t know how long it’s going to take for the Web server to return your data. So you have to put something in the callback function that tells your main program “Hey he finally got what you asked for. You can use it now. It’s really here.”

When you are collecting several pieces of data in a row and you don’t want to proceed until you’ve got them all, the nested callback functions can get pretty hairy. It took me a long time to figure out what I was doing wrong. It also took a lot of patience on the part of the people from Pinoccio in their support forums to walk me through my inadequacies is particular area of programming. I owe them a tremendous debt of thanks. (Humorous note here… When I dictated the previous sentence using my dictation software, it misunderstood me and said “I/O them…”. How appropriate for a “.io” system). Anyway they were most gracious and patient with me.

I did my best to pay back their kindness. I blogged everything I could about the device. I showed it off on the Adafruit Google+ Hangout Show-and-Tell. I blogged about how to get around some SSL certificate problems that cropped up along the way. And I did my best to educate them in the hardware requirements necessary to make an infrared backpack for the Pinoccio system. And ultimately I did get a working Internet-of-Things infrared remote that I used to operate my TV and cable box.

My cable box is located in the living room but I have an HDMI cable that runs into my adjacent office so that I can watch the same thing my dad is watching and living room. I can get on a webpage in the office and control the cable box in the living room. I used it every day for several months and it was a real godsend. I succeeded in replacing my defunct and unsupported RedEye remote.

I included Pinoccio support in my next public release of my infrared library IRLib. I began cleaning up my asynchronous webpage code and preparing to publish it to share with the world everything I have learned so that the next novice who came along would have a clear and simple tutorial to follow I would not have to bother the people in the support forum to learn the things I have learned the hard way.

One of the things that bothered me about the entire system was that it was totally dependent upon the website servers were maintained by the Pinoccio organization. On occasion, their server would crash and I would be stuck with a useless system. I asked them what do we do to remove that dependence. The old RedEye remote system was accessed directly to the local IP address of the device itself. It also included its own Web server in the device. In contrast the Pinoccio system required me to make my own webpage to control the device (as great as HQ was it wasn’t sufficient). That meant I had to install a Web server on my PC. I can only control the system from that PC unless I uploaded the webpage to which I didn’t want to do. Setting up WampServer on my PC was much easier than I anticipated. That allowed me to host my controlling webpage with no problem.

Furthermore my webpage could not communicate with the device directly. It had to go through their servers. My controlling webpage went to a URL on their server and their server connected back to the device itself. The whole point of Pinoccio, for me at least, was to replace the defunct out of business RedEye Remote. What was I going to do if Pinoccio ever folded? They assured me that they were working on a system that would allow direct connections without going through their server system. And in the end they did so.. They developed a system where you could plug one Scout into a PC and have it communicate directly with the other Scouts using the mesh radio. You didn’t need the Wi-Fi at all. They called it a “Bridge Scout”. While that was of suited my purpose, still wouldn’t have given me all of the capabilities the device should have had. There supposedly is a way to set up one’s own server that would duplicate their part of the infrastructure. I believe them when they tell me that. However doing that myself would required another steep learning curve that I didn’t really feel like attempting. It would require more than I can get out of WampServer. It involved node.JS and a variety of other things that were beyond me.

Unfortunately somewhere along the way the device got a bit glitchy. There were constant software updates some of which I kept up with and some I did not. After not doing updates for several months, I finally decided to do an update in hopes of fixing the glitches. The end result was my device quit working altogether. I spent a couple of weeks presuming that the problem was an adverse interaction between my infrared code and their systems software. It involved going onto GitHub and figuring out which version of the software I had been using that was working somewhat well and then individually applying each and every update that had occurred over the period of several months. I finally found the patch that was causing my code to crash. In the end it was not an adverse reaction between my infrared code and their system. I was able to whittle it down to an example that did not include my IR code at all.

Somewhere in the midst of all this, I ended up “bricking” my lead scout. Somehow during a crash, the boot loader was overwritten. They talked me through a system wherein you could use one Scout as an ISP to restore the boot loader on a broken Scout. Initially that process did not work because I tried to do it with the Wi-Fi backpack still installed. Somewhere along the way while adding and removing the Wi-Fi backpack without disconnecting the power, I permanently damaged the Wi-Fi backpack. That meant that the so-called “Ecosystem for the Internet of Things” was no longer Internet capable. A replacement Wi-Fi backpack would cost $79. I was able to get the system running somewhat using the bridge Scout they described where you had to keep one unit plugged into a PC to communicate with another unit. However I had become frustrated with the whole thing and needed to get away from it for a while.

arduino_yunI ended up ordering an Arduino Yun from I immediately fell in love with the device. It consists of a powerful microprocessor running a minimal version of Linux and an Arduino Leonardo in one device. The communication between the Leonardo and the Linux was well defined and easy to use. The Linux portion did include its own Web server. You could also update the onboard Arduino sketch and the associated webpage using the latest Arduino IDE and do so wirelessly for Wi-Fi. That ability to update wirelessly was something that Pinoccio had promised from the beginning but never did fully implement at least from a users perspective. They did allow you to update system software wirelessly but not user programs at the Arduino level.

Although I did have the Pinoccio experience under my belt along with the experience of doing asynchronous callbacks to Web servers, setting up my IR remote on the Arduino Yun took me only a day and a half rather than the weeks and weeks of frustration that I had with Pinoccio. One of the things that was probably the nail in the coffin of Pinoccio for me personally was the fact that I could buy an Arduino Yun with its embedded Linux, Wi-Fi, Arduino Leonardo, and built-in Web server with no external infrastructure needed for about $75. That was four dollars less than the Wi-Fi backpack alone for Pinoccio.

With the success of modules like the CC3000, Particle a.k.a. Spark Core, and the amazing new and inexpensive ESP8266 there was no hope for Pinoccio. They might have salvaged it by ditching their own Wi-Fi backpack and making a backpack using the ESP8266.

My intent had been to take a break from Pinoccio after I got the other system up and running. I still felt like I owed them those tutorial blogs to help other Pinoccio users not have to go through the blood sweat and tears that I’ve been through. But I got distracted with other projects and never was able to do it. Now of course there is no more Pinoccio. Their servers are shutting down at the end of the month and anyone who hasn’t figured out how to launch their own server or who is content with using bridge mode is going to be out of luck.

Ironically my old RedEye Remote has in some ways outlasted the Pinoccio. Even ThinkFlood shut down over two years ago, you could still use their device as long as you didn’t need to update the software. I’ve been using mine as an Internet remote to control my bedroom TV and cable box in the same way I’m using the Arduino Yun for the living room. However I recently purchased a new TV in the bedroom and I cannot update the RedEye with the new codes. I had to order another Arduino Yun.

I had a bit of a scare because the Yun has been out of stock at Adafruit for a couple of months now. Fortunately I found one at my second favorite supplier I’m pretty sure that the shortage is a consequence of the trademark disputes between and their previous hardware manufacturing company which has now rebranded itself as Is my belief that should and will win the dispute. And I’m absolutely ecstatic over the new announcement that Adafruit will become the US manufacturer for I’m confident that both Arduino and Adafruit will be around for a very long time.

In the end I think I’m going to miss Pinoccio. I was quite fond of the little fellow and a bit disappointed he never really achieved his full potential. I don’t regret any of it however. I learned a lot of useful programming. And I learned some lessons about crowd source funding. And it serves as a cautionary tale about Internet of Things systems that are too closely linked to their infrastructure. I think that as IoT continues to grow that’s going to be an important lesson for everyone.

Zoomer Dino Controlled by Arduino IR Remote


One of the hottest toys this Christmas is the Zoomer Dino. It is a remote-controlled self balancing two wheel robot dinosaur with an infrared remote. I got one for my 10-year-old nephew for Christmas and after playing around with it I had to get one of my own. I have been thinking about building Arduino powered two wheel balancing robot from scratch but here was one that works right out of the box. I’m not sure if it has a gyro or accelerometer to keep it balanced. He rolls around on his own making noises including burps, farts, and laughs. You can also take over control with an infrared remote. The remote has a joystick and three pushbuttons. The joystick moves the head up, down, left, right. If you hold in the “run” button while moving the joystick he rolls around under your control rather than moving the head. There also is a button for “chomp” which makes his jaw chomp open and closed. Additionally there is a “angry” button which makes his eyes glow red and he thrashes around angrily.

Zoomer Dino and IR remote

Zoomer Dino and IR remote

As with my IR controlled to a helicopter before, I had to see if I could reverse engineer the protocol it was using for the remote control. It was one of the most challenging IR reverse engineering projects I’ve ever encountered. I finally had to go out and purchase one for myself because I had to wrap up the original one for my nephew.

I used my IRLib Arduino Library for decoding and encoding IR signals. Once you push a button to get things started, the remote puts out a continuous signal that is the neutral position of the joystick with no buttons pushed. I came up with a raw dump of the timing values using my IRrecvDump sample sketch. Here are the results.

This is a quite typical set of signals used by many protocols. Only the timings and number of bits are unique. We have a header that consists of about 9200 mark and 4800 space followed by 25 data bits and a closing mark. The data marks run about 500 or 550. The data spaces are either about 650 or 1800. This variable spacing is the most common way to encode zeros and ones. We’ll call the short spaces ones and the long spaces as ones. I created a custom decoder object as follows.

Because the remote sends signals continuously, this routine only reports the initially received value and then anytime the value changes to something different. It outputs 6 hex digits but note that there are 25 data bits being received. I then plugged the hex values into an Excel spreadsheet, converted them to decimal, and then parsed out the individual bits to try to deduce a bit pattern. I tried leaving the joystick alone when pushing the 3 buttons individually. Then I tried moving the joystick full throw forward, backwards, left, and right. The results are shown in the table below. You may click the table image to enlarge it.

Table 1-Bit patterns from Dino remote.

Table 1-Bit patterns from Dino remote.

In all samples, the first three bits were always zero as was the last bit. It was pretty obvious that after the initial zero bits, there was a five bit field that was the left/right position of the joystick with the left position having a value of zero, the center as 16, and the right was 31. This was followed by another five bit field that was the forward/backwards joystick position with zero to the back, 16 in the center and 31 full forward. The next three bits were obviously the three buttons. There were eight additional bits that seem to have no rhyme or reason to them.

Here is a revised version of the receiving code that parses out the bits into their individual fields.


class IRdecodeDINO: public virtual IRdecodeBase
bool decode(void);
void ParseFields(void);
void DumpResults(void);
unsigned JoyX, JoyY, Parity;
char Chomp, Angry, Run;
#define DINO_HEAD_MARK 9200
#define DINO_HEAD_SPACE 4800
#define DINO_ZERO_MARK 500
#define DINO_ZERO_SPACE 650
#define DINO_ONE_MARK 500
#define DINO_ONE_SPACE 1800
#define DINO_SAMPLES 54
#define DINO_BITS 25

void IRdecodeDINO::ParseFields(void) {
long Temp = value>>1;
Parity = Temp & 0x0ffL; Temp= Temp>>8;
Run = Temp & 0x1L; Temp= Temp>>1;
Angry = Temp & 0x1L; Temp= Temp>>1;
Chomp = Temp & 0x1L; Temp= Temp>>1;
JoyY = Temp & 0x1fL; Temp= Temp>>5;
JoyX = Temp & 0x1fL;
void IRdecodeDINO::DumpResults(void) {
Serial.print(F("Decoded DINO: Value:")); Serial.print(value, HEX);
Serial.print ("\tJX:"); Serial.print(JoyX,DEC);
Serial.print ("\tJY:"); Serial.print(JoyY,DEC);
Serial.print ("\tCh:"); Serial.print(Chomp,BIN);
Serial.print (" Ag:"); Serial.print(Angry,BIN);
Serial.print (" Run:"); Serial.print(Run,BIN);
Serial.print (" Parity:"); Serial.println(Parity,HEX);
bool IRdecodeDINO::decode(void) {
decode_type= static_castDINO;
return true;

IRdecodeDINO My_Decoder;

int RECV_PIN =11;

IRrecv My_Receiver(RECV_PIN);
long Previous;

void setup()
Serial.begin(9600);while (! Serial);delay(1000);
Serial.println(F("Send a code from your dino remote and we will decode it."));
My_Receiver.enableIRIn(); // Start the receiver
void loop() {
if (My_Receiver.GetResults(&My_Decoder)) {
if(My_Decoder.decode_type == DINO) {
if(My_Decoder.value!=Previous) My_Decoder.DumpResults();
Previous= My_Decoder.value;
else Serial.println("Unknown");

But what to do about those parity bits? I had to presume they were some sort of checksum or other data verification field. Normally when capturing and decoding IR signals I really don’t care what the data represents internally. I point a TV remote at my receiver circuit, capture the hex value, and then re-create that value using my IR transmitter. I could have just quit now and build an application on the Arduino that would transmit button pushes and fixed joystick positions but it would be nice to be able to use any joystick position that I wanted from 0- 31 in either X or Y directions in any combination. But to do that I needed to figure out how to compute those additional eight bits of data.

Most consumer-electronics protocols use a simple checksum of adding the previous data fields together. Sometimes you take the 1’s complement of the data and repeat it. Sometimes you use bitwise XOR to combine the fields. I spent three days playing around with various versions of my Excel spreadsheet analyzing lots of bit patterns captured from the remote and could not deduce the pattern. I asked a couple of online acquaintances if they had any suggestions but they’re only input was to try checksum, XOR etc. A cyclical redundancy check or CRC was another option but that would be hard to reverse engineer and they generally are not used for such short streams of data. Keep in mind were only talking about 13 bits of actual data if you don’t count the leading and trailing zeros or the eight check bits.

At one point I remembered there was something called a Hamming error correction code. I had learned about them in college in my CS 484 class with Dr. Judith Gersting over 25 years ago. I barely understood how they worked back then and I’ve not used them ever since so the chances of me being able to figure it out on my own were represented by the three initial zeros in the data stream 🙂 Dr. Judith Gersting was not my only mentor in college. Her husband Dr. John Gersting told us on the first day of programming class that he was not going to teach us programming. He was going to teach us to teach ourselves programming because the minute we walked out the door, everything would probably be obsolete anyway. He literally handed us a textbook that he wrote and told us to go teach ourselves the course. I guess I was going to have to do some Google searches and teach myself everything I needed to know about Hamming codes.

As it turns out there is no one single way to create an error detecting/correcting code. There are entire websites devoted to multitudinous ways and they all use notation that I didn’t understand. I did find one website from UMass linked here.

One thing I have learned about Hamming codes was that they typically only add a vary few extra bits. Using the calculator linked above if I put in a 16-bit value it would only add five additional bits. I was getting eight additional bits on just 13 bits of data. But the one thing I did learn from that page was the way you calculate those extra parity bits. There is a matrix that tells you which of the data bits to add together to get each of the individual parity bits. I really had to do was figure out which data bits contributed to each parity bit. I had already noticed that if you push the “run button” which I have listed as “B0”, that parity bits P2,P1,P0 all inverted from their normal position. Similarly the “angry button” which is “B1” toggles parity bits P3,P2,P1. Similarly the “chomp button” labeled “B2” toggles P4,P3,P2.

So I made a new set of columns in the spreadsheet to compute the parity bits. I begin by saying…


Additionally the center position of the joystick had only a single bit set, the highest order bit of the five bit field which was value 16. By comparing those to the joystick positions which were all of the way left or on the way back (which consisted of all zeros) I could figure out which parity bits changed based solely on X4 and Y4. Quite by chance I also found had captured samples with X positions of exactly 8, 4, and 2. So that told me which parity bits were based upon X3, X2, X1, and X0. As I updated the formulas for calculating each parity bit, I compared the computed results to actual capture values for every hex value I’d captured. I had a list of over 30 values that I had dumped from simply wiggling the joystick around. Eventually I was able to fill in the blanks and came up with the following formulas.


Comparing my computed results to all my captured results I was convinced I had completely deduced how the parity bits were calculated. When you put those results in a table as follows, there is a definite pattern to them. It looks a lot like the patterns that had been seeing on various websites.

Table 2-Parity calculation matrix.

Table 2-Parity calculation matrix.

Finally I was able to create a sending routine that allowed me to test all of this out. This is a somewhat stripped-down version of what I ultimately came up with. You upload the sketch, call up the serial monitor, and type various characters into the monitor. The sketch then interprets those as commands and sends the proper hex code to the IR transmitter.


class IRsendDINO: public virtual IRsendBase
void send(unsigned long data);
#define DINO_HEAD_MARK 9200
#define DINO_HEAD_SPACE 4800
#define DINO_ZERO_MARK 500
#define DINO_ZERO_SPACE 650
#define DINO_ONE_MARK 500
#define DINO_ONE_SPACE 1800
#define DINO_SAMPLES 54
#define DINO_BITS 25


void IRsendDINO::send(unsigned long data) {
delay(27);//Average gap was 26700 us

IRsendDINO My_Sender;

int RECV_PIN =11;

IRrecv My_Receiver(RECV_PIN);
char Mult, Normal, Chars;
#define COUNT 7

void SendMultiple(unsigned long Data, char Count) {
for(char i=0;i<(Count);i++) {My_Sender.send(Data);}; }; void setup() { Serial.begin(9600);;delay(2000);while (! Serial);delay(2000); Serial.println(F("Enter one of the following letters A,C,U,D,L,R,F,B,<,>,N,0"));
void loop() {
char Cmd;
if (Serial.available()>0) {
switch (Cmd) {
case 'A': SendMultiple(0x2105a0, 9); break; //anger
case 'C': SendMultiple(0x201984, 6); break; //chomp
case 'U': SendMultiple(0x21f162, COUNT); break; //head up
case 'D': SendMultiple(0x2000ae, COUNT); break; //head down
case 'L': SendMultiple(0x010112, COUNT); break; //head left
case 'R': SendMultiple(0x3f003a, COUNT); break; //head right
case 'F': SendMultiple(0x21f36c, COUNT); break; //forward
case 'B': SendMultiple(0x2002a0, COUNT); break; //backwards
case '<': SendMultiple(0x01031c, 5); break; //spin left case '>': SendMultiple(0x3f0234, 5); break; //spin right
case 'N': Normal=1; break; //send neutral commands
case '0': Normal=0; break;//send wiggle commands
} else {//if no serial data then send either normal play mode or sit still
if(Normal) {
//Un-comment next line to have Dino do normal behavior.
// My_Sender.send(0x2101bc); //Comment out to turn off continuous transmission
} else { //wiggle slightly in an attempt to set still

The actual remote sends continuous streams of data even when you aren’t doing anything. If you don’t touch any buttons or move the joystick for about one minute it eventually shuts down. If you are not pushing a button and the joystick is in the neutral position, the dinosaur engages in various preprogrammed behaviors. I needed a way to get him to sit still while I’m typing in the next string of letters. If you select “Normal” mode. It doesn’t send any signals. If you press a “0” it continuously sends a tiny forward and backwards code which basically has him sit in one place. He wiggles a tiny bit and make some noises but he doesn’t go off on his own. Then when you type other letters he goes in the direction you want him to. You can look at the “switch statement” to see which characters perform which functions. I send multiple transmissions of each code. The default number of signals is defined in COUNT so it was easy to change the default. I have a more advanced version of the sketch which causes him to move at various speeds, shake his head repeatedly, travel in zigzag motions etc. I also added commands to make him go forward and right or forward and left simultaneously. That way he doesn’t spin in place, he turns in a broad curve. In the demo video below I use that feature to make him travel in an oval-shaped pattern.

Know that all of the driving patterns I put him through in the video below could be done with the actual remote. You’ll have to trust me that they were created using an Arduino and my software.

My ultimate goal is to port my code to my pinoccio board which includes Wi-Fi and mesh radio. That way I can control him through a webpage similar to this. I will end up with an “Internet of things” remote control dinosaur. The pinoccio has a LiPo battery and is very small. I might just velcro it with an IR LED to the back of the dinosaur and not worry about maintaining a line of sight from my transmitter. I will post more details when and if I ever get that working.

Here is where I demonstrated the project on the Adafruit weekly Show-and-Tell on Google Plus Hangouts.

IRLib Updated to Version 1.5

We are pleased to announce that IRLib has been updated to version 1.5. IRLib is a library for Arduino-based microcontrollers that allows for the receiving, decoding, and sending of infrared signals. These new changes are a step forward in making the library less hardware platform dependent so that it can be more easily used by a variety of microcontrollers. These changes include…

  • New bit-bang option for PWM output frequency setting. Now can use any output pin with no hardware timers. Note:bit-bang output not as accurate as timer-based frequency selection.
  • Major rewrite of IRLibTimer.h to facilitate bit-bang. Separated hardware timer selection and specification into sending and receiving sections in order to implement bit-bang.
  • New IRfrequency class for detecting input frequencies. Previously was a stand-alone special sketch but now is a class including a DumpResults method.
  • New IRfreq and IRrecvDumpFreq illustrate simultaneous detection of frequency and pattern with both an IR learner and IR receiver is connected.
  • New #define USE_IRRECV define can be commented out to completely remove the interrupt driven IRrecv receiver class from the library. This resolves ISR conflicts with other libraries such as Tone() when not using IRrecv class.
  • New #define USE_DUMP define can be commented out to disable DumpResults methods. Saves code space when these methods are not needed.
  • Revised user manuals to document new features and correct previous documentation problems.

Note: The included user manual update is not yet available on the website at but it will be updated shortly. New user manual is available with the library itself as a Microsoft Word .docx file as well as PDF and EPUB versions.
This library is available on GitHub at . For more information on this library see

Pinoccio Internet of Things IR Remote Demo

satb100Here is a YouTube video demonstrating how I created an internet of infrared remote using the new Pinoccio platform. The Pinoccio is an Arduino compatible board based on the ATmega256RFR2 chip. It uses a Wi-Fi backpacked and built-in 802.15.4 mesh radio.

As mentioned in the video I have not yet released my source code for the Pinoccio port of my IRLib but I will do so very soon. The source code is now available on GitHub here. Read more about Pinoccio (and yes it really is spelled without an “h”) at And my IRLib at

Update: I also did a live demonstration of this project on the Adafruit Industries Google+ Hangout weekly Show-and-Tell which you can see here…

At some point I will post an extensive tutorial on this project.

Pinoccio Wireless Arduino Compatible Board: First Impressions

My Pinocchio boards arrived today in the mail. By the way I’m going to continue to call them Pinocchio rather than it to spelling Pinoccio simply because it’s easier to dictate using my voice control software wherein I do not need to go back and delete the “h” each time I type the word. For an explanation of the name you can see their FAQ here.

This board started out as a crowdsource funded project on It was billed as “A Complete Eco-System for Building the Internet of Things”. It consists of an ATmega256RFr2 microprocessor, a USB interface, a temperature sensor, an RGB LED, and a LiPo battery. The mesh radio built into the chip is a 2.4 GHz transceiver supposedly capable of ZigBee and IEEE 802.15.4 transmission although I’ve not yet seen anything about how to communicate with X-Bee or ZigBee modules from other manufacturers.

The package I ordered as part of my funding sent me two modules, one of them with a Wi-Fi shield or backpack as they call them. They call the boards “Scouts” so the one with the Wi-Fi shield is the “Lead Scout” and those without Wi-Fi are called “Field Scouts”. As a milestone perk I also got a prototyping shield and a small USB cable for charging and configuring. Here are some photos of the devices as shipped. (Click the images for larger view.)

Everything I Got

Everything I Got

Topside view: Lead Scout with Wi-Fi on top. Field Scout below.

Topside view: Lead Scout with Wi-Fi on top. Field Scout below.

Bottom view showing battery.

Bottom view showing battery.

The units use a micro USB cable. The first one I tried was a mini USB with an adapter on it. The adapter was too large because it got in the way of the Wi-Fi shield. I finally found a cable in my pile of cables. I wanted to be able to plug in both of them at once but as it turns out that may be a bad idea.

There was a card included that says to get started I should open a chrome browser and go to and download their chrome app. I thought about browsing around the website and reading a bunch of documentation but one of the things the designers have said is that it ought to be easy to get started. They spent a lot of time working on the software and the front end for this thing rather than just creating the hardware and sending them out. In fact the original deadline for shipping was last July and here is the following April. So I thought I would give it the acid test and play dumb and see what I can find.

The app loaded just fine and I got a screen that told me to click to add a Scout control panel. They call the control panel “HQ” The first thing it said I had to do was to downloading Windows driver and install it. They tell you to plug in the device first and then it would tell me that no driver was available. Then it suggested I go to Device Manager via Control Panel in Windows and then I would find the device under “Ports (COM & LPT)”. It was not there it was under “Other devices” which is no big deal. I downloaded the driver and unzipped it into a folder. I would’ve preferred a self extracting installer but that was no big deal. When I tried to install the driver, Windows for bid me because it was not signed. No mention of that fact in any of their documentation so minus a few points for that problem as well. This was a Windows 8.1 64 bit machine. I had had trouble loading Arduino drivers on my laptop for the same reason and I found a website that explains how to permanently turn off that feature. I don’t know why I had not had the similar problem with Arduino drivers on my desktop Windows 8.1 PC. If you are interested… here is the website that tells you how to do it. That went relatively well.

Then I went to the process of configuring the lead scout. It took me several attempts and some email exchanges with their technical support people. Eventually it did start working but I’m not really sure what we did to fix it. It seemed to me that the steps they outline history followed in an exact precise manner.

Scouts in a mesh are configured together in something called a “troop”. So the first thing you have to do is give it a troop name. I chose “The Collective” (as an homage to Star Trek’s Borg). Then you name your lead Scout. I chose “Picard”. It then searches for Wi-Fi signals and asks you which Wi-Fi it should try to connect to. You are the Wi-Fi from the list and enter your password. There’s also a manual option if it cannot detect your Wi-Fi. When you completed that a screen pops up telling you that it succeeded adding your lead Scout to the Scout HQ. It then tells you to unplug the device so that it will reset and reconnect to your Wi-Fi. After that you click on the button that says “Done”. Apparently they are very picky about the order. You cannot click done until you’ve unplug the device and give it time to reset. Even then I had difficulty getting it to work right. In the end the only reliable way I could configure it was to unplug it and turn its power switch off and on. Then wait a few seconds before clicking done. Oh by the way when you first plug it in, the HQ searches for it and tells you that he could not find the device and that you probably forgot to turn it on. But it doesn’t tell you where the switch is. It’s not obvious. Anyway after unplugging, cycling the power switch, waiting a few seconds, and then clicking the done button it seemed to work okay.

You go to the same process for the field Scout although it does not prompt you for Wi-Fi information since it doesn’t have Wi-Fi.

The HQ app gives you the ability to turn on the RGB LED and change colors. It tells you the percent your battery is charged any gives you the temperature from the temperature sensor. I took my field Scout outside to see what the outside temperature was. Unfortunately it was raining so we had to put it in a plastic bag when sitting it out on the back porch. I don’t know how accurate the temperature was but it did change to a reasonable value. There are also controls for configuring the several I/O pins. There’s also a command line for sending for sending script commands. Here are some screen grabs showing the two scouts.

HQ control panel for the lead scout "Picard"

HQ control panel for the lead scout “Picard”

HQ control panel for field scout "Seven-of-Nine"

HQ control panel for field scout “Seven-of-Nine”

There are variety of script commands that you can use on the command line. Here is a link to the reference page.

The next thing I tried to do was use the Arduino IDE. You have to download a beta version because the current IDE does not support that chip. Again is a zip file rather than an installer. I already had the current production Arduino IDE installed on this machine. I took a chance and just copied the new files over the old ones. Apparently that was not the right thing to do because when I tried to compile an example sketch I get a “compiler error” with no error message whatsoever. I will probably go back and uninstall original Arduino IDE and delete all the files and try to reinstall the beta version from scratch. But that’s a task for tomorrow.

It’s going to be a steep learning curve to do anything really useful with this. Of course my ultimate goal is to port my IRLib and use it to make an “Internet-of-Things” infrared remote. Let’s going to take lots of time with data sheets and schematics. It looks like as powerful system but are not a long way to go in order to get it to do what I wanted to do.

Revised Remote-Controlled Remote-Control with Call Button

Imagine yourself being a severely disabled person lying in bed at night and needing assistance. It might be that you’re uncomfortable and need to roll over. Sometimes it’s just something annoying like a bug crawling across your arm. Other times it’s more serious such as a severe coughing spell, nausea, or potentially even a heart attack. A couple of months ago I woke up in the middle of the night with chest pains. I was 99% sure it was just a muscle cramp. I had had my back brace on a little bit crooked that day and I was pretty sure it was just the aftermath of that. But I wasn’t really sure that it was not a heart attack. I tried calling my dad who sleeps in his bedroom which is pretty far from my room. As both of us have gotten older, my lungs are weaker and his hearing is worse. I can usually yell and wake him up in 10 or 15 minutes. However some nights he sleeps very soundly and it’s not unusual for me to lie in bed awake for an hour or even two until he gets into a lighter sleep cycle and can hear me.

As I was lying there in bed wondering if I needed to be calling 911 or if I just needed a rubdown with some BenGay, I wished that I had some sort of a call buzzer that would alert him that I needed something. Years ago I had a call buzzer that we built out of parts from RadioShack. It was part of their home security line of products. There was an emergency call button that you would wire into their control boxes and that control box could in turn be hooked into an auto dialer. We really didn’t need a button to call 911. We just wired in a loud buzzer. We had one for me and one for my grandmother. The radio on the button was strong enough that she could trigger hers in her home next door and it would buzz here.

In 1990 my grandmother passed away and I was using the buzzer myself less and less. We ended up putting it away somewhere because it wasn’t as critical for me and typically if dad didn’t hear me my mom did. In recent years I’ve looked for that gadget all over the house. I’ve looked through closets and junk boxes and junk drawers and cannot find it. RadioShack no longer makes the kind of gadget that we used. Their newer home security systems do not seem to have something similar. I guess they expect you to buy some commercial home security system that is monitored. You know the famous “I’ve fallen and I can’t get up” type of gadget.

So anyway I’m lying there thinking it would be really nice if I had a button in my hand that would trigger a buzzer to wake up my dad. But wait… I did have the button in my hand. I had four of them in fact. Unfortunately all they would do would be to turn on my TV. No buzzers attached.

In previous articles I’ve talked about my “Remote-Controlled Remote-Control” project that I use to control my TV, cable box and DVD players while in my bed.

Sitting in my wheelchair I have no problems pushing buttons on a remote. I use a wooden stick in my mouth.

Sitting in my wheelchair I have no problems pushing buttons on a remote. I use a wooden stick in my mouth.

When sitting up in my wheelchair, I poke at the buttons of a traditional universal remote by using wooden stick in my mouth. But when I’m in bed, I don’t have sufficient dexterity to handle a bunch of buttons.
Arduino-based device with LCD menu sits atop my TV probably displaying an Adafruit "As Seen on Show & Tell" sticker.

Arduino-based device with LCD menu sits atop my TV probably displaying an Adafruit “As Seen on Show & Tell” sticker.

Instead I have a system that uses a set of micro switches, universal remote, and the special electronic gadget that I built that sits on top of my TV. That gadget is based on an Arduino microcontroller. It has an LCD screen and an infrared receiver and transmitter. Below is a diagram of how down the original system worked. I have a set of four micro switches that I hold in my hand. They can be seen lying on the bed connected by wire to universal remote that is sitting on top my cable box. I would push the micro switch causing the universal remote to send an IR signal to the Arduino box on top of my TV. After selecting an item off of the menu the Arduino box would then send an IR signal back to the cable box. Note you can click on any of the images in this blog to see a larger version.
Original "Remote-Controlled Remote-Control" System

Original “Remote-Controlled Remote-Control” System

What I needed was an additional function to ring a buzzer. The problem is that infrared IR signals are just ordinary beams of light that happen to be of such a frequency below what the human eye can see. While it is possible to bounce the IR signals off of a shiny object or a light-colored wall, there’s no way that the signal was going to reach all the way to my dad’s room. That means we needed some sort of radio RF signal.
X-Bee Series 1 Radio

X-Bee Series 1 Radio

My microswitches were wired directly into a traditional universal remote. The box on top of my TV was designed by me and built by my dad and it was based on the Arduino series of microcontrollers. Lots of types of gadgets have been designed for use with these controllers. The most popular RF module is called an X-Bee radio.

I thought about adding an X-Bee to the Arduino on top of my TV, however to trigger it I would need to select that option from the LCD menu. However sometimes I sleep on my side and I could not see the menu. That meant that the X-Bee would have to somehow be connected to the microswitches directly. I concluded that I could build another Arduino gadget to replace the universal remote. The microswitches would wire into the new transmitter Arduino. It would send the IR signals to my set-top Arduino just like the remote did. But it would also have an X-Bee module that was sent RF signals to my dad’s room.

The X-Bee does have some digital input/output pins to which I could connect a buzzer directly. However I wasn’t really sure if it was going to be a buzzer perhaps something that would turn on a light or perhaps trigger an intercom. Since I wasn’t completely familiar with the capabilities of X-Bee and I do know a lot about Arduino I decided that the receiver in my dad’s room would also be an Arduino with an X-Bee connected to it.

Adafruit X-Bee Adapter

Adafruit X-Bee Adapter

I went to my favorite electronics supplier and ordered the following gadgets (2 each) an Arduino micro, an X-Bee adapter that makes it easy to connect a 3 volt X-Bee to a 5 volt Arduino, an X-Bee Series 1 radio module, a USB cable, a 5 volt USB power supply. I already had parts to make an IR transmitter. The only other item I needed was some prototyping boards and a 5 volt buzzer.

I had no previous experience with X-Bee. It’s a pretty powerful system that allows you to create a network mesh of transmitters and receivers. You can configure them as a master controller which can control either end nodes or routers. The routers can talk to the master controller and to end points. I had several online tutorials and an e-book that many of them talked about the newer X-Bee series 2 devices and I was using the older and slightly less expensive series 1. It was a pretty steep learning curve until I finally found an article that explains how to set up the simplest possible X-Bee network. Here is the link…

06 hayes_smartmodemThe author explains that X-Bee is really just an ordinary serial modem. In fact the firmware recognizes escape sequences and text commands that are based on an old system used by Hayes Smart Modems. I remember the days when I had an old Hayes Smart Modem 300 sitting on top of my S-100 bus-based computer back in the early 1980s. By the way that “300” wasn’t just a model number… It meant that it communicated at 300 baud. That is approximately 300 bits per second. Today’s Internet traffic is not measured in hundreds of bits per second rather in megabits per second. That shows you how old this system is. Typically an X-Bee radio communicate that 9600 baud.

FTDI USB cable and X-Bee Radio with Adapter

FTDI USB cable and X-Bee Radio with Adapter

Anyway you simply connect them to a USB port using an FTDI or an Arduino. Then you use a serial communication program to type text into the radio. Using the Hayes protocol you type “+++” with a pause before and after to get it into command mode. Then you type text commands beginning with the letters “AT” to configure various parameters. Once it is configured, anything that you type into one X-Bee gets transmitted and appears on the other radio. It’s like a little 2 man chat room.

There is a more advanced mode called API mode that allows you to send packets of digital data. But for my purposes all I needed to do was send one character of data that would be interpreted as “Ring the buzzer”.

I first prototyped everything on a breadboard to get it working. Then I had dad solder it all together neatly on a prototype board. Here is a photo of the receiver device that goes in my dad’s room. It consists of an Arduino Micro, an X-Bee radio sitting in the 5 V adapter board, and a buzzer.

Receiver module with buzzer

Receiver module with buzzer

Here is a photo of the transmitter device that sits on top of cable box. It shows the sets of 4 micro switches next to it. The small board on top is an IR transmitter consisting of three transistors and 2 IR LEDs.
Transmitter with IR emitters and microswitches

Transmitter with IR emitters and microswitches

Here is an illustration of how the system worked using the Arduino transmitter with X-Bee radio and IR transmitter in place of the universal remote.
Communication between Arduino devices

Communication between Arduino devices

I spent several days tinkering with the timing of the system. I had to deal with de-bouncing the micro switches. I also had to deal with conflicts between the IR signals going back and forth between the two boxes. The signal going from the transmitter to the box on top of the TV show by the green arrow would interfere with the signal going from the LCD menu box back to the cable box shown with the blue arrow. The Ghostbusters were right “Don’t cross the streams!”. The original universal remote had been configured to only send a signal once even if you held down the button. I wanted to be able to hold the button to send repeat signals so that it would be easier to scroll through the on-screen channel guide for example. But as the transmitter box with send a second signal, the LCD box would be trying to talk to the cable box and it would get confused.

One of the problems was that the transmitter was too intense. Those double LEDs each with their own driving transistor were putting out too much power. IR receivers have something called an automatic gain control or AGC. They automatically adjust to the amount of infrared light coming in. My ultrabright transmitter was bouncing off of the TV and other objects in the room and temporarily “blinding” the AGC on the IR receiver of the cable box. I ended up putting a piece of tape over one of the LEDs and that helped my timing issues a little bit. While I was able to get it working as well as the old system, I still couldn’t get the timing right to be able to hold the buttons for a continuous stream of pulses for scrolling through on-screen menus.

On the other hand the call buzzer worked pretty well. The first couple of nights that I tried it, my dad was able to hear the buzzer and come and roll me over or do whatever else I needed. I programmed the transmitter Arduino to only trigger the buzzer if I held down 2 buttons simultaneously for a duration of five seconds or more. That way I wouldn’t accidentally set off the buzzer while trying to change channels or do some other function on the TV. Also it meant that I did not need to add any additional buttons.

Completed buzzer with cone.

Completed buzzer with cone.

However a few nights later, dad was in a deeper sleep than he had been during the initial tests and did not hear the buzzer. I was going to go looking for a new buzzer that was perhaps louder. I had also considered adding a relay to the receiving Arduino that would perhaps turn on a lamp in his bedroom. But my dad had a better idea. He noticed that the sound coming from the buzzer was a bit directional. Since he is a retired sheet metal worker he naturally thinks of solutions that involve making things out of metal so that is what he did. He created a little metal cone that he fitted atop the buzzer using a little plumbing elbow. Here is a photo of the modified device and the little plastic box that he used for an enclosure. So far this modified device is working really well.
X-Bee mounted atop LCD menu box

X-Bee mounted atop LCD menu box

I still was not happy with my timing problems on the transmitter. I realized that I could avoid the IR interference if I added an X-Bee to the LCD box on top of my TV. Then we would have an RF signal going from my transmitter box to the LCD box and it would not interfere with the IR signal going from the LCD box to my cable box and DVD etc. I ordered another X-Bee and X-Bee adapter from Adafruit and it arrived in few days. We mounted it on top of the LCD box and wired it into the Arduino inside. Here’s what it looks like now.

We cut away the IR transmitter board from the transmitter Arduino and removed it. We then mounted the device in a plastic box. The boxes we were using were boxes that originally contained a deck of cards. It turns out they are just the right size for the Adafruit half-size prototyping board.

Completed transmitter with IR board removed

Completed transmitter with IR board removed

Completed transmitter painted black and sitting atop cable box

Completed transmitter painted black and sitting atop cable box

I eventually painted my box completely black because I didn’t like all the blinking LEDs lighting up my room at night. There is a green power LED and a red transmit LED on the X-Bee adapter and there is a bright blue power LED on the Arduino Micro.

Here is an illustration of how the new system works.

Communication between boxes in final version

Communication between boxes in final version

The X-Bee on the transmitter box sends RF signals to my dad’s bedroom and to the LCD box on top of the TV. That signal is shown by the magenta arrows. The LCD box then transmits IR signal back to the cable box shown in blue arrows. There is of course no interference between IR and RF so I don’t have to build in the special delays. I can pump the buttons as quickly as I want to or hold the button in and let the software pump the signal for me at whatever rate I want. It works wonderfully.

I mentioned earlier that X-Bee was capable of creating complicated networks with master controllers, routers, and in points. Was a bit worried I was going to have to learn how to do all that once I had added the third radio. As it turns out the simple system of everyone-talks-to-everyone works just as well with more than two radios. Therefore the same RF signal in the same data goes from the transmitter box to my dad’s receiver buzzer and to my LCD box. The data I am sending is just a single text character. If it sends a “^” character then the buzzer goes off. If it sends a “U”, “D”, “L”, “R”, or “S” character than it tells the menu box to move the cursor up, down, left, right, or select. Actually I do not have an up microswitch in the system. It’s easier to get by with just 4 buttons. The menu wraps around and sue if I need to go up, I just go down several steps.

satb100The whole thing is working really well. I demonstrated my original “remote-controlled remote-control” on the weekly Adafruit Show-and-Tell videoconference on Google+ Hangouts over a year ago when I first created it. Here is a link to that blog entry which contains the video demonstration. A few weeks ago I also demonstrated on the Show-and-Tell the initial X-Bee system that did not include the third radio. Below is the YouTube video of that Show-and-Tell.
Part of the segment begins about 8:30 into the video. I will probably do a follow-up demonstration of three radio system.

Here’s a list of the parts used with links to

New Software for Analyzing IR Signals

It was my pleasure to be an Indigogo supporter and beta tester of the new software solution for analyzing infrared signals using Arduino, Raspberry Pi and other controllers. It is a Windows application called AnalysIR. Software is now available for the general public here

One of the nicest features of this system is that it allows you to use and IR learner chip to directly decode raw IR signals rather than using a decoder bandpass filter and AGC style chip that I normally recommend for my projects. This is essential if you do not know the base frequency of an unknown protocol.

The Arduino portion of their software is freely distributable at some point I will be adding something to my IRLib library for Arduino that will allow you to do frequency analysis. But no matter what I come up with it’s not going to be as useful as this full-featured package which is now available at a reasonable price considering the effort they’ve put into it.

I’ve had many requests for output of IR signals in different formats such as ProntoHEX that I’ve not yet been able to implement in my code. However this software easily outputs that format.

I highly recommend you check out the software.