A movement is a short recording of x, y and z acceleration. micro:bit CreateAI learns the shape of those recordings from your samples, so it tells movements apart by how they move, and the model then runs on the micro:bit itself.
A smartwatch counts your steps and knows when you start running, without a camera and without sending anything to a computer. A small model on the watch reads its motion sensor.
In Teachable Machine the model learned from photos and ran on the computer. In micro:bit CreateAI it learns from movements, measured by the micro:bit's motion sensor (the accelerometer), and the finished model runs on the micro:bit.
You need: a micro:bit (a V2 to run the model on the micro:bit later), a battery pack, and Chrome or Edge. CreateAI connects by Bluetooth, or by radio through a second micro:bit plugged into the computer; it shows you which.
Predict: Read the code and say what it will do before you run anything. A wrong guess is fine: it shows you what to look for.
Run: Run it and compare the result with your prediction.
Investigate: Trace how each line of code connects to what you see.
Modify: Change the code on purpose and check the result.
Make: Build something new using what you have learned. Expect a few tries; that is normal.
WidthMore contexts, same idea.
Make your prediction first. Help opens once you've locked it in.
PredictRead the code and say what it will do before you run anything. A wrong guess is fine: it shows you what to look for.
Predict
RunRun it and compare the result with your prediction.
What a movement looks like
This logger sends x, y and z acceleration 20 times a second. Run it, open Show data, and tilt the simulated micro:bit with the mouse. Each movement is a pattern in three lines.
Try it yourselfYour edits are saved in this browser.
It takes a few seconds to load. Your work in this step is kept.
Run TypicalRun it and compare the result with your prediction.
Walk and run
Hold the micro:bit (still plugged in) at your side. Walk on the spot for five seconds, then run on the spot. Compare the waves.
Try it yourselfYour edits are saved in this browser.
Download the logger to a micro:bit, connect it, and record yourself walking on the spot, then running on the spot.
Use the board. This ticks when you get there.
RunRun it and compare the result with your prediction.
Train in CreateAI
Open micro:bit CreateAI and start a new session. Follow its steps to connect your micro:bit; put it in the battery pack on your wrist or in your hand.
Make four actions: still, walking, running and jumping. Record at least three samples of each (a sample is one second of movement).
Click Train model, then test it: the testing page shows the action it estimates and how sure it is.
InvestigateTrace how each line of code connects to what you see.
Investigate
ModifyChange the code on purpose and check the result.
Improve the model
Swap micro:bits with a partner. Test each other's models: do each action three times. Add samples of the actions it got wrong (yours and theirs), retrain, and test again.
Real "still" includes fidgeting and shifting your weight. Record still samples that include those.
MakeBuild something new using what you have learned. Expect a few tries; that is normal.
Make
Finish an activity model that recognises still, walking, running and jumping for someone who didn't train it: three times in a row for each action. Keep the CreateAI session open (or save it): next lesson you code with it.
For teachers
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. About 50 minutes.
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.
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
CreateAI can't find the micro:bit. Ask: Is it Chrome or Edge? Is the battery pack on? Does the computer have Bluetooth? Fix: Follow CreateAI's connection steps; use the radio route with a second micro:bit if Bluetooth is blocked.
Everything is recognised as one action. Ask: How many samples does each action have, and how different are they? Fix: Add samples so each action has a similar number, with clear movements.
Standing still is called walking. Ask: What did your still samples look like? Fix: Record still with small fidgets and shifts.
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.
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.
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.
Now you can
Describe a movement as data: x, y and z acceleration over time.
Train and test a movement model in CreateAI.
Improve a model by adding samples from other people and ways of moving.