BLINK

PIPER MAKE EDUCATOR RESOURCES SERIES

To do this project, you will need a Piper Make Starter Kit. Get yours here:

Learn to blink a light using your Raspberry Pi Pico.

To get started, head to Piper Make and hit this icon:

Time: 30 minutes

Age Range: 8+

Difficulty: Beginner

LEARNING OBJECTIVES

Students will:

 

  • Create quick basic commands for real world problems then link to coding concepts
  • Understand computational thinking concepts, including algorithms, sequence of instruction, and loops
  • Demonstrate how computer hardware and software work together as a system to accomplish tasks.
  • Review these key electronics and programming understandings:
    • wire and pin positions for specific inputs and outputs.  
    • electric flow is sensed by the computer hardware (the pin) and programmed to have an effect in software (pin code), and thus on the screen (actions occurring).
    • the computer is programmed (ie block code is written) to detect electricity going into the pin (the pin is on). The program also sends a high voltage to the pin (turn the pin on) when light is desired (a button is pressed).
  • Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies.
  • Make observations to provide evidence that energy can be transferred from place to place by light, and electric currents.

STANDARDS ALIGNMENT

CSTA's K-12 Standards

1B-CS-01: Describe how internal and external parts of computing devices function to form a system. Subconcept: Devices; Practice 7.2

1B-CS-02: Model how computer hardware and software work together as a system to accomplish tasks. Subconcept: Hardware & Software; Practice 4.4

1B-CS-03: Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies. Subconcept: Troubleshooting; Practice 6.2

1B-AP-10: Create programs that include sequences, events, loops, and conditionals. Subconcept: Control; Practice 5.2

1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process. Subconcept: Modularity; Practice 3.2

CCSS ELA

CCSS.ELA.L.W.3.8: Recall information from experiences or gather information from print and digital sources; take brief notes on sources and sort evidence into provided categories.

CCSS.ELA.L.W.3.10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

World-Class Instructional Design and Assessment (WIDA) English Language Proficiency Standards

ELD-SI.K-3.Argue:

Ask questions about others’ opinions
Support own opinions with reasons
Clarify and elaborate ideas based on feedback
Defend change in one’s own thinking
Revise one’s own opinions based on new information


ELD-SC.2-3.Argue.Interpretive:

Interpret scientific arguments by
Identifying potential evidence from data, models, and/or information from investigations of phenomena or design solutions
Analyzing whether evidence is relevant or not
Distinguishing between evidence and opinions

California's K-12 Computer Science Standards

3-5.CS.1: Describe how computing devices connect to other components to form a system.

3-5.CS.2: Demonstrate how computer hardware and software work together as a system to accomplish tasks.

3-5.CS.3: Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies.

3-5.AP.12: Create programs that include events, loops, and conditionals.

3-5.AP.13: Decompose problems into smaller, manageable tasks which may themselves be decomposed.

Common Core English Language Arts

CCSS.ELA.L.W.3.8: Recall information from experiences or gather information from print and digital sources; take brief notes on sources and sort evidence into provided categories.

CCSS.ELA.L.W.3.10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

California English Language Development Standards

CA ELD.3.C.11: Supporting own opinions and evaluating others’ opinions in speaking and writing

CA ELD.3.C.12: Selecting and applying varied and precise vocabulary and language structures to effectively convey ideas

Michigan Integrated Technology Competencies for Students (MITECS)

1B-CS-01: Describe how internal and external parts of computing devices function to form a system. Subconcept: Devices; Practice 7.2

1B-CS-02: Model how computer hardware and software work together as a system to accomplish tasks. Subconcept: Hardware & Software; Practice 4.4

1B-CS-03: Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies. Subconcept: Troubleshooting; Practice 6.2

1B-AP-10: Create programs that include sequences, events, loops, and conditionals. Subconcept: Control; Practice 5.2

1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process. Subconcept: Modularity; Practice 3.2

Michigan English Language Arts

Michigan ELA, Grade 3-8, Research, 8: Recall information from experiences or gather information from print and digital sources; take brief notes on sources and sort evidence into provided categories.

