Infrared Inhaler

Back when Sam and I were running SumoBot matches as corporate teambuilding events at TechShop San Francisco one of the common issues the participants encountered was a failure of the bot to detect objects in its path. The cause would be related to the infrared sensors (the ’bot’s “eyes”) or the infrared emitters (the ’bot’s “headlights”.)

Little mean SumoBot

Almost always alignment was the problem. A sensor or an emitter could be pointed too high, or too far apart. But once in a while, the emitters were not emitting. Perhaps the IR LED had been installed backwards (easy to check, unless the builder of the particular bot had trimmed the leads of the LED in which case I might have to put my glasses on — still pretty easy.) Or perhaps the LED had failed entirely.

LED failure was pretty rare, but it tended to be the first assumption made by the participants, so it was a good idea to eliminate the possibility, even if only not to be dismissive of the participant’s estimation. We could say that, well, usually there’s some cause other than a bad LED. But demonstrating that the LED itself was not the problem showed that we were taking the participant seriously. Furthermore, if the LED actually was bad, doing a lot of troubleshooting only to discover the faulty hardware would make us look and/or feel foolish.

The problem is that infrared light is, by definition, outside the visible spectrum. One can’t just look and see if the emitter is shining. Testing would therefore take the form of finding another LED (one which was not necessarily known good) putting it in place, and seeing if the problem persisted. We couldn't use another ’bot’s headlight to test, since each one flashed with a specific timing to eliminate confusion with other emitters.

Thus it would be useful to have some simple test available to see empirically whether the LED was actually lighting up. A detector for infrared emissions would also be useful in determining whether the ’bot’s emitters were pointed in the right direction. My first thought was to carry an old cellphone with a poor infrared filter over its camera sensor, or one which had the filter removed.

Infrared illumination is one of my interests, and I did have one camera with the infrared filter removed, but it has a FireWire interface and it would have meant bringing out a laptop to see what it showed. I dug out my old Palm Prē which turned out to have a rather poor infrared filter. Unfortunately my Palm Prē has sat around for a long time, and its battery doesn’t hold much of a charge. It could be left on a charger through the events, but it was far from an ideal solution.

Infrared detectors of various kinds are easy to come by, though. A circuit which detects IR light and indicates its presence should be fairly simple, would require very little power, and could fit in a small, portable (and pocketable) package. There are IR photodiodes, IR photoresistors, and IR phototransistors, all available inexpensively and even conveniently.1

The simplest solution is to use a photoresistor in line with an LED to indicate the strength. There are some drawbacks if a more complicated measuring system is desired, but the simple solution shows easily and intuitively the strength of the signal without needing to calibrate for environmental ambient IR.

An ideal container package made itself apparent: the shell of an old albuterol inhaler for asthma attacks provided a form factor that is small enough to be pocketed and a shape which can be easily pointed. Newer models have a dosage counter on the back, and the counter can be replaced with the indicator LED behind its window.

Even better, the inside of the inhaler has slots on the side which can be used to hold a small piece of perfboard.

Two square inches of perfboard

A 1" by 2" piece fit perfectly. In fact, the inside space narrows slightly toward the top of the inhaler, allowing the 1" wide board to friction-fit nicely.

The power supply would have to be small and light. A single coin-cell battery filled that bill. One LED doesn't take much power. The battery cage for a CR2032 fit the board without much room to spare.

Though I did not want to overcomplicate the device, two additions were desirable: I wanted a power switch so that I wouldn't have to pull the board out and remove the battery in between uses, and I wanted an indicator so that I could immediately see if the device was turned on. Being able to see that the device is powered rules out a dead battery or damage to the device if, when it is pointed toward the source it shows nothing.

After the addition of a second LED and a switch, it's still a pretty simple circuit:

Once the switch is closed, power gets to the power-on indicator LED (LED2) regardless of any current making it to the detection indicator (LED1). Easy peasy.

The layout had to keep the switch, power indicator, and battery cage easily accessible. The Fritzing layout did not come out to scale, but I did get a good idea of how I needed to place the components on the board:

The wires to the indicator LED went up through the hole that once held the button which advanced the dosage counter.

I chose a relatively high-value resistor (4.7KΩ on a 3V battery) for the power indicator LED, just because I don’t care how visible it is; I just want to be able to check and see whether it is on. When it’s on, I don't want to drain the battery any more than necessary. So the power light itself is pretty faint. Were I to do it again (or when the battery runs out and it’s time for me to pull the circuitboard out anyway) I might swap a slightly lower value resistor in, maybe 2.2KΩ or 1.5KΩ. But it isn’t necessary. Even in bright sunlight the little green LED is plain to see if one is looking.

A little green light

How long will the 3V coin battery last? I don't have any idea. I use the IR Inhaler only occasionally, and then only for a couple minutes at a time. It's been almost ten months and the battery in there still reads 3.09V on my multimeter. I'm not worried about battery life.

The IR Inhaler has come in handy a couple of times in non-work-related contexts. Think your TV’s remote control batteries might be running low? See how brightly the indicator lights when you point it at the remote and push a button. There are any number of projects using infrared for control or communication, and devices using infrared. Maybe you’re curious which of your neighbors are using night-vision security cameras. A homemade handheld IR sensor might just be the ticket.

An even simpler version can be found on Instructables and it’s almost certainly not the only one. You don't even need to have asthma; Almost anything can be used as a shell.

One characteristic common to makers is that we tend to have a lot of stuff — including (especially) containers and chassis of varying shapes and sizes lying around waiting to be used, usually with no clear idea what to use them for. One of the really fun things about makers’ projects is seeing what they have repurposed.

Don't go to production of multiple units of something with repurposed household stuff. You’d have to buy all those original products, which would be expensive. Furthermore, there would be legal issues. One-off test equipment for use on one’s own bench however, that’s legitimate. It’s also a good creative exercise and a way to explore practical design.

Plus, it’s often funny in an absurd sort of way when something with one function is found in the form of something one normally wouldn’t associate with that function. I got a chuckle out of the idea of putting an IR detector in an albuterol inhaler, and that chuckle gave me the motivation to get it done.

  1. Radio Shack sells infrared emitter/receiver pairs, but note that it is not consistent whether the package will contain a photodiode or a phototransistor, and it is unlikely that the package will indicate (or indicate accurately) which you're getting. The Internet is full of accounts of frustrated beginning makers and experimenters unable to make their Rat Shack IR detector circuits work, only to learn that counting on getting the advertised part is too much to expect.