Teach a controller to recognize specific physical gestures, a shake, a tap, a flip, entirely from motion data, running a genuine trained model locally on hardware already in the catalog.
2 real parts included
Total for this kit: 885.00 ฿
Doesn't include any order discount you may get at checkout.
This project teaches a controller to recognize specific physical gestures from raw motion data, a shake, a tap, a flip, using a genuine trained classification model running locally on the same IMU sensor already used in this catalog's simpler tilt-display build. It's the clearest, lowest-cost entry point into TinyML in the whole catalog, since it needs no new hardware at all.
What the Controller Does
It continuously collects a short rolling window of motion readings, runs a trained classification model against that window, and checks whether the result matches one of its known gestures closely enough to trigger an action.
What the IMU Does
It reports raw acceleration and rotation values continuously, the same sensor data used for the simpler tilt-display build, just fed into a trained model here instead of a direct angle calculation.
Software and Library Concepts
This is meaningfully more involved than reading a sensor value directly: collecting labeled example motion recordings of each gesture, training a small classification model on that data, and converting it to a compact format that runs on the controller. Start with a simple two-gesture example, shake versus still, before attempting anything more elaborate.
Testing and Troubleshooting
The model confuses similar gestures, collect more labeled training examples of each one, especially ones that are genuinely similar in motion profile, rather than assuming the model architecture itself is the problem.
Recognition works during training but not in real use, make sure the live data collection window matches the same length and sample rate used when the training data was recorded.
No sensor readings at all, this is the same IMU used in the Digital Compass & Tilt Display build, the same wiring and troubleshooting steps apply.
Optional Upgrade
Add the buzzer from the parts bin to give an audible confirmation whenever a gesture is correctly recognized, real feedback that closes the loop for the person using it.
The MPU6050 is a genuine, well-supported I2C accelerometer/gyroscope, default address 0x68, and `Adafruit_MPU6050` + `Adafruit_Sensor` are real, standard Arduino libraries for it.
Honesty on scope: a real TinyML motion classifier needs a trained model — there's no legitimate way to "classify" motions (e.g., shake vs. tap vs. still) without training on labeled example data first. So this starter code does the honest, correct first step: it captures accelerometer + gyroscope samples at a steady rate and prints them over Serial in a comma-separated format suitable for feeding into Edge Impulse's Data Forwarder (a real, standard tool in Edge Impulse's ingestion pipeline that reads exactly this kind of fixed-rate CSV-over-serial stream). The natural next steps — labeling motion samples in Edge Impulse's Studio, training a classifier, and deploying the resulting inference library back onto this board — are the genuine path to an actual classifier; this sketch does not fake an `predict()`/inference call.
Wiring Diagram
Starter Code
#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#define I2C_SDA_PIN 8
#define I2C_SCL_PIN 9
#define SAMPLE_RATE_HZ 100 // steady rate suitable for Edge Impulse's Data Forwarder
Adafruit_MPU6050 mpu;
void setup() {
Serial.begin(115200);
Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);
if (!mpu.begin()) {
Serial.println("MPU6050 not found — check wiring/I2C address");
while (1) delay(1000);
}
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
}
void loop() {
static unsigned long lastSample = 0;
unsigned long intervalMs = 1000 / SAMPLE_RATE_HZ;
if (millis() - lastSample >= intervalMs) {
lastSample = millis();
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
// CSV line: accX,accY,accZ,gyroX,gyroY,gyroZ
// Feed this stream into Edge Impulse's Data Forwarder to collect labeled
// training data, then train/deploy an actual classifier — this sketch
// only captures data, it does not classify motions.
Serial.print(a.acceleration.x); Serial.print(",");
Serial.print(a.acceleration.y); Serial.print(",");
Serial.print(a.acceleration.z); Serial.print(",");
Serial.print(g.gyro.x); Serial.print(",");
Serial.print(g.gyro.y); Serial.print(",");
Serial.println(g.gyro.z);
}
}