Make an AI Storytelling Friend with CreateAI + micro:bit

In this project, students use a BBC micro:bit attached to a soft toy to explore how AI machine learning works by training a model to recognize different physical movements. Students begin by selecting specific movements (e.g., shaking, tilting, jumping) that will represent parts of a story they want to retell. Using the micro:bit’s built-in sensors, they collect motion data for each movement and train a machine learning (ML) model to distinguish between them.

Once trained, students test and refine their model, learning that the quality and quantity of data directly impact how accurately the system performs. They then integrate the trained model into a Microsoft MakeCode program, where each recognized movement triggers a corresponding output such as a sound or LED image on the micro:bit. This allows students to bring their story to life through interactive, movement-based inputs.

The intended purpose of this activity is to introduce foundational concepts of artificial intelligence and machine learning—including data collection, training, testing, and iteration.

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

Materials

About

  1. Introduce the Activity 
    • Have you ever wondered how AI knows what you’re doing—like how your phone counts your steps?
    • Could we teach a computer to recognize actions like jumping or sleeping?
    • Today, you’re going to train your own AI to tell a story!
  2. Introduce AI & Machine Learning
    • AI (Artificial Intelligence) – AI is a branch of computer science that studies techniques for getting computers to produce intelligent behavior.
      • Vocabulary:
        1. Definition of AI – A body of techniques that allow computers to do things that, when humans do them, are considered evidence of intelligence, including natural language processing, recognizing images, and generating content. AI systems use training data and, based on defined or learned patterns, produce outputs like predictions, recommendations, or decisions.
        2. AI technologies power the hardware and software behind ChatGPT, intelligent assistants such as Siri and Alexa, online services such as Google and Tiktok, and even autonomous robots.
        3. Machine Learning – A subfield of artificial intelligence focusing on combining learning algorithms with training data to create models that can be used to complete tasks. Three important types of machine learning are supervised learning, unsupervised learning, and reinforcement learning. Modern AI applications, such as speech recognition systems, are often constructed using machine learning techniques applied to huge training sets.
    • Machine Learning (ML) – Machine learning is when computers learn from data instead of being told exactly what to do.
      • Explain:
        1. Humans collect data
        2. The computer learns patterns
        3. The system makes predictions
    • Through training and programming your micro:bit will learn to recognize movements and respond to them.
  3. Plan Your Story
    • Every good story has actions. Let’s pick 2–3 movements.
      • Examples:
        1. Jumping
        2. Rolling
        3. Sleeping
    • Brainstorm – How will each movement connect to your story?
  4. Collect Data 
    • Now we train the AI by showing it examples.
    • Guide students:
      1. Open CreateAI project
      2. Connect micro:bit
      3. Attach micro:bit to toy
      4. Record multiple samples for each movement
    • HINT – The better your data, the smarter your AI model.
  5. Train & Test the Mode
    • Now we give the computer a change to learn. 
    • Guide students:
      1. Click Train model
      2. Test each movement
    • Reflect 
      1. Does it recognize your actions correctly?
      2. If not, we improve it—AI gets better with more data.
  6.  Improve the Model 
    • Real AI systems are never perfect the first time.
    • Guide students:
      1. Add more samples
      2. Remove bad data
      3. Retrain
    • Emphasize iteration and refinement
  7. Put the model and code on your micro:bit
    • Now we connect your AI model to code.
    • In micro:bit CreateAI, click on ‘Edit in MakeCode’ to see the project code in the MakeCode editor.
    • In MakeCode:
      1. Use ‘on ML action start’ blocks
      2. Add:
        1. Show icon
        2. Play sound
    • Your AI model now controls what happens in your story.
  8. Bring the story to life by testing your the Storytelling friend
    • Have students:
      1. Move the toy
      2. Watch outputs (sound + LEDs) 

Tips for Running Activity

This is a big conceptual leap—go slow with AI explanations

  • Focus on:
    • Humans train AI
    • Data quality matters
    • AI is not “magic”—it’s pattern recognition
  • Expect variability—models won’t all work perfectly

Assessment Opportunities

  • Exit ticket:
    • What is machine learning?
    • How did your model improve?
    • What role did data play?
    • What would you change next time?
  • Reflection questions
    • How did your AI learn?
    • What made your model better?
    • What mistakes did it make?
    • How is this different from other coding programs you have done in the past?

Extension Opportunities

Students can:

  • Add more movements (e.g., dancing, falling)
  • Customize LED animations
  • Retell a fairy tale or personal story
  • Compare AI vs non-AI projects

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

Learn More