This project is built upon classical work by Zajonc (1965), who proposed the idea of social facilitation in sport, where performance in sporting tasks that are familiar to you is improved when you take part alongside others. The actions detected by the ML model will give some rudimentary insight into a player’s level of performance and how that changes through the course of a game of tag.
Make a game of tag that draws upon the psychology of exercise and social facilitation using Micro:bit CreateAI
This project makes use of the following variables:
The Waiting variable is used when the player is a tagger and is waiting for confirmation from another player that they have been tagged:
The project makes use of the Micro:bit’s radio to allow for cross-communication between Micro:bits (for tagging and sending praise).
All Micro:bits will be assigned to one radio group to ensure they can all communicate with another.
Additionally, all Micro:bits will have a transmit power of 0 and will detect signal strengths of 1 or lower. This is to ensure Micro:bits can only communicate when they are in close proximity (until about 2 meters apart).
The project also utilises the datalogger extension. Throughout the game each player Micro:bit stores information on the states the player moves through in relation to other variables. Each instance of saved data includes:
Through analysis of the data you will be able to make rudementary judgements on players’ performance and level of motivation, with praise and win values contextualising players’ movements.
This project involves training a machine learning (ML) model to recognise when a person is doing a variety of actions (standing still, walking, slowly running, and running).
In order to do this, the model will need to be trained through allowing the Micro:bit to track x, y, and z spatial values while you perform the 4 actions.
Open the micro:bit CreateAI website and create 4 rows of data called ‘Standing still’, ‘Walking’, ‘Slowly running’, and ‘Running’.
You can add your own movement samples using the micro:bit’s movement sensor or accelerometer.
In micro:bit CreateAI, click the ‘Connect’ button to connect your data collection micro:bit and follow the instructions.
If using a strap and holder, attach the data collection micro:bit to your left wrist like a watch, with the logo at the top. If not, hold the micro:bit in your left hand with the logo at the top and your thumb on button B. Click on the first action, ‘Standing still’, and click ‘Record’ to record your own data samples. If you make a mistake, you can delete any samples you don’t want. You can also press button B on the micro:bit to start recording.
If you would like to record continuously for 10 seconds to get 10 samples, click on the three dots next to the record button and select that option.
Record as many samples as you would like, but 15 samples per actions will suffice.
Now record your own data samples for the other 3 actions.
Tip: Consider the many ways in which a person may complete these actions, e.g. for ‘Standing still’ consider that people may stand still with their arms to their sides or folded.
Click the ‘Train model’ button to train the model, then test it. Keep still and see if ‘Staying still’ is estimated correctly. Try the other 3 actions and see if they are estimated correctly as well. Give your micro:bit to someone else to wear (making sure they put it on the same wrist and in the same orientation) and see if it works for them as well.
Most models can be improved with more data. If the model needs improving, click on ‘<- Edit data samples’.
You can delete any data samples which you think don’t fit or add more samples from yourself and other people
Continue to train the model and test it again
Integrating the model and coding on your micro:bit
In micro:bit CreateAI click on ‘Edit in MakeCode’ to see the project code in the MakeCode editor
The starter micro:bit has the role of starting a game of tag as it will assign a tagger and will signal to other micro:bits when a game has started.
The player micro:bits are to be given to each person playing the game of tag and will be responsible for detecting movements from each player, tagging other players, praising other players, and tracking wins and praise in reference to the players’ movements.
You will need to download this code onto all other micro:bits you intend to use for this project.
You are going to play a game of tag using Micro:bits
As a tagger – Try to tag another player as quickly as possible
As a non-tagger – Try to evade being tagged as long as possible
Assigning the tagger (Button A)
Starting the game (Button B)
Tagging another player (Button A)
Praising another player (Button B)
Delete datalogs (Button A+B)