Skip to main content

Case 11: Simple AI Exercise Timer

Introduction

By comparing the trained data model and downloading it to the micro:bit board, pressing button "A" on the micro:bit board allows you to check how many seconds you have been exercising; pressing button "B" allows you to check the time you have been stationary.

Purpose of the Case

Learn the basic operations of Create AI projects.

Required Materials

ItemImageQuantity
Smart Coding Kit1
micro:bit1
USB Cable1
Personal Computer1

User Tutorial

  1. Use the Chrome or Edge web browser to visit https://createai.microbit.org/ as shown in the figure below.

  1. Browse and read the relevant knowledge points, locate "Projects" and click the "Simple AI exercise timer" project.

  1. Browse and read the relevant knowledge points, then locate the "Collect data samples" directory and click "Open in micro:bit CreateAI".


Step 2: Create a New Project

  1. Create a new project, name it, and click "Start Project".

  1. On the data sample page, find "connect" and click it.


Step 3: Connect the micro:bit Board

  1. Please ensure that all necessary materials and equipment are ready, then click "Next".

(If your personal computer has Bluetooth connectivity, only one micro:bit board is needed. If your personal computer does not support Bluetooth connection, click "Use micro:bit Wireless Connection" and follow the tutorial to complete the connection.)

  1. Please connect your micro:bit board to the computer using a data cable, then click "Next" and follow the tutorial to complete the program download.

  1. Wait for the program to be downloaded and installed on the micro:bit board.

  1. Please disconnect the USB cable and turn on the power of the Watch Kit Pro, then click "Next".

  1. Click "Next" and follow the tutorial to complete the Bluetooth connection authentication process.

  1. Select "micro:bit Board" and click "Pair", wait until the connection is successful.

  1. If the connection is successful, the "X", "Y", "Z" lines in the "Real-time Data Area" will change accordingly as you shake the watch.

Step 4: Train Model and Data Model Recognition Calibration

  1. Click "Train Model"

  1. Click "Start Training" and wait for the data model deployment to complete.

  1. Click "Next" and follow the tutorial to complete the guidance.

  1. Please wear the watch kit on your right wrist, making sure that the side with the logo is facing outward. When you perform large-scale activities, you can observe that the recognition rate of the "Exercise" data model exceeds 80%.

  1. When you are in a stationary state, you can observe that the recognition accuracy of the "Static" data model exceeds 80%.

Step 5: Program Writing and Download

  1. Click "Edit in MakeCode".

  1. Connect the micro:bit board with a data cable and click "Download".

  1. Click "Next"

The target of your download is the micro:bit board used for data collection, please select "Same micro:bit". If the target of your download is another different micro:bit board, select "Different micro:bit".

  1. After completing the download according to the tutorial instructions, when you are in a moving state, the LED matrix screen of the micro:bit board in the watch will display the "stick figure" icon. When you are stationary, the LED matrix screen of the micro:bit board in the watch will display the "asleep" icon.

Result

When you are in a moving state, the LED matrix screen of the micro:bit board in the watch will display the "stick figure" icon. When you are stationary, the LED matrix screen of the micro:bit board in the watch will display the "asleep" icon. Press button "A" on the micro:bit board to check how many seconds you have been exercising; press button "B" to check the time you have been stationary.

Common Problems