Michigan ELA, Grade 3-8, Range of Writing, 10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

WIDA English Language Development

ELD-SI.K-3.Argue:

  • Ask questions about others’ opinions
  • Support own opinions with reasons
  • Clarify and elaborate ideas based on feedback
  • Defend change in one’s own thinking
  • Revise one’s own opinions based on new information

 

ELD-SC.2-3.Argue.Interpretive:

  • Interpret scientific arguments by
  • Identifying potential evidence from data, models, and/or information from investigations of phenomena or design solutions
  • Analyzing whether evidence is relevant or not
  • Distinguishing between evidence and opinions

Social Studies Texas Essential Knowledge & Skills Grade 3

(b)(16) Science, technology, and society. The student understands how individuals have created or invented new technology and affected life in various communities, past and present. The student is expected to:

  1. (A) identify scientists and inventors, including Jonas Salk, Maria Mitchell, and others who have discovered scientific breakthroughs or created or invented new technology such as Cyrus McCormick, Bill Gates, and Louis Pasteur; and
  2. (B) identify the impact of scientific breakthroughs and new technology in computers, pasteurization, and medical vaccines on various communities.

Science Texas Essential Knowledge & Skills Grade 3

(b)(2) Scientific investigation and reasoning. The student uses scientific practices during laboratory and outdoor investigations. The student is expected to:

    (A) plan and implement descriptive investigations, including asking and answering questions, making inferences, and selecting and using equipment or technology needed, to solve a specific problem in the natural world;

(b)(3) Scientific investigation and reasoning. The student knows that information, critical thinking, scientific problem solving, and the contributions of scientists are used in making decisions.

Science Texas Essential Knowledge & Skills Grade 4

(a)(1)(A) Within the physical environment, students know about the physical properties of matter including mass, volume, states of matter, temperature, magnetism, and the ability to sink or float. Students will differentiate among forms of energy including mechanical, light, sound, and thermal energy. Students will explore electrical circuits and design descriptive investigations to explore the effect of force on objects.

(b)(3) Scientific investigation and reasoning. The student uses critical thinking and scientific problem solving to make informed decisions. The student is expected to:

    (A) analyze, evaluate, and critique scientific explanations by using evidence, logical reasoning, and experimental and observational testing;

    (B) represent the natural world using models such as the water cycle and stream tables and identify their limitations, including accuracy and size; and

    (C) connect grade-level appropriate science concepts with the history of science, science careers, and contributions of scientists.

Science Texas Essential Knowledge & Skills Grade 5

(a)(1) In Grade 5, scientific investigations are used to learn about the natural world. Students should understand that certain types of questions can be answered by investigations and that methods, models, and conclusions built from these investigations change as new observations are made. Models of objects and events are tools for understanding the natural world and can show how systems work. They have limitations and based on new discoveries are constantly being modified to more closely reflect the natural world.

(a)(3) Recurring themes are pervasive in sciences, mathematics, and technology. These ideas transcend disciplinary boundaries and include patterns, cycles, systems, models, and change and constancy.

ELA Texas Essential Knowledge & Skills Grade 3

(b) (1)Developing and sustaining foundational language skills: listening, speaking, discussion, and thinking--oral language. The student develops oral language through listening, speaking, and discussion. The student is expected to:

    (A) listen actively, ask relevant questions to clarify information, and make pertinent comments;

    (B) follow, restate, and give oral instructions that involve a series of related sequences of action;

    (C) speak coherently about the topic under discussion, employing eye contact, speaking rate, volume, enunciation, and the conventions of language to communicate ideas effectively;

    (D) work collaboratively with others by following agreed-upon rules, norms, and protocols; and

    (E) develop social communication such as conversing politely in all situations.

ELA Texas Essential Knowledge & Skills Grades 4 & 5

(b) (1)Developing and sustaining foundational language skills: listening, speaking, discussion, and thinking--oral language. The student develops oral language through listening, speaking, and discussion. The student is expected to:

    (A) listen actively, ask relevant questions to clarify information, and make pertinent comments;

    (B) follow, restate, and give oral instructions that involve a series of related sequences of action;

    (C) express an opinion supported by accurate information, employing eye contact, speaking rate, volume, enunciation, and the conventions of language to communicate ideas effectively; and

    (D) work collaboratively with others to develop a plan of shared responsibilities.

