Lesson 5: Sensory Toy with micro:bit
45 minutes
Overview
In today's skill-building lesson, the goal is to use micro:bit's accelerometer to make a toy that reacts to different movements by making different sounds and showing different pictures on the LED display output. The key concepts are events, impacts of computing and designing for accessibility.
Standards
AP - Algorithms & Programming
- 1B-AP-10 - Create programs that include sequences, events, loops, and conditionals.
IC - Impacts of Computing
- 1B-IC-19 - Brainstorm ways to improve the accessibility and usability of technology products for the diverse needs and wants of users.
Agenda
Objectives
Students will be able to:
- Identify and fix bugs in the algorithm.
- Use blocks in the Toolbox to write code on MakeCode, view the program on the Simulator and then transfer the program to the micro:bit.
- Write code with events and loops.
Preparation
-
Make sure students have completed the Meet your micro:bit exploratory lesson.
-
Make sure you know how to create a new classroom section where students will code their micro:bit project.
-
Note: Variables are not covered explicitly in CS Fundamentals Course D, but your students may have used them as a game score counter in Course C Lesson 13: Mini-Project: Chase Game.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the teachers
- CS Talking Points for Code - Resource
- Grade 4 - Maker with micro:bit slides - Slides
- Live micro:bit classroom session - Resource
- Sensory Toy: Finished project - Exemplar
For the students
Vocabulary
- Event - An action that causes something to happen.
- Gestures - Different ways of moving the micro:bit, for example shaking it, placing it display-side up flat on a table, turning it face down, and so on.
Teaching Guide
Warm Up (10 minutes)
Warm Up
Say: Today's aim is to use the micro:bit's accelerometer to make a toy that reacts to different movements by making different sounds and showing different pictures on the LED display outfit.
[Option 1] Do this: Watch the introduction video.
[Option 2] Do this: Explore the project uploaded onto micro:bits prior to the lesson.
Discuss how a project like this could help learners who respond well to stimulation through touch, light, and sound.
Discuss where these concepts are being used and where students may have used them before:
- Events: an action that causes something to happen
- Impacts of computing: understanding the good and bad effects computing can have on different groups of people
- Designing for accessibility: making design decisions that are driven by the needs of different groups of people
Do this: Share the project working in the simulator with your students and look at the code together prior to students coding the main activity.
Note that the code for this project uses the "play 'giggle', etc." block that works in the simulator and on the BBC micro:bit V2 with the built-in speaker. If you have the micro:bit V1, you can code this project without sound, or use the "play melody" block instead and connect headphones or an amplified speaker to pins 0 and GND.
Main Activity (30 minutes)
Student Coding (20 minutes)
Students will make the project themselves using the MakeCode editor and micro:bit simulator. Once they have tested their code in the simulator, they will download their code onto the micro:bits.
Pick one:
- Step by step coding video
- Live micro:bit classroom session
Assessment (10 minutes)
After completing the lesson, assess students' knowledge of the concepts covered by going through the assessment slides in the slide deck. You can also assign students a content assessment hosted on the JuiceMind platform. To assign the assessment to your students, click here.
Setting up a JuiceMind assessment
Click "Assign" on the assessment page, then have students join your unique class session. Students have a link to the Join page on level 1, and will need to enter the class session code. After students complete the assessment, you can view their results on the JuiceMind teacher dashboard.
Note: You will need to sign up for an account on JuiceMind to assign the assessment.
Wrap Up (5 minutes)
Discussion
Share student work, revisit key concepts used, and explore ideas for extended learning.
[Optional] Extension Activity
Sensory Communication Device
After students have created a sensory toy, this concept can be expanded to further teach students about the importance of accessibility and how technology can help support people in different ways. For individuals with physical limitations that make speaking or writing difficult, sensory apps can provide alternative communication channels. This fosters independence and allows them to participate more actively in daily life.
These devices are called Augmentative and Alternative communication devices and are frequently used by non-verbal students in schools. Here is a video of students using an AAC device in the classroom.
Find the code for this project here.
Find the student handout for this project here.
Find a list of frequently used core words for this project here.
[Optional] Extended Learning
Make animations: Use loops to create animations when the micro:bit is moved in different ways.
Touch sensing: Add more inputs such as touching the logo on the micro:bit V2, touching the pins, or making touchable buttons out of tin foil and attaching those to the pins.
Learn more about touch pins here.
Find this project and more on microbit.org
This work is available under a Creative Commons License (CC BY-NC-SA 4.0).
If you are interested in licensing Code.org materials for commercial purposes contact us.