Add AI to Any DIY Robot
This App has the same capabilities as its Micro:Bit version
Teachable Machine is an educational web app developed by Google that simplifies the process of training a machine learning model for image, sound, and pose classification tasks. Using a computer webcam, you can easily upload photos of your training data and, within minutes, have a functioning model capable of recognizing hand gestures, objects, patterns, and more. This makes Teachable Machine a fantastic educational tool in the classroom for demonstrating the principles of machine learning and helping young students grasp the basics of Artificial Intelligence in practice.
This app acts as a bridge to connect your trained model with a Calliope mini board. Once your model is ready, you can open it in the Teachable Calliope App, connect via Bluetooth to the Calliope mini, and send the names of detected classes to your robot, enabling you to program its behavior any way you want.
The best feature of the Teachable Calliope app is that it can run on your smartphone, which is small enough to be mounted directly on your robot. This makes it very easy to create an autonomous robot with AI capabilities!
How It Works
- Train a Model in Teachable Machine
If you want to learn how to use Teachable Machine, you can check my tutorial. - Export the Model to the Cloud
Within Teachable Machine, export the model to the cloud. You will receive a link that looks something like this:https://teachablemachine.withgoogle.com/models/Jgyr546VH/
- Open the Teachable Calliope App
On your laptop or mobile device, open the app and click the START image button. A prompt window will appear where you need to paste the link to your Teachable Machine model. - Allow Camera Access
Allow the browser to use your device camera. After loading the model, you should see a camera preview and the names of detected classes displayed below the camera window. - Prepare Your Calliope mini
Use MakeCode to write a program that allows the Calliope mini to connect to Bluetooth UART and receive string data. You can find a sample code snippet below. - Connect to the Calliope mini
Click the robot head icon in the upper-right corner to connect to the Calliope mini board. - Control Actions
Once the connection is established, the Calliope mini will receive class names from the app. You can then control the robot’s actions based on these messages using your Calliope mini code.
Calliope mini Code Template
This code will activate bluetooth UART on the Calliope board and display received strings as text on the board display.
Problems with connecting over bluetooth
If you have problems connecting over bluetooth:
- your board is not discoverable by the app
To make the board discoverable over bluetooth you have to properly set PROJECT SETTINGS in MakeCode (individual for each project!)
- go to (GEAR ICON) -> PROJECT SETTINGS
- Next click EDIT SETTINGS AS TEXT
- scroll down to section about BLUETOOTH and add this line: “pairing_mode”: 0,

"preferredEditor": "blocksprj",
"yotta": {
"config": {
"microbit-dal": {
"bluetooth": {
"open": 1
}
}
},
VERY Important Notes!
- When you train your Teachable Machine model, use class names without spaces. If you need multi-word class names, join them with underscores, like this:
this_class_name
. - When you export a model to the could and open it in Teachable Calliope App it gets cached in browser memory and if try to make some modifications in the model and update it in the cloud the Calliope app will still load the cached version, to prevent it open the app in new incognito window.
Saving models links
If you want to use your model multiple times and do not want to paste model link each time you open the app you can pass it as a page address parameter, for example:
Link to TM model: https://teachablemachine.withgoogle.com/models/Jgyr546VH/
Take the last part Jgyr546VH
and add it to the Calliope app address like that:
https://cardboard.lofirobot.com/teachable-calliope/?model=Jgyr546VH
This way the model will load automatically after opening the app and you can access the model simply by storing this link.
Supported platforms
- Desktop web browser – Chrome, Edge, Opera
- Android
- ChromeOS
- iPhone or iPad – via Bluefy web browser
Project Ideas
- Color Ball Sorter
A robot that sorts balls based on color. - Gesture-Controlled Rover
A robot car controlled using hand gestures. - Smart Trash Bin
A bin that detects plastic and paper using a camera. - Smart Gate
A gate that opens only for specific cars. - Basic Line Follower Robot
Note: This project is tricky because Teachable Machine performs image classification, which is suitable for distinguishing objects like apples and bananas but not for detecting line positions on a screen. For this, you would typically use linear regression. However, you can create a “proof of concept” line tracker using Teachable Machine.