Skip to main content
BirdBrain Technologies
  • Products
    • Want to learn more about our products?
      • Compare Products
      • Product Catalog
      • Try one for 30 days!
      • Request a Quote
      • Help Desk
      • Privacy Policies
    • Hummingbird Bit Robotics Kit
      Grades 4-12
      • Features
      • Buy Now
    • Finch Robot 2.0
      Grades K-College
      • Features
      • Buy Now
    • Owlet Math Tools
      Grades K-5
      • Features
      • Buy Now
    • Electric Motors Catalyst Kit
      Grades K-5
      • Features
      • Buy Now
  • Teach
    • We support teachers so they can inspire students.
      • Classroom Adaptations
      • Educator Community
      • Professional Development
      • Standards
      • Try one for 30 days!
    • Hummingbird Bit Robotics Kit
      • Start Teaching
      • Programming
      • Building
      • Projects
      • Printables
      • Have an older model?
    • Finch Robot 2.0
      • Start Teaching
      • Programming
      • Finch at Home
      • Activities
      • Printables
      • Loan Program
      • Have an older model?
    • Owlet Math Tools
      • Start Teaching
      • Teacher Guides
      • Printables
      • Owlet Apps
  • About Us
    • Mission & History
    • Our Team
    • Research
    • Media Kit
    • Contact Us
  • Resources
    • Blog
    • Teacher Stories
    • Webinars
    • Conference Presentation Support
    • Grant Assistance
    • Reading List
  • Shop
  • Support
BirdBrain Technologies
  • Products
    • Want to learn more about our products?
      • Compare Products
      • Product Catalog
      • Try one for 30 days!
      • Request a Quote
      • Help Desk
      • Privacy Policies
    • Hummingbird Bit Robotics Kit
      Grades 4-12
      • Features
      • Buy Now
    • Finch Robot 2.0
      Grades K-College
      • Features
      • Buy Now
    • Owlet Math Tools
      Grades K-5
      • Features
      • Buy Now
    • Electric Motors Catalyst Kit
      Grades K-5
      • Features
      • Buy Now
  • Teach
    • We support teachers so they can inspire students.
      • Classroom Adaptations
      • Educator Community
      • Professional Development
      • Standards
      • Try one for 30 days!
    • Hummingbird Bit Robotics Kit
      • Start Teaching
      • Programming
      • Building
      • Projects
      • Printables
      • Have an older model?
    • Finch Robot 2.0
      • Start Teaching
      • Programming
      • Finch at Home
      • Activities
      • Printables
      • Loan Program
      • Have an older model?
    • Owlet Math Tools
      • Start Teaching
      • Teacher Guides
      • Printables
      • Owlet Apps
  • About Us
    • Mission & History
    • Our Team
    • Research
    • Media Kit
    • Contact Us
  • Resources
    • Blog
    • Teacher Stories
    • Webinars
    • Conference Presentation Support
    • Grant Assistance
    • Reading List
  • Shop
  • Support
Finch Robot 2.0

l AI

Control the Finch with a Magic Wand

Intro to Machine Learning and micro:bit’s CreateAI

The information in this section is provided by Micro:bit’s Create AI User Guide.  For more information, visit micro:bit CreateAI | micro:bit 

What is machine learning? 

Machine learning (ML) is a type of AI where computers can learn from and make decisions based on data. It’s widely used to power many kinds of technology, including smart fitness trackers and tagging photos with the names of your friends. 

ML also works well in education because it can be simplified to work with small sets of data. This makes it ideal for classroom use with the micro:bit, allowing students to experience how ML works for themselves using personal movement data they gather from the micro:bit’s accelerometer sensor. 

What is Micro:bit CreateAI? 

Micro:bit CreateAI is a free, web-based tool that makes it easy for students to explore AI through movement and machine learning (ML). Micro:bit CreateAI allows you to explore the vital role data plays in AI systems, and develop AI literacy. It also helps to consolidate computer science learning and skills of data literacy used in mathematics and science. 

You can use micro:bit CreateAI to train an ML model and then run it on your BBC micro:bit V2. 

  • Collect movement data from the micro:bit accelerometer 
  • Train an ML model to recognize patterns in the data 
  • Code the micro:bit to run ML models and take your creation anywhere 

In this activity, you will create a gesture recognition model to recognize motion patterns on a micro:bit attached to a “magic wand”. We will then create a program that makes the Finch Robot react to the different motions using radio communication between the two micro:bits. 

Credit: micro:bit Foundation 

 

Ready To Get Started?

What You Will Need

This activity utilizes the MakeCode programming language.  If you are not familiar with MakeCode, we recommend you complete our Finch with MakeCode tutorials prior to starting this activity.

