INTRODUCTION TO COMPUTATIONAL THINKING

Lesson Time:
45 to 60 minutes

LESSON GOALS

 

In this phase, students will use PiperCode to dive deeper into coding and electronics. Students will also have the opportunity to build and program video games, interactive electronic controls, and devices.

PiperCode includes tutorials built into the programming environment with animations that provide step by step instructions for each project. The projects are scaffolded so that students can learn the basics and then apply them to more advanced projects.

In this lesson, students complete the first PiperCode project, Blink, to get a basic introduction intro writing an algorithm with sequences and loops. They will learn this vocabulary and practice computational thinking skills in order to utilize pseudocode before coding in the block-based language, Blockly.

LESSON RESOURCES

 

CAREER CONNECTIONS

 

Data Scientist

Graphic Designer

App Developer

Video Game Developer

ESTABLISHED GOALS

This lesson introduces students to creating algorithms with loops. In addition to completing the first PiperCode project, Blink, students also engage in an “unplugged” activity to get students thinking about how coding requires exact language. In Blink students will wire a circuit with an LED and make it turn on and off at a defined rate with code.

Note: There are step by step instructions for the students to follow in the tutorials included in each project on Piper. These provide directions both for writing code and for building the electronic circuits. The tutorials are well-defined and most students will be able to follow them with little assistance required.

 

 

LEARNING OBJECTIVES

1.

Create basic commands for real world problems and link them to coding concepts.

 

2.

Discover computational thinking concepts, including algorithms and loops.

3.

Demonstrate how computer hardware and software work together as a system to accomplish tasks.

4.

Determine potential solutions to solve simple hardware and software problems using common troubleshooting strategies.

 

5.

Make observations to provide evidence that energy can be transferred from place to place by light, and electric currents.


LESSON PREPARATIOn (10 MINutes)

 
  • Open a side space in the room for students to move around for first part of the lesson.
  • Create 5 sample simple tasks for the pairs to use in the Engage Activity (ex: peeling a banana, tying a shoe, opening a door, brushing your teeth, or making a peanut butter and jelly sandwich)
  • Suggested student to kit ratio is 2:1 up to 3:1. Students are in the same teams as before, or make adjustments as necessary to facilitate good teamwork.
  • Make sure Piper kits are built, connected, and functioning. Make sure batteries are charged and electrical components are in the storage chest.
  • If another group of students has used the Piper Computer before, make sure the projects are reset. In the main menu of PiperCode, click on the Settings button and then "Lock All Projects".
  • Prepare to implement Pipercode Journals as a project-based learning grade. Review NGSS Engineering Design journal options for the appropriate grade levels. Students will need to create sketches to add to their journal.
  • Create a rubric you will use to evaluate their Piper Journals and/or teamwork (see sample Grading Rubric).
 

engage

Activities (5 minutes)

Activity: Unplugged Ruby and Robot

  1. Turn and Talk: Tell students to turn to their partner and discuss “What is Programming? If you don't know, what do you think it is?”

  2. After students discuss, have the pairs draw what they think program or code looks like.

  3. In their pairs, assign one learner to be "Ruby The Programmer” and one to be “The Robot”.

  4. Assign each pair a daily task (distribute these by writing them on notecards or just verbally providing the prompts)  

  5. Tell Ruby The Programmer to explain to their partner, The Robot, how to perform the steps needed to complete the assigned task using words only (no non-verbal motions like hand movements)!

  6. Switch pairs, so that the other partner does the explaining. Note: you can keep the same task or give them a new daily task here

  7. Have a few students share as you act out their directions without knowing the task. Discuss the importance of simple, clear instructions and sequences of instructions.

  8. Congratulate learners for creating their first algorithms with pseudo code and define these terms. (For definitions, check out the Phase 3 Vocabulary)

**Adapted from Teachers Learning Code Getting Started Guide

Activity: Introducing PiperCode

  1. Introduce the PiperCode platform: Tell students that they will be learning to code the basic functionality of controls, games, and logic for simple circuits with LEDs, buttons, switches, and breadboards.

  2. Tour of the PiperCode Interface: 3.1 SLIDES - Intro Comp Thinking

  3. Explain to students that once they finish coding, they will need to "run" their code. When they click START, they will notice:

    • PiperCode is running each line of code sequentially- they can see this as each block gets highlighted

    • When they view the pin map, they will see the pins light up if the code tells a pin to turn on.

  4. ​Introduce "Piper Journals". Tell students to draw the circuits they build and write out the code they create for each project they complete in PiperCode as well as discussion notes about the concepts. You can provide a copy of the rubric you will use to evaluate their Piper Journals and teamwork (see sample Grading Rubric).

  1.  
