Green Lights

by JosiahP4 in Circuits > Arduino

2259 Views, 11 Favorites, 0 Comments

Green Lights

2rw5yg.gif
IMG_3718.JPG

Green Lights is a project that was created to teach students about physical computing. This includes Inputs and Outputs, Electricity, programming with Arduino, and a little bit about traffic control systems. The intersection will be setup at the front of the classroom and students will be split up into teams. Teams will be given note cards with commands on them (Ex. lightOn('n', "green"); or sleep(2); ) which will be explained as part of the lesson. Overall, this project gives students an easy transition into the world of making electronics.

Tools and Supplies

IMG_3689.JPG
IMG_3692.JPG

A quick note about this at the beginning of this project, I tried to use a Raspberry Pi with a PWM hat but changed that because trying to locate the drivers took so much time.

Supplies:

Tools:

  • Computer with Arduino IDE installed
  • Low Temp Hot Glue Gun
  • Powerbank (if you want to carry it around and let students see up close)
  • Stuff to decorate your intersection

Construction

IMG_3693.JPG
IMG_3696.JPG
Please use the Intro pictures as reference
  1. Start by cutting the foamcore to the size of the intersection that you want
  2. Then cut four pieces of pink foam to the height that you want the lights to be at
  3. Hot glue the pink foam to the foamcore that you just cut on the north, south, east, and west parts of the board
  4. Cut a rectangle opening in front of the foam, below where the lights are about to go for the wires
  5. Glue the traffic lights to each piece of pink foam on the inside of the intersection
  6. Feed the female side of the wires up from the bottom and connect to the lights (keep track of the colors of the wires going Red Yellow Green Pins on the traffic lights
  7. Connect the male side of the wires to digital pins 2-13 on the Arduino

I did the following for this last step:

eastLightG = 2; eastLightY = 3; eastLightR = 4; northLightG = 5; northLightY = 6; northLightR = 7; southLightG = 8; southLightY = 9; southLightR = 10; westLightG = 11; westLightY = 12; westLightR = 13; GND to GND for all of them;

Testing/Coding

IMG_3698.JPG
IMG_3712.JPG

The hackathon1 file is a simple sketch that tests a traffic light. The GreenLights file is what I will be using to teach. Most that you need to know is commented in the code.

Problems and Future

IMG_3690.JPG
IMG_3691.JPG

I ran into a few problems throughout this project. The main one was with the wiring that came with the lights. The lights work great but the wires, not so much. Another pointer is don't use digital pins 1 and 0 because the code that I use includes Serial communication (requires 0/1) to carry messages back to the computer. Lastly, these materials were used to prove a concept so a hot glue gun may be required if something falls off.

I look forward to moving out of the prototyping phase into better quality building materials. This is one of four possible lessons that I could take to a study abroad in Norway so stay tuned. The light you see in the image is an actual yellow light. I hope to get that working with an Arduino using a relay so that the students can see the full size and brightness of just one part of an actual traffic light. Overall, this is an easier (cool) way to show others how an Arduino works!