Traffic Lights with Smart Soldering Kit


Traffic lights are used at the intersection of two roads to control the flow of traffic. They use a universal colour system – red for stop, yellow for caution, and green for go – to direct drivers and pedestrians.
Let’s think about Sustainable Cities and Communities by building a traffic light for Forward’s Smart City!
The traffic light in the project will:
- cycle traffic on a timer using red, yellow, and green LEDs

Prepare
You’ll need the following items to complete this project:
- Climate Action Kit
- micro:bit V2
- Previously soldered Smart Solder component
- Computer with access to Microsoft MakeCode
Build
First, let’s build our traffic light project with the building blocks and robotic components from the Climate Action Kit and the Smart Solder component:
As you build, think about the orientation of your red, yellow, and green lights, how tall your design should be, and how to make your traffic light sturdy.
Code
Explore the code below to get started using your Traffic Light.
- Connect your project to the computer and download the starter code to make it work!
- Review the code comments on each block to learn about how your traffic light works, then try testing it in real life.
Improve
Think about accessible features to add to your traffic light! How would you modify the sample code provided, or create your own code that includes the following features?
- A motion sensor to sense when a car is waiting
- A pedestrian signal or crosswalk function
No Smart Soldering Kit? No Problem!
You can modify this project by replacing the Smart Solder component with the LED Ring from the Climate Action Kit, and test your traffic light using the code provided.
Feeling Stuck? Explore the Knowledge Base for common questions and troubleshooting tips.