(b)(13) Inquiry and research: listening, speaking, reading, writing, and thinking using multiple texts. The student engages in both short-term and sustained recursive inquiry processes for a variety of purposes. The student is expected to:

    (A) generate and clarify questions on a topic for formal and informal inquiry;

    (B) develop and follow a research plan with adult assistance;

    (C) identify and gather relevant information from a variety of sources;

    (D) understand credibility of primary and secondary sources;

    (E) demonstrate understanding of information gathered;

    (F) differentiate between paraphrasing and plagiarism when using source materials;

    (G) develop a bibliography; and

    (H) use an appropriate mode of delivery, whether written, oral, or multimodal, to present results.

§74.4. English Language Proficiency Standards

(c) Cross-curricular second language acquisition essential knowledge and skills.

(3) Cross-curricular second language acquisition/speaking.

(D) speak using grade-level content area vocabulary in context to internalize new English words and build academic language proficiency;

(E) share information in cooperative learning interactions;

(F) ask and give information ranging from using a very limited bank of high-frequency, high-need, concrete vocabulary, including key words and expressions needed for basic communication in academic and social contexts, to using abstract and content-based vocabulary during extended speaking assignments;

(G) express opinions, ideas, and feelings ranging from communicating single words and short phrases to participating in extended discussions on a variety of social and grade-appropriate academic topics;

(H) narrate, describe, and explain with increasing specificity and detail as more English is acquired;

CONCEPTS

Students will need to remember the micro controlling electronics concept that each GPIO pin on the Raspberry Pi Pico has a number. They learn that they need to create PiperCode to control the GPIO pins on their breadboard and that will control what happens to their LED light output. They will write a repeat forever loop with code blocks inside to turn the light on, wait, then turn off, to blink the LED.

PARTS

Raspberry Pi Pico, breadboard, charging cable, M2M Black jumper wire, Blue LED, 330 Ω Resistor

GPIO SETUP

LED, GP25, GP15

OVERVIEW OF STEPS

Step 1: The Landing

Help Pip set up a blinking light to show Piperbot where to land on Mars!

Step 2: Raspberry Pi Pico

The Raspberry Pi Pico includes an RP2040 microcontroller, which is a type of integrated circuit (IC). Typical microcontrollers have a processor, memory and input/output (I/O) peripherals. The Pico’s RP2040, as well as connectors and other components, are mounted on a printed circuit board (PCB).

Take a look at your Pico—it’s the size of a stick of gum, but in the middle of its green PCB, you can see the square, black RP2040. On the sides are the GPIO pins.

Step 3: Get to know your GPIO pins

Your Pico “talks” to both your hardware (LEDs, sensors, etc.) and your computer. The USB cable lets the Pico talk to your computer, but how does your Pico communicate with the hardware?

In the Getting Started tutorial, you learned about the GPIO pins on the Pico and you used one of them as an input.

In this tutorial, we will use a GPIO as an output to power an LED.

Step 4: Onboard LED

Start by finding the onboard LED: it’s a small rectangular component on the top left of the board next to the microUSB port. There’s a small label that says ‘LED’.

LED stands for Light Emitting Diode. A Diode is a kind of electrical component that has two slightly different layers, and electricity will only go through them in one direction. All diodes emit, or give off, some kind of energy when electricity passes through them. Light emitting diodes give off a lot of energy in the form of visible light when electricity passes through them.

The GPIO pin connected to the LED is an OUTPUT which means when you turn GP25 ON, this light will switch on. But since it’s an onboard GPIO pin, no wiring is required.

Step 5: Plug in your Pico

Let's go ahead and plug in your Pico to your computer:

Click CONNECT to communicate with your Pico, then, click NEXT.

Step 6: Time to start coding

Awesome! So how do we make that onboard LED blink on and off? Let’s break it down.

