On the first day I started working for The Systems Group I saw a darkened traffic light sitting on the ledge next to the engineering loft. I pondered if this light worked, was it 110v or low voltage, and what made it switch between red and green. The one thing I did know is that I wanted to see this thing function.
Within a short time of working at TSG I took the opportunity to examine the light only to find that it had no source of power. Later I would learn that it was purchased for a job to be used as an “on-air” light for a studio. The idea got scrapped and we were left with this traffic light as a memento of a once intriguing idea turned failure.
I still wanted to get this light going but I didn’t have much time available to devote to this project so it sat on the back burner. Then, within the past two months I had the infusion of knowledge that I needed to get this project going again. I fell into the world of microprocessors and started experimenting with the Arduino. I recently built a CD-Duplicator out of LEGO and an Arduino and I wanted to try my hand at the mini Arduino (non prototyping version). This was the perfect project to hone that skill.
I prepped for the project by getting as much of the electronics setup ahead of time as I could without knowing exactly what was inside of the traffic light. I knew that I didn’t want the light to just randomly switch between red and green. I wanted it to have some purpose. I decided that the appropriate direction would be to use the traffic light to direct traffic in the office. Since the traffic light faced the outward direction of the engineering loft I would put a motion detector to sense when a person was walking out of the loft. When someone was exiting the loft it would turn the light red for people entering the area. When no one was exiting the loft the light would be green indicating that it was ok to enter the loft. I bought a PIR for this purpose. For those of you interested in using this product please note that it uses 12 volts to run. It will not give the appropriate feedback if using less than 12 volts. (NOTE: this I did find people who said it does work at 5v. This needs verification. It did not work at 5v for me).
We had a long weekend for Thanksgiving and I just happened to stay late on that Wednesday. There were only two other people in the office when I left so I grabbed the traffic light when I knew no one would notice it was gone and darted out of the office. My idea was to have the traffic light fully functional on Monday morning without anyone noticing it was gone.
Here’s where it gets fun. Friday, after eating a wonderful meal with my family, I woke up early and opened the traffic light to see what was inside. What I found was actually slightly unexpected. I found a metal plate screwed to the back of the box. That plate had two holes punched in it. It had one hole behind each light diffuser. The hole behind the green diffuser had a ceramic light bulb socket in it. The one behind the red diffuser was missing. The bulbs, still in their packaging, were 65 watt incandescent bulbs.
I knew I wasn’t going to use 110 volt power to run this thing so I pulled the ceramic socket out of the plate in preparation for the lighting I was going to use. The only problem was that I didn’t know what lighting I was going to use. I thought about using LEDs but the ones I had were not bright enough for the task. So I rummaged through some junk until my dad chimed in and said, “I have some old outdoor low voltage lights I was going to throw out.” So I grabbed those and started doing some calculations. 7 watt, 12 volt bulbs yield .6 amps (roughly). This was fine for the electronics I had planned out. Then I fitted them for their installation into the traffic light box. They had 2″ by 6″ plastic housings that needed to be cut down in order to fit into the traffic back box. Then I drilled holes in the plastic backing to run the wires behind the metal plate. The wires were wire-nutted to a three conductor 20 awg wire and sent out of a hole I drilled in the back. I used one conductor as the common for both lights and the other two conductors for red and green.
I brought this wire into the project box that housed the Arduino and PIR sensor. The Arduino is a little overkill for this application but I wanted the ability to quickly change the way the light functions and as I stated before I wanted to learn about this smaller form factor Arduino. In fact I learned a lot. When I was prepping the electronics for this project the week before, I accidently fried the Arduino I was working with. On the Arduino Pro-Mini the Vin is not the input to the voltage regulator. 12v on the Vin will let the smoke out. You have to use the “Raw” input. This is not explicitly stated in the documentation and I only found out after reading a comment on the sellers website. I just wish I read that before I ruined one. Vin is actually the input for a pre regulated 5 volts. It basically exists on the output of the internal 5v regulator. Since this is on the output of the 5 volt regulator I use that as a 5v output to reference the pull up resistors.
Here is a little more about how it functions. I am using one digital output to drive a relay. The relay is what activates the lights. I actually had wanted two digital outputs to drive two relays so I could trigger both lights independently. I only had one 5v relay laying around so I went with the one output configuration.
Here are some photos of the lights triggering.