Did you close the garage door?

When I was growing up, my family had a light in our kitchen that would come on when the garage door was open. It was easy to see when the door had been left open. The light was probably sold as an optional accessory for the opener, because the opener unit had a pair of terminals on it that could be wired to the indoor indicator.

Some time later, the opener had to be replaced, and the replacement opener had no connection for the indoor door-open indicator. They got used to not having the light, but I didn’t, even though I don’t live there any more. As we grow up, we expect that our parents’ houses shouldn’t ever change, don’t we?

For the stop light project I have been working on, I need the controller to know when the door is opened so that it can wake up go into its parking sequence mode. The door-open sensor for the stop light would be nearly identical to what would be needed to replicate the old indicator that my parents used to have in their kitchen, so I bought enough components to build both projects. Not knowing whether they would want indicators, I included two indicator light assemblies in their kit.

The key component is a C&K MPS80WGW magnetic proximity sensor. This sensor comes in two parts, a magnet and a switch. The magnet is mounted to the moving part of the garage door, and as it closes, it moves into the switch’s range. The switch closes, and turns off the indoor indicator light. At 2″, this sensor has the largest active region of the ones available at Digikey. This is handy, because the sensor will be forgiving of misalignment, and it will tolerate the door being left slightly open, as is sometimes done in hot places like Texas in order to allow some air to circulate into and out of the garage. The magnet and switch are mounted on simple steel brackets and secured to the door and the track.

The indicator lights themselves are nice big 10mm SSI-LXH1090SRD LEDs from Lumex Opto. They come installed in bezels that fit neatly in a single gang plate cover drilled with a 1/2″ hole (bored out just a bit with a Dremel tool). The forward voltage of these LEDs is 1.7V, so a 160Ω resistor limits current to 20mA. This is bright enough to be noticed, but I think not so much so that it is distracting.

A simple driver assembly has connections to the indicator LEDs and to the proximity sensor. I used a spare 5V wall transformer from an old cell phone to supply power through a thermal fuse to the LED driver, a common 2N3904 transistor. The driver assembly fits inside a single gang side mount electrical box, intended to be installed in the attic between the garage and the other rooms where the LED indicators would go. I drilled a small hole in the cover plate so that an internal status LED can be seen, as an installation aid.

The LEDs and sensor operate at 5V, so simple phone cord wiring and low voltage wall boxes are sufficient. The inside of the driver is shown below.

A wall box with the LED installed is shown below.

The following schematic shows the components and their connections. (PDF) The components in the shaded box are in the single gang wall box. Having some perf board and screw terminal connectors on hand was helpful to hold everything together and simplify installation. I included these installation suggestions with the kit.

Some shots of the components as installed follow.

This project was nothing fancy, but it was satisfying to put together some simple parts to restore a nice feature to my parents’ house. It was also a nice way to add a fun feature to the stop light controller with some similar components.

After I had wrapped up the project, I found another garage door sensor project that was way more involved, and pretty neat: Ultimate Garage Door Monitor.

Why it rules being an engineer

I’m told that I had a fascination with stop lights when I was little, watching them intently from my car seat in the back of our yellow Vista Cruiser station wagon. My dad decided that I should have one of my own, so he somehow obtained an old decommissioned unit from the Illinois highway department. I have no idea how exactly this was arranged, and I have purposely never asked to hear that specific story. I guess the transaction was legitimate, since there are plenty of stop lights for sale on eBay.  I have a very sketchy memory of backing the car up to a warehouse early on a grey Saturday and returning home with a beat up 100 lb stop light in the trunk. This was a very long time ago, so this memory could even be a fabrication. I also have vague memories of my dad in the basement refurbishing and painting it, fabricating shrouds to replace the mismatched, broken, and missing ones, and replacing broken lenses.

It has always been a goal of mine to give it an upgrade. There were any number of things that could be done, whether turning it into some kind of game, automating it, putting it on a timer, replacing the individual pushbutton switches with something fancier… this was a big project just waiting to happen and begging to have something done to it.

At some point last year I happened to learn about a project someone did, and it provided a spark of inspiration. This person had modified his Rancilio Silvia espresso machine, the same model we have, outfitting it with an LCD display, microcontroller that automated the brewing process and precisely controlled the boiler temperature, all controlled from a repurposed Wii Nunchuck. This was the project that led me to discover the Arduino community.

(I’d love to do the same thing to our espresso machine, but I don’t want to become the kind of person who requires my espresso to be brewed precisely at 196 degrees and at a pressure of 8 bars, and so forth. But it sure would be fun project to take on!)

On a more personal level, learning about other people’s Arduino projects assured me that this was the time to fix up that stop light and start having some fun! I learned about a handful of outfits on the web that cater to hobbyists and found some great arcade-style buttons, missile switches, and distance sensors, as well as a source for fabricating single copies of printed circuit boards. My dad, who originally indulged this whole stop light thing three decades ago, gave me an Arduino board for my last birthday, and so restarted the snowball.

After some initial tinkering with the Arduino to learn about how it all works, it was time to build a printed circuit board that would interface between the Arduino microcontroller and the stop light. I produced a schematic and PCB layout in Altium Designer, which is admittedly overkill, but if the tool is available, why not use it?

After an agonizingly long wait for BatchPCB to return the bare board (as they say, cheap and fast do not go together), I assembled the board and tweaked the microcontroller code that flashed the lights in sequence. The relays make a satisfying clicking sound when switching.

Currently, the controller implements six modes.

  1. The sequence mode turns the two sets of lights in a timed pattern, just as if at a regular intersection. The dwell time of each state is not currently programmable, but it will be eventually.
  2. A random flashing mode
  3. A railroad crossing mode that alternately flashes the left and right red lights
  4. A manual mode that is controlled via my MacBook’s serial console through the Arduino’s USB port. What’s the next logical step, a web interface? Emily will be thrilled!
  5. A parking mode that turns the lights from green to yellow to red as either of our two cars approaches its parking spot in the garage. The ultrasonic distance sensors are sensitive to about half an inch, and the current code allows the thresholds to be saved. Soon the cars can be parked farther back in the garage so as to maximize available space in the front of the garage. The parking mode is entered when the garage door is opened, tripping a magnetic switch attached to the garage door frame. No more hanging tennis balls from the ceiling!

Inspired by a “busy box” that my grandfather built out of dangerous old light bulbs, switches, buzzers, and motors, the brains of the stop light controller are visible through a Lexan cover. Connections to the button box, sensors, and indoor garage door open indicator are all color coded cat‑5 cables. There’s still more work yet to do, but it’s exciting to see progress on a project that has been 30 years in the making. Who knows, perhaps this old stop light was the toy that predisposed me to become an engineer?


With apologies, we present LOLsprout. Beansprout meets magnetic poetry meets I Can Has Cheezburger. Make your own refrigerator messages.