VibroSense Real-Time Machine Anomaly Detection Using TinyML on ESP32

Published Jun 14, 2026
 40 hours to build
 Intermediate

VibroSense is a TinyML-powered anomaly detection system that runs entirely on an ESP32, using an MPU-6050 accelerometer to classify machine vibration patterns as normal or faulty in real time — no cloud, no server, just edge AI detecting mechanical faults instantly at the source.

display image

Components Used

Micro USB Cable
USB Cables / IEEE 1394 Cables 3FT STRONG MCROUSB-B/USBACBL
1
ESP32
wireless sensor mesh nodes across field zones for real-time soil data
1
MPU-6050
3-axis accelerometer + gyroscope for vibration sensing
1
dc motor
The test motor used for monitoring and fault detection.
1
Jumper Wires F-F
ESP32 to MPU-6050 connections
4
Motor Speed Regulator
Controls the RPM (speed) of the DC motor
1
Description

Introduction: The Problem

Industrial machinery failures are costly, unpredictable, and dangerous. A bearing failure, shaft imbalance, or mechanical fault in a motor can cause production downtime, equipment damage, and safety hazards. Traditional predictive maintenance systems rely on expensive sensors, cloud connectivity, and dedicated hardware — making them inaccessible for small-scale industrial setups.

The core question VibroSense answers: Can a low-cost microcontroller detect mechanical anomalies in real time using AI — without any cloud dependency?

The VibroSense Solution

VibroSense is a TinyML-powered anomaly detection system that runs entirely on an ESP32. It uses an MPU-6050 accelerometer to continuously read vibration data from a running machine, classify it as normal or faulty in real time, and display the result live on a WiFi dashboard — all processing happening directly on the chip.

No cloud. No server. No internet required during operation.

How It Works

Step 1 — Data Collection

The MPU-6050 accelerometer is mounted directly on the motor body using double-sided tape, ensuring it captures every vibration the motor produces. Vibration data is collected in two states:

  • Normal — motor running smoothly with no added weight
  • Anomaly — motor running with an unbalanced load attached to the shaft, simulating a real mechanical fault

Data is streamed from the ESP32 to Edge Impulse using the Edge Impulse CLI for labelled dataset collection.

Step 2 — Model Training on Edge Impulse

The collected dataset is uploaded to Edge Impulse where:

  • A Spectral Analysis processing block extracts frequency domain features from the raw X, Y, Z accelerometer data
  • A Neural Network classifier is trained on the extracted features
  • The model learns to distinguish normal vibration patterns from anomalous ones

Training achieves above % accuracy on the validation set.

Step 3 — Model Deployment to ESP32

The trained model is exported from Edge Impulse as an Arduino library and flashed directly onto the ESP32. The ESP32 now runs the entire inference pipeline on-chip — reading accelerometer data, running the TinyML model, and outputting a classification result every 500 milliseconds.

Step 4 — Live WiFi Dashboard

The ESP32 hosts a live web dashboard accessible from any phone or laptop on the same WiFi network. The dashboard updates every 600 milliseconds without page refresh and displays:

  • Motor status — NORMAL or FAULT DETECTED with animated indicator
  • Confidence percentage for each classification
  • Live X, Y, Z accelerometer values
  • Real-time vibration graph showing all three axes.

System Architecture

Hardware

  • ESP32 — reads MPU-6050 data via I2C, runs TinyML inference, hosts WiFi web server
  • MPU-6050 — mounted on motor, streams 3-axis accelerometer data at 100Hz
  • DC Motor — provides vibration source for both normal and anomaly states

Software Pipeline

  • Edge Impulse — data collection, spectral feature extraction, neural network training, model export
  • Arduino IDE — firmware development and flashing
  • WiFi WebServer — ESP32 hosts dashboard at local IP, JavaScript fetches live data via /data API endpoint every 600ms

Results

  • Normal vibration correctly classified as NORMAL — confidence consistently above 85%
  • Anomalous vibration (unbalanced motor) correctly classified as FAULT DETECTED — confidence consistently above 90%
  • Inference runs at approximately 2 classifications per second on ESP32
  • WiFi dashboard updates live with no page reload required
  • Full system operates with zero internet dependency after initial model deployment

Applications

VibroSense is applicable to any scenario where mechanical anomaly detection is needed at low cost:

  • Industrial motor health monitoring
  • Pump and compressor fault detection
  • Conveyor belt anomaly detection
  • HVAC system monitoring
  • Any rotating machinery predictive maintenance application

What Makes VibroSense Different

  • Runs entirely on a ₹500 ESP32 — no dedicated edge AI hardware needed
  • Zero cloud dependency — inference happens fully on-chip
  • Deployable in under 10 minutes — flash and mount
  • Live dashboard accessible from any phone browser on local WiFi
  • Trained on real vibration data — not simulated or synthetic
Codes
Comments
Ad