From the Chip menu, drag out a Start block and place it in your workspace. Now, drag out a Turn Pin block from the Chip menu (for turning ON the LED), and connect it to the bottom of the Start block.

Once you've built the code above, click NEXT.

Step 7: On, Wait, Off

From the Chip menu, drag a wait block out and attach it to the turn pin block. This will keep the LED ON for some time.

Now, drag another turn pin block out and attach it to the bottom of the wait block. This will turn OFF the LED.

Step 8: Pin Numbers

Hit the Digital View button to pull up a little map view of your Pico. You can see the pin numbers on the Pico there!

Step 9: Change Your Pins

Change the pin numbers to 25 (LED) and the wait time to however long you would like the LED to stay on! Then hit START!

Step 10: Loop-De-Loop

With the Chip blocks in place and the correct variables, let's put a Loops block in our program!
 
Change the wait variable in the repeat forever block to 1 to make it stay off for 1 second!

Step 11: Start your code!

The big moment has arrived. Let's see if your code works. Go ahead and click the START button in the upper left corner of your workspace.

Is your onboard LED blinking?

Go ahead and see what happens when you change the wait times. Make sure to hit START again if you modify the code.

When you are done experimenting with different wait times, click NEXT.

  • The most common mistakes students make is to have the incorrect pin number in the code. Also make sure that they are first turning ON the pin, then turning it OFF.
  • The LED must be inserted properly into the breadboard to work.

Step 12: Break Out the Big LEDs

Let’s grab the breadboard, jumper wires, an LED and a resistor!

Any color LED and any color jumper wire will work so pick your favorite!

When you have your parts, click NEXT.

Step 13: Circuits 101

Step 14: Tone Down the Power!

If we make a circuit between just wires and the light, the Pico tries to push too much electricity through the circuit and it can damage things!

We don't want that, so let's reduce how much current is flowing through our circuit. Let's limit the flow with our resistor!

Step 15: Map the Circuit!

To complete your circuit, you have to make a closed loop! This means adding a wire back to one of the ground pins of the Pico. Your circuit should look something like this:

You can expand the image to get a better view by clicking the icon in the upper-right of the image!

When you finish building your circuit, click NEXT.

Step 16: To Resist or Not to Resist?

Step 17: Wait, What About the LED?

The long wire, known as a lead, is called the anode, and represents the positive (+) side of the circuit; the short lead is the cathode, and represents the negative (-) side.

At the bottom of the colored part of the LED, there is a thin ridge. The flat spot on the ridge also indicates which side is the cathode (-).

When you find the long lead of your LED, click NEXT.

Step 18: Circuit Mapping, Complete!

The full journey of our electrons are from the the Pico's OUTPUT pin →
through the resistor
through the long anode (+) of the LED →
through the body of the LED (LIGHT!)
to the short cathode (-) of the LED →
through the wire
to one of the Pico's GROUND pins.

Push the long lead (the anode) into a breadboard hole in the same row as the resistor end. Plug the short lead (the cathode) into a breadboard hole on the other side of the center gap. Remember the rows on either side of the gap have different horizontal connections so electricity will only flow through the LED!
Click NEXT.

Step 19: Pin Change Up!

Let's change our onboard LED code to work for GPIO pin, GP15. Remember to change both turn pin variables to 15.

Click the START button and see if your external LED blinks! If it doesn't work, don't fret! Troubleshooting is part of being an engineer.

Click NEXT.

Step 20: Troubleshooting

In the DIGITAL VIEW, you should see the voltage of pin GP15 changing as the LED pulses. If you don't see any changes in the DIGITAL VIEW, check your code and make sure you are turning pin 15 ON.

If your light is NOT blinking but you see GP15's voltage changing in the DIGITAL VIEW, then your problem must be in your hardware.

Go back to the "Build the LED and wires" step and make sure you put the LED in correctly, aligning to the rows of GP15 and the resistor.

If you get your LED to blink, click NEXT.

Step 21: Self Check!

What are devices in the real world that require blinking lights?

Once you've found a few real-world examples, click NEXT.

Step 22: You Finished!

Click EXIT to return to the menu and start your next coding challenge.