Students will build a simple circuit using a microcontroller, LED, jumper wire, and resistor, and program the LED to blink by creating and testing code that uses sequences and loops. Through this activity, students will understand how hardware and software work together to control electronic components and apply foundational programming concepts to achieve a desired outcome.
Piperbot made it to Mars but can’t see where to land. Help Pip signal to him by building a circuit with an LED and code it to blink. This mission walks through the basics of current, how it flows, and how you can use code to control it.
Students will determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies. (CSTA 1B-CS-03 and 2-CS-03)
Students will learn the fundamental programming concepts of executing code in a specific order (sequence) and repeating a block of code based on a condition (loop). (1B-AP-10)
Students will understand how to break down a problem into smaller, manageable steps to create automated solutions through coding. (ISTE 1.5.d)
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
Check the START Button: To run your code, click the START button in the top-left corner of the screen. Be careful not to confuse this with the green START block in your code. The green START block is part of the code and shows where the program begins, but the START button in the corner is what actually runs the program.
Check Your ON and OFF Blocks: Make sure your code has a block to TURN PIN ON and another to TURN PIN OFF. If both blocks are set to TURN PIN ON, the LED will stay on and won’t turn off.
Check the LED Orientation: If your code is running correctly (you can see the correct GPIO pin blinking in the DIGITAL VIEW) but the LED isn’t lighting up, it may be inserted backwards. The LED has two legs:
The long leg (anode) is the positive side.
The short leg (cathode) is the negative side.
LEDs only work when the current flows in the correct direction, so make sure the long leg is connected to the positive pin where the resistor is located.
Our customer support specialists are on hand to ensure your implementation of Piper runs seamlessly. View Support Docs or Contact Support
Breadboard A plastic board with many holes electrically connected by inner metal strips. Components and wires can be electrically connected by plugging them into the holes on the breadboard.
LED (Light Emitting Diode) A diode is like a one-way valve that only allows electricity to flow in one direction. All diodes give off some light (visible or invisible) when electricity passes through them, but LEDs give off lots of visible light in specific wavelengths (colors).
Loop A part of a computer program that repeats a chunk of code a specified number of times or while a condition is true.
Power The current or flow of electric charge and voltage.
Resistor An electrical component that limits the flow of electrical current in a circuit. It is often used in the circuit of a PED to prevent too much current from damaging the LED.
Current The measure of the flow of electricity. Specifically, how many electrons pass through a point in a conductor or wire in a given amount of time. Current is measured in units called Amperes, or Amps for short.
Breadboards are temporary prototyping devices that allow you to test circuit designs with electronics. The components of the circuit are interconnected by inserting leads into the holes of the Breadboard and using Jumper wires to complete the circuit when needed.
The holes in the Breadboard are aligned with metal clips because metal conducts electricity and allows current to flow. The holes in the breadboard are connected by metal clips in the pattern shown by the green lines
Resistor
The Resistor's role in Piper Make's circuits is to decrease the current and voltage flowing through the loop. When wiring a LED, you include a Resistor in the circuit of an LED when it is connected to a power source or a microcontroller.
Small Resistors, like the one in the Piper kit, use colored painted bands to indicate both their resistive value and their tolerance with the physical size of the Resistor indicating its wattage rating. These colored painted bands produce a system of identification generally known as a Resistor's Color Code. The color stripes on your kit's Resistor represent a value of 330 ohms. We selected this Resistor by measuring the voltage and current needed for the LEDs provided in this kit by using the following formula; Resistor = (Circuit Voltage - LED voltage) / desired LED current.
LED
LED stands for "Light Emitting Diode". A diode is device that allows current to flow in only one direction. LEDs use current traveling through the circuit to release energy in the form of light. The LEDs in your kit emit light in the visible spectrum. You can find diodes in common household items like remote controls and RC cars.
Since LEDs are diodes, they must be wired in a particular direction on a Breadboard, in the loop of a circuit. The longer pin of the LED should be lined up with the + end of the circuit (connected by Jumper wire to a GPIO pin on a microcontroller) and the shorter pin of the LED with the - end (connected by Jumper wire to a ground pin on a microcontroller).