Piperbot and Pip are dealing with an intergalactic traffic jam! In this mission, students will build a series of LEDs and program them to light up in specified ways, introducing hardware inputs and outputs and coded elements like time delays, sequential triggers, and code loops.
Students will create programs that use variables to store and modify data.
Students will test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
Students will build knowledge by actively exploring real-world issues and problems, developing ideas and theories, and pursuing answers and solutions.
I WILL BE ABLE TO...
Build a sequence of 3 LEDs
Code my own traffic light
Learning Activities
Extension: Traffic Light PCBA Challenge
In this challenge, students will understand how to take a prototype (their traffic light) and turn it into a product that can be used in the real world. In this challenge students will learn about Printed Circuit Board Assembly or PCBA. Instructions are in the make.playpiper.com tutorial that may be accessed on the final step of the Mission Traffic Light or by clicking the SHOW ALL button on the Expedition Teleport Menu then selecting the TRAFFIC LIGHT PCBA Mission.
ELA Extension: Martian Traffic News Article
Pair students together or allow them to work independently based on grade level and writing proficiency. Each student (or pair) will write a fictional news article set on Mars, using cause-and-effect reasoning and past-tense narration.
Set the scene by choosing a location (e.g., Mars Blvd & Rover Lane) and characters (e.g., Pip, Piperbot, alien travelers, delivery drones). Ask students to describe a traffic incident that was either caused or prevented by a traffic light system.
Have them outline the sequence of events and the outcome of the situation. Encourage use of cause-and-effect language, such as:
“Because the light turned green too early, the rover sped through the intersection.”
“Thanks to the looped condition, traffic was safely stopped.”
Students then write their article using a headline, byline, and a lead paragraph to hook the reader. Encourage use of a journalistic tone and include direct quotes from characters if appropriate. Students must use at least three of the following coding vocabulary words: input, condition, loop, output
Ask students to peer review each other’s writing for clarity, vocabulary usage, and accurate sequence. (Optional) Invite students to create a front-page layout or draw a visual of the Martian traffic scene.
Bonus points for using all four vocabulary words and making readers feel like they’re reading a real news story from outer space!
ELD Extension: Martian Traffic Skits
Pair students so that each English Learner (EL) is working with a fluent English speaker or a higher-level EL.
Each pair will write and perform a short dramatic skit about a traffic scenario on Mars using academic vocabulary, sequencing language, and cause-and-effect statements.
Begin by brainstorming imaginative traffic scenes with your partner, such as Piperbot directing hovercars, alien tourists crossing the road, or a delivery rover on a tight schedule.
Plan the skit to include at least one problem and solution related to traffic signals.
"If the signal had worked, ___ would not have happened."
Write the skit using a script format. Students should use past tense, direct dialogue, and include at least one cause-and-effect statement and one conditional sentence.
Rehearse the skit using hand motions, visuals, or props to support clarity and expression.
Each pair will perform their skit for the class. Afterward, the audience will reflect on:
What was the traffic issue?
What was the outcome?
Which key vocabulary and sentence structures did they hear?
Finally, extend the activity by inviting students to add a “news report” scene where one character explains the incident and how the traffic system could be improved.
Math Extension: Traffic Light Timing
Pair students together or allow them to choose their partners. Each pair will observe or simulate a traffic light cycle and analyze the timing of red, green, and yellow lights using pattern recognition, time intervals, and conditional reasoning.
Start by having students observe or simulate a basic traffic light pattern: red, green, yellow. Ask students to record how many seconds each light stays on. Example: Red – 5s, Green – 4s, Yellow – 2s.
Have students build a visual timeline or number sequence that represents one full cycle. Ask: How long is one complete cycle? What would two full cycles look like?
Introduce conditional thinking by asking: “If the shuttle arrives during the yellow light, should it stop or go?” Have students write or explain what should happen in each condition and why, using logical reasoning.
Challenge students to redesign the timing to improve traffic safety or speed. Ask them to present their optimized light cycle (e.g., 6s red, 3s green, 1s yellow) as a pattern and justify their decisions using math vocabulary such as interval, sequence, duration, or probability.
Encourage students to compare their designs and discuss which sequence is the most efficient or fair.
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
Is the LED failing to light up when you hit START?
The most common issue is that the LEDs may be plugged in incorrectly. Be sure the anode and cathode (i.e., short and long sides of LEDs) are oriented correctly, according to the tutorial.
Ensure that you’ve plugged the wires into the right GPIO. Look at the Digital View to see which pin you’re affecting.
Our customer support specialists are on hand to ensure your implementation of Piper runs seamlessly. View Support Docs or Contact Support
EXPANDED RESOURCES
Term Glossary
Ground Pin A ground pin is a connection point in an electronic circuit that provides a common return path for electrical current. It helps complete the circuit by allowing excess electricity to flow safely away, which helps prevent damage to the circuit and keep everything working correctly.
Loop A part of a computer program that repeats a chunk of code a specified number of times or while a condition is true.
Boolean A type of data or expression with two possible values: true and false.
Mini buttons are types of momentary switches that only remain in their state as long as they're being actuated (pressed or held down). Pressing down on the button will close the circuit, letting the microcontroller know that current can pass through the circuit. When you let go of the button, the circuit opens back up letting the microcontroller know to stop allowing current to flow through the circuit. Most often momentary switches are best used for intermittent user-input cases like mode buttons for controllers because they are so easy to press or "click".
This button has two terminals which means it can only connect to a single input (connected by Jumper wire to a GPIO pin on a microcontroller) and a single output (connected by Jumper wire to a ground pin on a microcontroller). These work well as simple on/off circuits for one conducting loop.