MISSION OBJECTIVE
Learn about Machine Learning (AI), a subset of AI focusing on machines and very specific tasks.
Now that Piperbot and Pip have PAL up and running, they are ready to explore. Surprisingly, they've discovered that the ship's controls are damaged and can't be used on the flight deck. PAL, however, has a new idea and suggests that using a camera as a sensor, he could steer the ship based on the movements of Piperbot's head so that they could get going using the principles of Machine Learning.
View student interface at make.playpiper.comMISSION CHARACTERS
MISSION MATERIALS
Computer with USB port and Chrome or Edge browser
Piper Make Base Station or Starter Kit
MISSION RESOURCES
Learning Goals
- Students will understand the basic principles of ML.
- Students will gain a basic understanding of how ML works.
- Students will understand using the camera as a sensor.
- Students will build hardware that interacts with an existing ML model to track facial expressions.
- Understand how machine learning algorithms train on data sets to recognize patterns
- Use an ML algorithm to detect my pose from video input
Learning Activities
The following sections will contain step by step instructions for ELA and ELD extensions directly related to this Mission. Adjust the directions to fit your ELA and ELD standards.
Grades 3-5
ELA Extension: Recognizing Piperbot Display the three character images below (Piperbot, Pip, and a creeper from Minecraft).
Ask students to share how they recognize the difference between the characters. They may say, “I’ve seen them before” or “It looks like a mouse.”
Discuss how artificial intelligence would recognize the difference between the characters - it would learn from seeing multiple images of the same character, and look for patterns. Ask students what are the patterns that tell us whether it is a robot, mouse, or creeper? Students should be able to describe particulars including colors, and the specific grid position of features like eyes, nose, mouth. How is pattern recognition the same and different from how humans perceive?
Now, have students consider how these images are very simple (64 pixels) compared to say, a self-driving car recognizing a pedestrian or a cyclist. When asking a computer to perceive photos or even video, the model will need an immense amount of examples to learn from.
ELD Extension: Pose Estimation Person Keep the code and build for the Pose Detect mission open. Have students click on the Camera Icon to view the pose estimation overlaid onto the webcam. Students should back up and stand in front of the camera and watch which body parts map to each dot. Students can also reference the drop down menu from the “camera (nose) pose (X position)” block to see which body parts pose detection works with.
Students should use these resources to draw and label a person with pose detection dots mapped onto each body part, including the list below. Students can draw the person in any pose. (This page has an example image for multiple poses: https://www.tensorflow.org/lite/examples/pose_estimation/overview)
|
|
Grades 6-8
ELA Extension: COCO Animals COCO, or Common Objects in Context, is a large-scale object detection, segmentation, and captioning dataset. Students can browse the Coco image dataset at https://cocodataset.org/#explore
Choose 1 animal and click “Search” to view images tagged with that animal.
Students should answer the following questions about their animal search.
- How many images did your search produce? (This will display right under the search bar.)
- How many different poses or angles did you see of your animal? Describe at least 3 of the different poses (ie, a horse as a logo on a sign and a horse pulling a cart.)
- If you were going to teach what a zebra is, do you think it would be easier to teach a human or to teach an artificial intelligence? Why?
- This dataset has a total of 2.5 million labeled instances in 328,000 images. Why do you think a machine learning model needs so many images to be trained effectively?
ELD Adaptation: COCO Animals
COCO, or Common Objects in Context, is a large-scale object detection, segmentation, and captioning dataset. Students can browse the Coco image dataset at https://cocodataset.org/#explore
Choose 1 animal and click “Search” to view images tagged with that animal.
Students should answer the following questions about their animal search.
- How many images did your search produce?
- What are the features of your animal:
- How many legs?
- What colors?
- How do you recognize this animal?
- What tells the computer which part of the images is an animal? (The outlines, or bounding boxes)
Career Connections
Software Developer: Salary $127,260/yr
Electrical Engineer: Salary $127,260/yr
Data Scientist: Salary $103,500/yr
Hardware Diagram
Code Diagram
Tutorial Steps
Pose DetectHow will we fly the ship with only one button?
One thing that PAL has been trained to do is recognize a person in a video feed like the one from your computer's camera and find the position of your eyes, nose, ears, wrists, elbows, etc.
Cool, right?
During one training, PAL was shown pictures with each joint and body part labeled so PAL could learn to find them in any new picture or video feed.
When the training is done, all of the AI's memories are downloaded and saved to a file. That file is called a model, and it can be used by many other computer AIs!
Using blocks from the Chip and Sensing menus, build the blocks below:
You should see a red camera Icon in the top-right corner of your screen:
What do you see? Try moving around!
Not working? Try refreshing your browser and coming back to this tutorial.
Remember that you need to use a Resistor when you connect an LED and that the long lead (anode) should be connected to the GPIO pin - in this case, GP15:
We already have some blocks, so grab a few more blocks from the Loops, Chip, and Sensing menus to build the code you see below:
Click CONNECT, select your Pico, and then click START.
Next, click on the CONSOLE tab.
Click the Variables menu, then click the Create variable button. Name your new variable "position list."
Once you create the variable, grab the set position list block and place it into your code:
We are going to make one addition to our code to see how well it works.
We have our list, and when we move our nose, we want to find the closest number from our list to where our nose is.
In the Lists menu, find the in list find closest block. Drag it into the print block that's already in your code. Then add the position list block from the Variables menu:
Open the Variables menu and click the Create variable button to make a new variable. Name it "steering". Then, use the set steering to block to capture the in list block's value:
Click on the blue gear icon. Select the else if block and attach it under the if block on the right half of the bubble. Do this a second time. Now click the blue gear once more to hide the menu again.
Grab the "steering" variable and place it to the right of the equals sign in the _ = _ blocks. Don't forget the Duplicate trick!
Next, place the zero block in the Values menu to the right of the equals sign. Change the zeros to 1, 2, and 3 in that order.
Remember that the Port is on the ship's Left side, and the Red LED represents it. The Red LED is connected to GP15:
Make another copy named "turn to starboard" and set GP13 to ON. Then make a final copy named "stop" that turns all the LEDs off:
Then, add the rest of the functions for the 2 and 3 values.
Finally, add the stop block into the final else position:
Once you can successfully fly the ship, click STOP and DISCONNECT. Then, click NEXT.
Blueprint
OPEN IN BLUEPRINT VIEWER DOWNLOAD
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
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
Circuit A conductive path for the flow of current or electricity.
Power The current or flow of electric charge and voltage.
Microcontroller An integrated circuit containing a microprocessor with memory and associated circuits.
Variables A value that can change depending on conditions or information passed to the program. A storage location with a symbolic name used to keep track of a value that can change while a program is running (similar concept to using X and Y in an algebraic equation). Variables are not only numbers; they can also hold text, including whole sentences (strings) or logical values (true or false).
Input Device A hardware device that sends data to a computer, allowing interaction and control.
Output Device A piece of hardware that converts information into a form humans can sense and understand.
Standards Alignment

