Two things inspired this project:
One was I always wanted to hang a traffic light in my garage and finally aquired one. Once I mounted it to the ceiling,
I was disappointed that I had to plug it in manually and all three lights came on at the same time. I decided to purchase
a circuit board that alternated the lights after a specific time interval. This still wasn't satisfying.
The second was the difficulty to get my vehicle in without getting too close to the back wall
or not close enough and the garage door closes on my vehicle. I originally hung a tennis ball on a string from the
ceiling that would tell me when to stop but I wanted something better.
So along came this project. The traffic light powers up when the garage door opener is triggered to open/close. This is accomplished by wiring
the traffic light into the garage door opener bulb socket. When powered, the traffic light turns green. The traffic light is also wired to
a pressure plate that is placed on the ground, directly where the rear tire will need to stop when fully in the garage. Every time the pressure plate
is pressed, the traffic light toggles its color
So, when I open the garage by pressing the button from my vehicle, the green traffic light comes on. As I pull into the garage, the
front tire hits the pressure plate changing the traffic light to yellow. As I proceed slowly into the garage, the rear tire hits the pressure
plate and changes the traffic light to red, indicating me to stop. Perfect use for a traffic light. Here is the documentation: