← Teacher guide

Train movements

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.

Students will be able to

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

  1. Predict: most get walking and running. Ask: what is different about them?
  2. Walk and run: put two students' graphs side by side.
  3. Train: three samples each is the minimum; more, varied samples are better.
  4. 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 seeA question to askThe 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

  1. 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.
  2. Walk and run: Download the logger to a micro:bit, connect it, and record yourself walking on the spot, then running on the spot.
  3. 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.
  4. 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.
  5. 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

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.