Materials Needed:

  • A Finch Robot 2.0 with V2 micro:bit
  • A computer (desktop, laptop or Chromebook) with Chrome or Edge browser with bluetooth enabled
  • A second V2 micro:bit with battery pack
  • USB data cable
  • Two AAA batteries (for micro:bit battery pack)
  • A magic wand (see example below)

Your magic wand can be designed any way you want! Get creative and make something magical! Be sure your micro:bit and battery pack are securely attached to your wand in some way.  Here is an example build.

Next Step

Setting Up the micro:bit and Collecting Data

1. Visit https://createai.microbit.org/new

2. Select Start New Session

3. Connect your V2 micro:bit attached to your wand to your computer using the USB cable. Select the blue Connect button at the bottom of your screen and then follow the on-screen instructions to turn your model into a datalogger micro:bit.

Instructions provided by the micro:bit Foundation. For further reference, CreateAI User Guide

If you have not done so, disconnect the USB cable and connect the battery pack to the micro:bit.

5. Your micro:bit should match the pattern shown on the screen. If it does not, select the cells to match the icon you see on your micro:bit’s 5×5 LED Display. Follow the on-screen instructions to connect via bluetooth.

Instructions provided by the micro:bit Foundation. For further reference, CreateAI User Guide

6. You should now see a live data graph of accelerometer data. The micro:bit’s accelerometer measures changes in movement in three dimensions: x, y, and z.

Watch the graph and try moving your wand around to see how the data is affected!

Image Credit: micro:bit Foundation 

7. You will now begin recording data samples. Determine how you would like to hold your wand for all of your actions BEFORE you begin recording. For best results, choose a comfortable hand position to start and stop the actions. We recommend holding the wand straight out in front of you (like you’re pointing straight ahead)

The THREE gestures we will use for this model are “up and down, “side to side”, and “circle.”

Note: If using gestures other than the three provided, you will want to choose wand actions that are distinct and easily recognizable. If your gestures look too similar, it could result in false positives or negatives.

8. Name your first action “Up and Down.”

Optional: If you click the dropdown arrow next to the micro:bit LED screen icons, you can change the LED icon. We choose the smiley face!

9. Start moving your wand in an up and down motion. What do you notice about the live data graph at the bottom of the screen while you are moving your wand?

While you are continuously moving your wand up and down, select the red “Record” button to record your data sample.

Do this at least 5 times, so you have at least 5 data samples.

10. Check your data quality! The data graphs should have a very similar structure. If you see any images that could be bad (a data outlier), delete it. You can record more samples if you need to.

11. Click the blue Add Action button on the bottom left of the screen. Name your second action “Side to Side.” Repeat steps 9 and 10 using a side to side motion this time.

Note: For best results, be sure to keep your wand flat!

12. Click the blue Add Action button again. Name your third action “Circle.” Repeat steps 9 and 10 using a circle motion this time.

Note: For best results, change the position you are holding your wand. Instead of holding it straight in front of you, lift your wand up next to your face and spin it like you’re doing a lasso spin with a rope!

13. Click the blue Add Action button one last time. Name your fourth action “At Rest.” Repeat steps 9 and 10 while keeping your wand still. We recommend the “at rest” position be your wand laying flat on the table.

14. Once you have collected enough data and checked that you have no data outliers, you are ready to train your model!

Next Step

Training and Testing Your Model

1. Select Train Model at the bottom right corner of the screen.

2. Test out your model by moving your magic wand up and down, side to side, in a circle, and holding it at rest to see if the model recognizes your gestures!

3. Recognition Point: You can adjust the recognition point to remove false positives. We recommend setting the recognition point to 90% or above for all gestures except “at rest”.

This means your model will not identify any of the three wand gestures unless it is 90% certain or higher that it is recognizing that motion.

4. If you are not happy with your model, select Edit data samples in the top left corner of the screen.

Return to the training and collect more data samples or delete data outliers that may be affecting your model. Once you are happy with your data samples, repeat steps 1-3 in this section.

5. Once you have trained and tested your model and it is working as expected, click on Edit in MakeCode in the bottom right corner of the screen to use the model inside a MakeCode program.

Next Step

Using Your Machine Learning Model in MakeCode

1. Start by downloading the default program that opens in MakeCode on to your micro:bit. Plug your USB cable into the micro:bit on your magic wand and select Download.

MakeCode will ask you if you want to use the same or a different micro:bit. Select Same micro:bit.

Follow the on-screen instructions.

2. Now when you do your wand gestures, you should notice the icons on the micro:bit changing to match the code.

3. Edit some of the On ML start blocks by adding music or animations for your different spells.

Explore the other blocks in the Machine Learning category. If you want to learn more about each block, right click any block and select Help to see the popup window.

4. Events vs if-else: The two blocks on the right can be used within loops/if-else statements, providing an alternative way of triggering actions compared to the events blocks that are in the default program.

