You are on page 1of 6

instructables

Micro:bit AI Vehicle With SoundClassification

by Lillians

I made a AI vehicle that uses BBC micro:bit. I used micro:bit version 1).
With JavaScript code the micro:bit is connected to the computer over Bluetooth and when I say any of the keywords the
computer sends a string value to micro:bit.
Micro:bit is coded via MakeCode. I used the extension Servo:Lite.
This project uses ml5.js library for Sound Classi cation. I used the "SpeechCommands18w" which can recognize "the ten
digits from "zero" to "nine", "up", "down", "left", "right", "go", "stop", "yes", "no".
I wanted my veichle to move forvard, backvard, left, right and to stop so I ended up with using go, down, left, right and
stop as my keywords
The veichle uses two servo motors 360°, two wheels and a glass marble in the front.
Supplies:

Things you need and where to get / buy them

Hardware components
3D printed Chassi
Servo:lite board
Continuous Rotation Micro Servo - FS90R ( 2 )
Wheel for FS90R ( 2 )
Micro:bitYou can use version 1 as well

Software apps and online services


p5.js
ml5.js
Microsoft MakeCode

Micro:bit AI Vehicle With SoundClassification: Page 1


Step 1: 3D Files

The veichle is built from a 3D printed chassi that I drew. The.stl les are available at Thingiverse

Micro:bit AI Vehicle With SoundClassification: Page 2


Step 2: The Vehicle

Build the vehicle with the Servo:lite board, two servo motors 360° and wheels. If you use my 3D print it is just to "plug
and play". No screws or glue.

Micro:bit AI Vehicle With SoundClassification: Page 3


Step 3: Code the Micro:bit

Program the Micro:bit in Microsoft MakeCode.


I used the extension Servo:Lite.
The micro:bit I use is version 1.

Micro:bit AI Vehicle With SoundClassification: Page 4


Step 4: Code the AI Part in Computer

I use JavaScript with libraries p5.js and ml5.js


Program the AI part in your computer. Get the code from my github.
There is an image on github where you beter can see the code I used in Microsoft MakeCode

Micro:bit AI Vehicle With SoundClassification: Page 5


Here I made a simple program to make it work. You can make more advanced programs for the Micro:bit to make it do
even more things.
In "SpeechCommands18w" there are 18 words that the model can recognize so the possibilities are many.

Step 5: Test the Code

I made a website on github pages with the code of the AI part. You can try the code out by programming your micro:bit
with a program similar to my code in step 3. The green blocks can be changed to whatever you prefer (led display, or
something else).
Power the micro:bit up and use my github pages to connect with the micro:bit. Use same keywords as I used in my
program.
The code works on Chrome browser on PC and Android. On IOS .....Not.......

Micro:bit AI Vehicle With SoundClassification: Page 6

You might also like