In the world of timed stoplights, we all understand the aggravation behind them. My partner and I decided to go with a smart stoplight, something that is utilized today, but not at every intersection. The idea was to use some kind of sensor in order to create a simple, smart stoplight. After some advice from our professor, an inductive sensor was the best option that would only detect metal. After purchasing all materials and with an idea an mind, we went to work.
The Process:
The idea is very simplistic. The smart stoplight uses two photons: input and output. The input photon consists of wiring using a ground (green), switch (white), and a positive 5V source (purple) shown in the picture below. The switch is the inductive sensor that will light up when ONLY metal is detected. We used pin D6 as an input_pullup to tell the LED light on D7 to light up. This will be shown in the code. Here is a photo of how the input Photon is setup.
As shown in the code, the publish/subscribe function is used so the input and outputs can communicate and relay messages back and forth and vice versa.
The output photon is very similar. It uses a ground (red), positive 5V source (left purple), and a final wire (right purple) that uses pin D6 to react as an output to tell the NeoPixels to light up.
The "string message" in the output photon code is whats used in place of IFTTT in order to get real time data/graphs. The result of that is shown below.
The rest of the project consisted of arts, crafts, and fine tuning. We used Styrofoam blocks with wooden dowels stuck in them as the light poles for the intersection. We also printed out and made our own intersection.
We used twelve lights total but only had every other one light up. The strip was posted up to the poles using tape and mini-clothes-pins. The final result is shown below with the inductive sensor beside the road.
And here is the final result:
Comments