5. The certainty block allows you to set a different threshold from the one you chose in the training phase (refer to Step 3 in “Training and Testing your Model”)

The code on the right shows examples of different ways you can program this model. On the left, you have the on ML start event buttons. On the right, you have if-else statements that can program your model to be more precise, if needed.

Next Step

Controlling the Finch Using Your Machine Learning Model in MakeCode

1. Remove any code that you have added to your MakeCode project, so you are only left with the on ML start event blocks.

Note: To remove code blocks, drag and drop the blocks to the categories list. A trash can icon will appear.

2. You will be coding a “sender” program for the micro:bit that is attached to your magic wand.

Drag out an on start block from the blue BASIC category. Then drag a radio set group block from the pink RADIO category and place that in the on start block. Click the number in the radio set group block to set the radio group number. You can use any number between 1 and 255. Remember this number!

Note: If you are in a classroom with multiple students, each student needs to choose a DIFFERENT radio group number. That way YOUR magic wand can talk to YOUR Finch.

3. Drag a radio send number block from the pink RADIO category and place one block into each of the on ML start event blocks. Next, drag a show number block from the blue BASIC category beneath each radio send number block.

Send a different number for each gesture. For our model, we will send a 1 for “up and down”, a 2 for “side to side”, a 3 for “circle” and a 4 for “at rest”

The reason we added the show number block is so that when you make your gestures, you can see the number that is being sent to the micro:bit. This can help with debugging!

4. SAVE your radio sender project to your computer. For instructions on how to save your project, visit https://microbit.org/get-started/user-guide/microbit-createai/#saving-and-loading

DOWNLOAD this code to the micro:bit in your magic wand.

TRY IT OUT! Do your different gestures and look at the numbers on your wand. Does your project work as expected? Do you need to do any debugging?

5. Use the link below to open a new MakeCode editor with a Finch Starter code.

MakeCode with Finch

You should now have two MakeCode windows open.

6. Drag a radio set group block from the pink RADIO category and place that in the on start block underneath Start Finch. Click the number in the radio set group block to set the radio group number. You should input the SAME number you used in your previous code. In this example, it was 145.

7. Delete the Forever block and drag out an on radio received block from the pink RADIO category.

8. Drag an if-else block from the teal LOGIC category and place it in the Forever block.

Click the plus sign in the if-else block TWO TIMES to expand your code to match the sample code on the right.

9. Drag an ___ = ___ comparison block from the teal LOGIC category into each of the “true” and “false” statements in your code.

Then right click on the received number value in your code and select duplicate.

10. Right click on the received number value in your code and select duplicate to create a new received number value.

11. Add a received number value to each comparison block. Then change the value in the first comparison to 1, the second to 2, and the third to 3.

What we have set up here is a program that will execute certain actions based on what number is received. Now we get to have some fun!

12. Now that your radio sender and receiver codes are built, let’s add some commands for the Finch! The code on the right will make the Finch do the following tasks based on the magic wand gestures:

  • IF you move your magic wand up and down, THEN the Finch will move forwards 10 cm, then backwards 10 cm, then stop.
  • IF you move your magic wand from side to side, THEN the Finch beak and tail lights will flash different colors rapidly 4 times in a row and then turn off.
  • IF you move your magic wand in circles, THEN the Finch will turn around in a circle and then stop.
  • IF your magic wand is at rest, THEN the Finch will not react.

13. SAVE your Finch project to your computer. For instructions on how to save your project, visit https://microbit.org/get-started/user-guide/microbit-createai/#saving-and-loading

DOWNLOAD this code to the micro:bit in your Finch Robot.

TRY IT OUT! Turn your Finch on and do your different gestures and look at the way the Finch reacts. Does your project work as expected? Do you need to do any debugging?

14. Going Further: Now that you know how to program your Finch to react to gestures you make with a magic wand, you can make this project your own!

Here are some suggestions!

  • Modify the code to make the Finch react differently to each of the gestures.
  • Create a new model using different gestures that you choose.
  • Make the Finch’s reactions more complex! Modify the code so that each gesture controls both the Finch wheels AND lights. Maybe even add sounds too!

Back to AI Main Page

Back to Top
  • Intro to Machine Learning and micro:bit's CreateAI
  • What You Will Need
  • Setting Up the micro:bit and Collecting Data
  • Training and Testing Your Model
  • Using Your Machine Learning Model in MakeCode
  • Controlling the Finch Using Your Machine Learning Model in MakeCode
  • Back to AI Main Page
BirdBrain Technologies
  • Contact Us
  • Join Our Mailing List
  • Support
NSF logo

National Science Foundation Research and development has been generously funded in part by STTR grants from the National Science Foundation.

Copyright ©2010-2026 BirdBrain Technologies. All rights reserved.

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}