Skip to content
Back to BBC Teach

micro:bit how to guide

Exploring machine learning

7-11 yrs | MakeCode | Data handling, Data types

Step 1: Introduce it

First, watch the video

If you have not completed Tracking our physical activity as part of the playground survey, you can watch the BBC video to learn how the program on the micro:bit was trained using machine learning.

Or go straight to BBC Teach to watch the machine learning video and download the complete set of playground survey teacher instructions.

Two bots in primary school uniform, one is helping the other to secure a micro:bit on a strap to the wrist.

How it works

  • In Tracking our physical activity, the micro:bit used its accelerometer with a machine learning model to estimate movements children did in the playground.
  • We used lots of movement data samples from children to train this model.
  • In this session, your class will work together to collect movement data samples to train your own machine learning model.
Primary school pupil, a girl, moving as if walking on the spot while wearing a micro:bit on her wrist.

What you need

  • a computer with the micro:bit machine learning tool website ready to use, ideally on a large screen
  • 1 USB data lead
  • 2 micro:bits
  • 1 battery pack, 1 flexible micro:bit holder and 1 wearable strap (holders and straps are included in your BBC micro:bit - the next gen free pack)

Watch the video below to see how to attach the wearable strap to the micro:bit using the flexible micro:bit holder:

Step 2: Use the machine learning tool

Watch the 'how to' video on the tool page, then select ‘Start new session’ at the bottom of the page and follow the on-screen instructions to connect your micro:bits and train your model to recognise when a pupil is clapping or waving.

See BBC Teach guide for instructions on running the class session.

Open the micro:bit machine learning tool

Step 3: Improve your model

Boy wearing primary school uniform, wearing a micro:bit on his wrist, holding both arms slightly apart from his sides.

Is your model not sure of a movement?

Try adding more data to help. Make sure your data samples are as 'clean' as possible. Start doing the movement before pressing record and carry on moving until after the recording stops.

Is your model confusing 2 movements?

If the movements are similar, it may have trouble detecting them. Try changing one of the movements to something that looks very different. Delete one set of movements and record new samples for the new movement.

Is your model missing some data?

Your model will only be able to estimate movements it has 'learned' from the data you give it. Try adding 'still' data to help it know when you are not doing these movements.

Make sure you re-train your model each time to add or change data samples.

Where next? Visit BBC Teach more for ideas.
BBC Teach