TinyML Language Detector with Edge Impulse on Arduino Nano 33 BLE Sense
Components and supplies
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 3 | |||
![]() |
| × | 1 |
Necessary tools and machines
![]() |
| |||
![]() |
|
Apps and online services
![]() |
| |||
![]() |
| |||
![]() |
|
About this project
Overview
This project demonstrates how to build a TinyML language detector on the Arduino Nano 33 BLE Sense using Edge Impulse Studio. The device continuously listens for three spoken words – “si” (Italian), “oui” (French), and “yes” (English) – and activates the corresponding flag when a word is detected.
The workflow comprises:
- Dataset creation and sampling
- Model design and training
- Performance evaluation
- Hardware‑specific optimization with the EON Tuner
- Deployment and integration with servo‑controlled flags

Sampling & Dataset Creation
The dataset contains 30 minutes of recordings: 10 minutes per target word plus 3 minutes of ambient background noise. Each 1‑second clip captures a single utterance, and all files are labeled accordingly in Edge Impulse.

Background samples help the model differentiate speech from non‑speech.

Model Design
Edge Impulse automates most preprocessing steps. Audio is converted to a time‑series, windowed, and transformed using MFCC features. A lightweight CNN then classifies each window into one of four classes: “si,” “oui,” “yes,” or background.

Sample MFCCs and the network architecture are visualized in the training dashboard.
Training & Arduino Optimization
The EON Tuner automatically explores dozens of model configurations, scoring each by accuracy, inference time, RAM, and flash usage. For this project, the fastest model among the top‑5 accuracies was selected.

Testing
After training, a fresh test set confirmed robust performance. Classification confidence consistently exceeded 80% for the target words.

Deployment
Deployment is streamlined via the Edge Impulse Arduino library. The generated header file is dropped into the Arduino IDE, then customized to control three SG90 servos that display flags.


Code Overview
The source code (available on GitHub) extends the Edge Impulse template with servo control logic. Key additions include:
- Integration of
Adafruit_PWMServoDriver.hfor PCA9685 PWM control. - A
servos_selectorfunction that activates the correct flag based on the model’s confidence. - Conditional logic that triggers
servos_selectorwhen a classification exceeds 80% confidence.
void servos_selector(int iter){
unsigned long time_now = millis();
if (time_now - time_was > 2000){
time_was = time_now;
switch (iter){
case 0: // Italian
pwm.setPWM(0, 0, 350); delay(500);
pwm.setPWM(0, 0, 200); pwm.setPWM(1, 0, 200); pwm.setPWM(2, 0, 200);
break;
case 1: // French
pwm.setPWM(1, 0, 350); Serial.println("2222"); delay(500);
pwm.setPWM(0, 0, 200); pwm.setPWM(1, 0, 200); pwm.setPWM(2, 0, 200);
break;
case 2: // English
pwm.setPWM(2, 0, 350); Serial.println("333"); delay(500);
pwm.setPWM(0, 0, 200); pwm.setPWM(1, 0, 200); pwm.setPWM(2, 0, 200);
break;
}
}
}
Circuit Design
The microcontroller is powered by a 9V battery and uses a PCA9685 board to drive three SG90 servos. The board’s 12V pin is connected to the battery, while the PWM outputs drive the servos via the PCA9685’s I2C interface.

With the hardware, software, and data pipeline in place, the TinyML language detector is ready for deployment.
Code
code
https://github.com/EnzoCalogero/Tensorflow_Lite_embeded/tree/main/nano_sense_EdgeImpulse/language_detection/nano_ble33_sense_microphone_continuousCustom parts and enclosures
Schematics
languagedetection_9RxXhRX5sj.fzz
Manufacturing process
- Build a Real-Time Gyroscope Game with Arduino Nano & MPU-6050 Sensor
- Arduino Digital Dice Project: Build Your Own LCD-based Random Number Generator
- Build an Audio‑Reactive Desk Lamp with Arduino Nano
- NeoPixel Matrix Pong on Arduino Nano: Build a Neon Pong Game
- Arduino-Powered Security System: Smart Motion Detection & Alert
- Build a Classic Arduino LCD Arcade Game with Buzzer and Joystick
- Arduino Tennis Game – Build a Virtual Racquet Experience with NeoPixel, Sensors, and Bluetooth
- Build a Smart Weather Station with Arduino UNO and AWS Integration
- Arduino Marble Maze Labyrinth – Build an Exciting Cardboard Board Game
- Build an Interactive LCD Game with Arduino UNO








