micro:bit CreateAI is a free, web-based tool that makes it easy for students to explore AI
through movement and machine learning, and take it into the real world with the BBC micro:bit.
Add AI to your micro:bit learning experience, by training a machine
learning model with your own movement data and use it in your micro:bit projects.
You’ll need a computer with the Google Chrome or Microsoft Edge web browsers
to access micro:bit CreateAI. Click on ‘Get started’ to begin.
First you need to collect some training data. You do this in the ‘data samples’ page.
Click ‘Connect’ to connect a micro:bit to CreateAI on your computer.
This is the micro:bit you will move, either holding it in your
hand or attaching it to something that moves. We call this the data collection micro:bit.
If your computer has Bluetooth enabled, you just need 1 micro:bit.
If it doesn’t have Bluetooth, you can use a second micro:bit to act as a radio link.
micro:bit CreateAI will show you the best way to connect the data collection micro:bit to your computer.
Just follow the instructions on screen.
As you move the data collection micro:bit, you’ll see live movement data from its
accelerometer sensor in a graph at the bottom of your computer screen.
Choose at least two different movements you want CreateAI to learn to recognise. We call these movements ‘actions’.
Waving and clapping are good actions to start with.
Name your first action.
Click the ‘Record’ button to collect your first sample of data. Each sample lasts 1 second.
You can record one sample at a time or multiple samples.
Collect at least three samples of your first action.
And do the same for at least one other action.
Can you see similarities between the graphs of the waving data? And differences between waving and clapping?
Next, click on ‘train model’.
micro:bit CreateAI analyses your samples of data and creates a set of rules so it can estimate what actions you’re making.
These mathematical rules make up the machine learning, or ML, model.
Now you can test the ML model in the ‘Testing model’ page.
This shows which action the model estimates that you’re making.
The higher the percentage number, the more confident the model is
that you’re making a particular action.
Wearing or holding the data collection micro:bit, do each of your actions in turn.
If the model is not accurately estimating which actions you are doing, you may need to review your data and retrain the model.
Click on ‘Edit data samples’ to collect more data samples, or delete any samples that you think may not fit.
You can also add more actions, for example to teach the model what data for ‘being still’ looks like.
Then you can retrain and test your ML model again.
Once you’re happy that you’ve made an ML model that is good at recognising your chosen actions,
you can use your model in a MakeCode program and put it on a micro:bit.
You’ll already have seen some blocks in the Testing model page. These are the machine learning, or ML, blocks
you can use in your MakeCode programs. These blocks make different icons appear
on the micro:bit display when each action is recognised by the ML model.
Click on ‘Edit in MakeCode’ to open the blocks in a special MakeCode editor.
Click on ‘Download’ to transfer your code and your ML model to a micro:bit.
Follow the instructions on screen.
Unplug the micro:bit from your computer, attach a battery pack and test it out. You can take the micro:bit anywhere.
Your ML model is now running on the micro:bit itself, you no longer need a computer to make it work.
There are more ML blocks you can use to create your own projects using AI with MakeCode, and you can combine
these with all of the other blocks too.
You can also save your project - your data and code blocks - together in one file so you can continue working on it later.
You can do this in CreateAI by clicking ‘Save’ and giving your project a name.
Or you can save your project from MakeCode.
Just click on the 3 dots and choose ‘download as file’.
What will you create with machine learning and MakeCode using micro:bit CreateAI?