Students see movements as data (x, y and z over time), train an activity model in micro:bit CreateAI, and improve it until it works for someone who didn't train it.
micro:bit and the computer · AI on the micro:bit · about 50 minutes · Open the student lesson
Classroom resources
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
SlidesDownload Present from the browser, or export to PowerPoint or PDF.
WorksheetDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can describe a movement as data: x, y and z acceleration over time.
I can train and test a movement model in CreateAI.
I can improve a model by adding samples from other people and ways of moving.
Timing
Predict and Run 8 min · Walk and run 5 min (typical) · Train 15 min · Investigate 7 min · Improve 10 min · Make 5 min
Before class
The idea: a movement is a short recording of the accelerometer's x, y and z readings. CreateAI's model learns the patterns in the samples it is given (a sample is about a second), so the lessons from the recycling sorter carry over: the model knows only its examples, and variety (other people, other ways of holding it) is the fix. The new part is where the model runs: on the micro:bit itself, with no camera, computer or connection.
CreateAI (createai.microbit.org) is free and needs no account. In Chrome or Edge it connects by Bluetooth with one micro:bit, or by radio through a second micro:bit on a USB data cable if the computer has no Web Bluetooth. iPads and Android tablets use the CreateAI app. Any micro:bit can collect data and train; running the model on the micro:bit (next lesson) needs a V2. School device policies can block Web Bluetooth or WebUSB: test one device before class.
Without micro:bits: the logger runs in the simulator (tilt it and use Show data), but training needs real micro:bits; run the CreateAI steps as a demonstration.
Running the lesson
Predict: most get walking and running. Ask: what is different about them?
Walk and run: put two students' graphs side by side.
Train: three samples each is the minimum; more, varied samples are better.
Improve: the partner test is the recycling sorter's messy bench again.
The hard part (on purpose)
Collecting enough varied samples per action. When everything is recognised as one action, ask how many samples each has and how different they are.
When students get stuck
What you will see
A question to ask
The fix
CreateAI can't find the micro:bit.
Is it Chrome or Edge? Is the battery pack on? Does the computer have Bluetooth?
Follow CreateAI's connection steps; use the radio route with a second micro:bit if Bluetooth is blocked.
Everything is recognised as one action.
How many samples does each action have, and how different are they?
Add samples so each action has a similar number, with clear movements.
Standing still is called walking.
What did your still samples look like?
Record still with small fidgets and shifts.
Answers to the checks
Predict: You train four actions: still, walking, running and jumping, with the micro:bit on your wrist. Which two will the model mix up most? Walking and running. Both are a steady swing of the arm, again and again; running is faster and bigger. The model has to learn that difference from your samples, while still and jumping look nothing alike.
Walk and run: Download the logger to a micro:bit, connect it, and record yourself walking on the spot, then running on the spot.
A sample: What does CreateAI record in one sample? About a second of x, y and z acceleration readings A movement happens over time, so a sample is a short recording of all three directions, like the waves on the board.
A friend's run: Your model knows your running. A friend runs with the micro:bit held differently, and it says walking. What is the fix? Add running samples from other people and other ways of holding it Same idea as the recycling sorter: the model only knows the examples it was given. Add the variety it is missing.
Where it runs: The Teachable Machine sorter ran on the computer. This model runs on the micro:bit. Which is true? Once downloaded, it works on battery power with no computer, camera or connection The model is copied into the micro:bit's program. A V2 runs it by itself, like the model in a smartwatch.
Stretch and support
Stretch: Add a fifth action (such as star jumps) and find which existing action it gets confused with.
Support: Train in pairs: one moves, one records.
Exit ticket
Why does the model mix up walking and running more than still and jumping?
Walking and running make similar patterns (a repeated swing) that differ only in speed and size; still and jumping look completely different.
What each step is for
Walk and run: On a real micro:bit, walking and running make the same shape of wave at different speeds and sizes: that is what the model has to tell apart.
Investigate: A sample is a second of x, y and z readings; the model learns the patterns in the samples it is given, so variety in who and how matters as much as it did for photos, and where the model runs changes what it needs.
Improve the model: Testing on someone who didn't train it, and adding what they do differently, makes the model work for more people.
Where it leads
Next: code with the model, using the Machine Learning blocks. Real world: fitness trackers, fall detection for older people, gesture controls in game controllers.