explore

PiperCode Project BLINK

Have students complete the Blink Project:

  1. Students complete Blink in their groups.

  2. See Project Guide for Blink Project.

  3. During this time, roam around the room, asking the essential questions* of this lesson:​

 

  • Why are the GPIO pins important to allow the Raspberry Pi to interact with the LEDs? What happens if you use the wrong pin number in the code block?
    Example Answer: The GPIO pins allow the Raspberry Pi to communicate with outputs such as the LED's by connecting the pins and LEDs with jumper wires. If the code block has the wrong pin number, the Raspberry Pi cannot communicate with the LED.

  • How do you start and stop the code?
    Example Answer: You start and stop the code by clicking “START” or “STOP” in the top left corner of the screen.

  • Why do we use a Repeat Forever block to make the light blink?
    Example Answer: We use this block because it is a loop. Without this loop, the light will only blink one time. If we want the light to keep blinking, we use repeat forever.

  • Why does running the code cause a blink?
    Example Answer: When you click start, the Raspberry Pi sends current (electrical charge) from the GPIO pin to the LED. The LED then converts the current into light.
    **Teachers: Note that you can engage prior knowledge from StoryMode lessons to discuss completing the circuit and LEDs.

  • How do you make the light blink faster, slower or longer or shorter? OR How does changing the number of milliseconds (ms) wait change the behavior of your blink?
    Example Answer: The number of milliseconds wait changes how long the light stays on before you turns off. This changes the speed of the blink. The shorter the wait, the faster the blink!
    Follow up question: How could you change your code so that you can control the wait time for the "off part: of the blinking?

​​

*These checks for understanding help reinforce learning of the computer science practices of how computer hardware and software work together as a system to accomplish tasks. (CA 3-5.CS.2 (P4.4))

EXPLAIN

Vocabulary Review (10 Minutes)

  1. Review vocabulary words and definitions that were encountered during the lesson: loop, algorithm, programming, coding, GPIO pin, LED, sequence etc.

    • Review core terms and components from Phase 1 and 2 Vocabulary terms, especially BreadBoard, Circuit, GPIO Pins, LED, Switch, and Buttons by playing pictionary or charades.

    • Put the glossary terms on slips of paper and have team pull from a hat, giving them 1 minute to draw it or mime the function and the rest of their team has to guess!

  2. Facilitate: Walk the room and check for understanding by observing breadboard and blink frequency. Ask students to explain what their code is doing and how it relates to the circuit. Provide feedback to students. If one student in a team is not answering, encourage him/her to provide the answers.​

ELABORATE

Concept Review (5-10 Minutes)

  1. Students take a picture of their control panel, circuits, and code. After completing projects, students take apart any circuits on separate breadboards and return parts to their proper bag in the storage bin. Pipers are put away to focus on discussion.

  2. Depending on age of your students and available time, choose one of the Computational Thinking frameworks and introduce the main concepts using slides after “closing” slide 3.1 SLIDES - Intro Comp Thinking

  3. Ask students to reflect which of these ideas and practices they acted out while being Ruby or the Robot.

EXTENSION:

  • Choose some sample code to review as a group - do students recognize any patterns? Are there any ways they could simplify their algorithms?

EVALUATE

Teacher Led Discussion (5% of Class Time)

Student Guided Discussion/Reflection:* (optional Google doc or form). Combine a few groups together and encourage discussion of the project and new code concepts. Appoint one student as group leader who is to provide a summary of student discussion. Provide guiding questions to start:

    • What do you know?

    • What do you think?

    • How do you know it?

    • How does it relate to a real world engineering problem?

* Circulate classroom and observe students as they apply new concepts and skills. Assesses students' knowledge and/or skills. Look for evidence that students have changed their thinking from before the activity.

Have students document the Blink project as a project in their Piper Journal to include: Pseudocode, their block code, and a sketch of the circuit created. They should note any roadblocks and how they troubleshot solutions, or how they might build it differently the next iteration. (Provide examples of what this should look like and explain pseudocode, writing out the block code, and sketching the circuit.)

 

EXTENSION:

  • Provide samples of circuit diagram components and circuit diagrams, and have students draw circuit diagrams of the projects built in this lesson in their Piper Journal.