← Projects
electronics intermediate 18 days ago ◑ 22 views ◯ 5 min read

Build an ESP32 Vibration Monitor for Early Fault Detection on 3D Printers, CNC Routers, and Dust Collectors

Build time: 4-6 hours
Tools needed: Soldering iron, computer for firmware flashing and FFT analysis, double-sided mounting tape or small machine screws, multimeter
esp32vibration monitoringadxl345mpu6050predictive maintenancefftfault detectionshop machines
Parts List

By the time a CNC spindle bearing, a 3D printer's fan, or a dust collector's motor bearing fails loudly enough to notice by ear, it's usually already caused secondary damage or ruined a job in progress. Rotating machinery develops a measurable vibration signature well before it fails outright — bearing wear, imbalance, and loose mounting all show up as changes in vibration frequency content long before they're audible. This project builds a simple, low-cost vibration monitoring node around an ESP32 and an accelerometer that logs baseline vibration signatures for your shop machines and flags meaningful deviation, giving you a heads-up on developing problems instead of a surprise failure mid-job.

What This Is (and Isn't)

This is not a replacement for proper industrial vibration analysis equipment, and it won't diagnose the exact failure mode the way a trained vibration analyst with calibrated equipment would. What it does well is the thing that actually matters for a home shop: establish what "normal" vibration looks like for a given machine when it's running healthy, then alert you when that signature drifts meaningfully — which is enough advance warning to schedule an inspection before a bearing seizes mid-cut or a dust collector motor burns out.

Sensor Choice: ADXL345 vs MPU6050

SensorStrengthsLimitations for This Use
ADXL345Purpose-built accelerometer, good noise floor, configurable sample rate up to 3200Hz — enough to capture most shop machine vibration frequencies of interestNo gyroscope, so it only sees linear acceleration, not rotational motion
MPU6050Combined accelerometer + gyroscope, cheap and widely availableNoisier accelerometer output than a dedicated part like the ADXL345, and the extra gyro data isn't useful for this application

For vibration signature work specifically, the ADXL345 is the better primary choice — its higher sample rate and lower noise floor matter more here than the MPU6050's extra gyroscope axis, which this project doesn't use. Mount the sensor as rigidly as possible directly to the machine's bearing housing or motor mount, not to a flexible bracket or via a long cable run with slack — any mechanical play between the sensor and the machine shows up as noise that masks the actual signal you're trying to capture.

Capturing and Processing the Vibration Signature

Sample the accelerometer at a consistent rate (800–1600Hz is a reasonable range for most shop machine bearing and imbalance frequencies) over a fixed window — a few seconds of data is enough — and run an FFT on the ESP32 (the arduinoFFT library handles this well within the ESP32's processing headroom for buffer sizes in the low thousands of samples) to convert the raw time-domain acceleration signal into a frequency spectrum. The resulting spectrum, not the raw waveform, is what you actually compare over time: a healthy bearing shows a clean spectrum dominated by the expected rotational frequency and its harmonics, while developing bearing wear introduces new frequency components and raises the noise floor between the expected peaks.

Establishing a Baseline and Detecting Drift

  1. Run the monitor on a known-healthy machine for several sessions across different jobs, and save the resulting FFT spectra as your baseline reference.
  2. On each subsequent run, capture a fresh spectrum under similar operating conditions (same spindle speed, same general load type) and compare it against the baseline — a simple sum of squared differences between corresponding frequency bins, or a more careful comparison of peak locations and relative magnitudes, both work reasonably well at this scale.
  3. Set an alert threshold based on how much spectra naturally vary run-to-run on your specific machine when healthy — this takes a bit of initial tuning, since every machine has some natural variance, and a threshold that's too tight generates nagging false alarms you'll learn to ignore.
  4. Log every capture with a timestamp so you can look back at the trend over weeks or months, not just the most recent reading — gradual bearing wear shows up as a slow drift that's easy to miss comparing only the last two readings, but obvious looking at a month of data.

Practical Deployment Across Multiple Machines

Build several of these as small standalone nodes — one per machine that's expensive enough or critical enough to justify it (a CNC spindle, your main dust collector motor, a 3D printer's primary cooling fan if you're running an enclosed farm) — each reporting over Wi-Fi/MQTT to a central dashboard rather than trying to multiplex several sensors through one controller with long cable runs. Long analog or I2C cable runs between the sensor and the ESP32 pick up electrical noise from nearby motor wiring and VFD drives, which defeats the purpose; keep each sensor node physically close to its ESP32 and use shielded cable for any run longer than a few centimeters near a spindle or motor.

What a Deviation Alert Should Prompt You to Do

Treat an alert as "go inspect this machine soon," not "shut it down immediately" — the system is intentionally tuned toward catching slow-developing problems early, not detecting imminent catastrophic failure. A sudden, large spike in vibration alongside an alert is a different situation and warrants stopping the machine and inspecting before continuing; a gradual drift over several logged sessions is the more common pattern and gives you time to schedule a bearing inspection or re-tensioning at a convenient point rather than mid-job.

The real value of this project isn't any single reading — it's the trend line you build up over months of logged spectra, which turns "that machine sounds a little different lately" from a vague hunch into an actual data-backed decision about when to open it up and check.