AI Sports Data Logger with micro:bit + CreateAI

In this advanced physical computing and artificial intelligence activity, students build an “AI Sports Data Logger” using the micro:bit CreateAI platform and Microsoft MakeCode In this activity students train a machine learning model using CreateAI to recognize different body movements such as running, walking, and remaining still by collecting accelerometer data directly from the BBC micro:bit. After gathering movement samples, students train and test their AI model, improve its accuracy with additional data, and deploy the trained model back onto the micro:bit.

Grade Levels: 4 - 12
Subject Matter: Algorithms, Artificial Intelligence (AI), Physical Computing, Programming, Cross-Curricular Integration: Math, Cross-Curricular Integration: Science
Concepts: Programs and Algorithms, Computing Devices and Systems, Data and Information
Standards: 3-5.PA.2, 3-5.CD.1, 6-8.CD.1, 6-8.CD.2, 6-8.CD.3, K-2.PA.1, K-2.PA.2, K-2.PA.3, K-2.PA.4, 3-5.CD.2, 3-5.PA.3, 6-8.PA.1, 6-8.PA.2, 6-8.PA.3, 3-5.DI.1, 6-8.DI.1, 6-8.DI.2, K-2.CD.1, K-2.DI.2, K-2.DI.1, K-2.CD.2
  • Average Rating: 0.0 (0 ratings)

Materials

About

  1. Introduce the Activity
    • Discussion Questions
      • How do fitness trackers know when you are walking or running?
      • What kinds of data can wearable devices collect?
      • Can AI recognize human movement patterns?
      • What role do humans play in training AI systems?
    • Optionally, introduce:
      • Accelerometers
      • Data Logging
  2. Introduce AI & Machine Learning
    • Machine learning means teaching a computer using examples instead of step-by-step instructions.
    • Explain simply:
      1. You give examples (dataset)
      2. The computer finds patterns in the data
      3. It predicts what new inputs are
    • We’re going to teach it to recognize movements
  3. Collect Training Data
    • Guide students in CreateAI:
    • Create movement classes:
      • Walking
      • Running
      • Still (at rest)
    • Connect your micro:bit to CreateAI
    • Record multiple samples for each class
    • The more good examples you give, the better your AI will work.
  4. Train & Test the Model
    • Train model once you have recorded enough data, and see what your AI learned.
    • Students:
      • Click Train model
      • Test movements
    • Discuss:
      • Does it recognize correctly?
      • Where does it make mistakes?
  5. Improve the Model (Iteration)
    • AI gets better with better data. Are there any classes that need more data to help improve the accuracy of detecting the movements correctly?
    • Students:
      • Add more sample data to the classes
      • Remove incorrect ones
      • Retrain and test
  6.  Connect AI to micro:bit Code & Log Data
    • Export the model to MakeCode.
    • Download the program onto the micro:bit.
    • Start and stop activity logging.
    • Wear the device during movement activities.
  7. Analyze the Data
    • Open the MY_DATA file from the micro:bit.
    • View graphs and tables of movement data.

Tips for Running Activity

  • Encourage consistent placement of the micro:bit when collecting data (holding, pocket, secured to body).
  • Collect varied “still” positions to improve accuracy.
  • Have students compare data between different people.

Elements of this resource were created by BBC micro:bit and Create AI, then curated by the team at Nextech.

Learn More