Tiny Motion Trainer :

Tiny Motion Trainer

Google Experiments have released a ‘Teachable Machine’ interface for Arduino. It specifically works with the Nano BLE Sense board as it has many on-board sensors alongside the capability to run Tensorflow Lite models on the physical microcontroller.

7414-TMT_16x9_POV_2021_0513_v_002.mp4

<aside> 💡 We can follow the guided steps to train some gestural movements.

  1. Select: Start New Project
  2. Download and run the latest version of their Arduino sketch. (You do not need to do this now as I have pre-loaded all the devices with this. However, for future reference when starting from scratch this is required)
  3. Press Connect and select your board
  4. Choose your capture settings.
  5. Capture your data
    1. Create a label the press ‘create new’
    2. Prepare to make the gestural movement.
    3. Press record and make the movement.
    4. There is a delay in between capturing data so you can reset your position without pressing ‘stop recording’.
  6. Once you have enough samples select ‘Train Your Model’ and hit start.
  7. Select ‘Test your model’
  8. Select ‘download your model’ and choose Arduino model and example. </aside>

Examples using Tiny Motion Trainer…

Finger User Interface by Google Creative Lab - Experiments with Google

Air Snare

Mapping Dance by Eduardo Padrón - Experiments with Google

Tiny Motion Trainer : what next?

Google’s Tiny Motion Trainer is a very powerful interface for training gestural data. However, it only captures the data (much like Teachable Machine) and if you want to do more with it you need to transfer the model data to other tools. There are a few directions you could go next after training the data.

  1. Use the downloaded Arduino .ino sketch to work entirely in Arduino to trigger physical outputs such as lights, motors, sound. This guide helps you set up your Arduino device and IDE for Tensorflow Lite
  2. Send the data from Arduino to somewhere else….such as P5JS

tinymotionvisualdesktop.gif

<aside> 🔥 This template allows you to stream your trained model data back into P5JS so you can generate graphics, audio, etc with your data. It is also a helpful visualisation tool.

p5.js Web Editor

</aside>

In order to stream the trained data into P5JS we need to format the serial messages in Arduino. This template does this for you.

08302022_164333.MOV-high.gif

To make it work with your trained data follow these steps.

  1. Replace the model.h file with your own

modelCopyPaste.gif