TRAFFIC LIGHT

PIPER MAKE EDUCATOR RESOURCES SERIES

STARTER EXPEDITION KIT

BUILD AND CODE A WORKING TRAFFIC LIGHT

Beginner

1 hr

Ages 8+

You will need a Starter Kit to do this mission. Get yours here:

CHECK OUT THE BUILD:

LEARNING OBJECTIVES

  • Build three LEDs (red, yellow, and green) and learn how to code them to light up sequentially.
  •  
    • Code a loop to turn the LEDs off and on at certain time intervals. Understand which command in the Python code determines the timing of the blinking.
  • Makers Challenge: Consider how to add a button to affect the sequence of lights at the stoplight.

EDUCATOR RESOURCES

  • You can share the mission directly to your Google Classroom after logging into your Google educator account in the top right corner of Piper Make.

Check out our easy assignment template that you can use to ask students to share their work by including pictures of their final circuits and code.

Check out our Python-focused assessment that you can copy and share directly to your Google Classroom.

  • Useful vocabulary terms to use in classroom: input, output, microcontroller, GPIO pins, circuit

TROUBLESHOOTING TIPS

LED not lighting up when you hit START?

Most common issue: LEDs might be plugged in the wrong direction! Make sure the anode and cathod (i.e., short and long sides of LEDs) are appropriately oriented according to tutorial.

  • Ensure that you've plugged the wires into the right GPIO (take a look at the Digital View to see which pin you're affecting)

Not sure what the point of the resistor is in the circuit?

    • Each LED in the circuit has a small amount of intrinsic resistance, which the Pico might recognize and try to turn up the current flowing through the circuit. This can damage the Pico; therefore, to reduce the current, we add a resistor to the circuit.

FINAL HARDWARE

In this lesson, students will build three LEDs to light up sequentially.

FINAL CODE

This is the final code that is created. Download the embedded PNG and use the CREATIVE mode to import it to a new workspace:

OVERVIEW OF STEPS