Skip to content

hernancardoso/voice-activated-microbit

 
 

Repository files navigation

Voice activated micro:bit

A demo application that makes your micro:bit (2020 model) respond to your voice, built with Edge Impulse. This demo uses Machine Learning to analyze the audio feed coming from the microphone, then showing a smiley on screen when it hears "microbit".

Video tutorial:

Voice-activated micro:bit

How to build

  1. Install CMake, Python 2.7 and the GNU ARM Embedded Toolchain. Make sure arm-none-eabi-gcc is in your PATH.

  2. Clone this repository:

    $ git clone https://github.com/edgeimpulse/voice-activated-microbit
    
  3. Build the project:

    $ python build.py
    
  4. And flash the binary to your micro:bit, by dragging MICROBIT.hex onto the MICROBIT disk drive.

How to change the keyword

You can build new models using Edge Impulse.

  1. Sign up for an account and open your project.

  2. Download the base dataset - this contains both 'noise' and 'unknown' data that you can use.

  3. Go to Data acquisition, and click the 'Upload' icon.

  4. Choose all the WAV items in the dataset and leave all other settings as-is.

  5. Go to Devices and add your mobile phone.

  6. Go back to Data acquisition and now record your new keyword many times using your phone at frequency 11000Hz.

  7. After uploading click the three dots, select Split sample and click Split to slice your data in 1 second chunks.

  8. Follow these steps to train your model.

    Note: use window length 999 instead of 1000!

Once you've trained a model go to Deployment, and select C++ Library. Then:

  1. Remove source/edge-impulse-sdk, source/model-parameters and source/tflite-model.
  2. Drag the content of the ZIP file into the source folder.
  3. If you've picked a different keyword, change this in source/MicrophoneInferenceTest.cpp.
  4. Rebuild your application.
  5. Your micro:bit now responds to your own keyword 🚀.

About

Bleep, bloop, I'm a computer that responds to your voice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 82.0%
  • C++ 17.0%
  • Other 1.0%