HomeEngineering Projects For YouSmart AIoT Cavitation Sentry & Autonomous Adaptive Speed Control

Smart AIoT Cavitation Sentry & Autonomous Adaptive Speed Control

Impressed by this project? Give it your People’s Choice vote.
0 votes

AIoT-Based Cavitation Detection and Adaptive Control System for Centrifugal Pumps is designed to detect early signs of hydrodynamic cavitation and optimise pump operation using multimodal sensing, Edge AI, and closed-loop control. The system integrates vibration sensors, an acoustic sensor, and motor-current sensing to capture changes in pump behaviour associated with cavitation. A real-time microcontroller acquires high-frequency sensor signals and performs Fast Fourier Transform (FFT) processing, while a Linux-based application processor extracts frequency-band features and executes an on-device Random Forest machine learning model to classify cavitation conditions. When cavitation is detected, an adaptive control mechanism uses PID-based feedback to adjust pump speed through a compatible motor driver or variable-frequency drive, aiming to reduce cavitation risk while maintaining efficient operation. The system also supports real-time telemetry, data logging, and dashboard-based monitoring for performance analysis. By combining non-invasive sensing, edge intelligence, and autonomous speed regulation, the proposed solution aims to minimise pump wear, reduce energy losses, and improve operational reliability in agricultural and industrial pumping applications.

Fig. 1: Author Prototype & Experimental Test Rig Setup showing the closed-loop hydraulic circulation system, DC pump with clip-on piezoelectric sensors, Cytron MDD3A driver, 3S LiPo battery, and live SCADA HMI dashboard running on the dual-core SBC.

Team Members

S.No.NameRole / Contribution
1.Kapilmeet SinghTeam Leader: Embedded Systems Architect, Dual-Core RouterBridge IPC, Edge Physical AI Deployment & System Integration
2.Nikunj SinghalFirmware Engineer: Low-Level Zephyr RTOS Fast ADC Driver Optimization, Ring Buffer Architecture & DMA Subsystem
3.Jaishnu RControl Systems Engineer: Hydrodynamic Flow Dynamics, Net Positive Suction Head (NPSH) Modeling & Closed-Loop PID Control
4.Tanay Savio SaldanhaIoT & Software Engineer: Industrial AIoT Architecture, Real-Time SCADA HMI Web Telemetry Interface & Data Logging
5.Daivik NeogiAcoustic & Mechanical Engineer: Acoustic Waveform Signal Processing, Transducer Enclosure Design, Testbed Rig Construction
6.Shreya VermaAlgorithm Engineer: Multi-Modal Sensor Fusion Architecture, High-Speed Onboard FFT Engine & Spectral Analysis
7.Tanya SinghHardware Design Engineer: Analog Front-End Signal Conditioning, High-Z Piezo Clamping Protection & Power Tree Hardware
8.Aashita GuptaData Scientist: Machine Learning Pipeline, 8–20 kHz Band-Power Feature Engineering, Random Forest Training & Validation

Project Video & Code Access:

Component List (Bill of Materials)

IDComponent Name & Technical SpecificationDesignatorQtyFunction / Purpose
1Arduino UNO Q Single Board Computer (4GB, ABX00173)MOD11Dual-core processing brain: STM32 core (Zephyr RTOS) for 50 kHz ADC + Linux processor for Edge AI & SCADA
2Cytron 3Amp 4V–16V Dual Channel DC Motor Driver (MDD3A)MDD11Solid-state H-bridge motor driver for PWM pump speed modulation
3Piezoelectric Ceramic Disc Sensors (27mm Brass Backing)PZ1, PZ22High-frequency acoustic emission / vibration pickup (PZ1: Suction, PZ2: Discharge)
4Boya BY-M1 Omnidirectional Condenser MicrophoneMIC11Acoustic bubble-collapse sound receiver (airborne cavitation crackle monitoring)
5DC 12V 20W Brushless Submersible Centrifugal PumpM11Target hydrodynamic centrifugal pump plant
6Pro-Range 11.1V 4200mAh 35C 3S Lithium Polymer Battery PackBAT11High-current isolated DC power supply for pump motor and electronics
7SmartElex Mini MP1584 DC-DC 3A Step-Down Buck ModuleMOD21Regulates 11.1V battery rail down to stable 5.0V DC for logic power
81N5822 40V 3A Schottky Barrier Rectifier DiodesD1–D55Ultra-fast over-voltage transient clamping for analog ADC inputs & flyback protection
90.1 Ω 3W ±1% SMD Current Shunt Resistors (2512 Package)R_SHUNT1–44Four parallel shunts (Req = 0.025 Ω) for low-side motor load current sensing
101 kΩ 1/4W 5% SMD 0603 ResistorsR3, R4, R73RC anti-aliasing low-pass filtering and pull-down protection
11100 kΩ 1/4W 1% SMD 0603 ResistorsR2, R62Series current-limiting protection resistors on analog sensor lines
121 MΩ 0.25W Metal Film Axial ResistorsR1, R52High-impedance load/damping resistors for piezoelectric transducers
1310 µF 25V X7R SMD 0805 Ceramic CapacitorC11Low-pass noise decoupling on motor current sensing node (I_SENS)
141/2″ Industrial Reinforced Braided PVC Hose & Ball ValveVALVE1, HOSE1 SetPlumbing loop with manual throttle valve to dynamically starve suction and induce cavitation
1515-Liter Graduated Water Reservoir VesselRES11Closed-loop hydraulic fluid supply basin

Project Explanation Step by Step

1. The Industrial & Agricultural Crisis: Uncontrolled Cavitation

Centrifugal pumps are the lifeblood of agricultural tube-wells, rural borewell micro-irrigation, industrial cooling loops, and marine bilge systems. However, these pumps operate under hostile hydraulic conditions where static pressure at the impeller inlet frequently plummets below the saturation vapour pressure of the liquid (P < Pv).

- Advertisement -

In agricultural installations across rural regions, suction pressure collapses due to everyday field realities:

  • Seasonally falling or fluctuating water tables: Dropping water levels increase suction lift height, starving the pump intake.
  • Gradually clogged suction strainers / foot-valves: Silt, sand, and organic debris restrict inflow.
  • Suction line air leaks: Weathered pipe joints allow air pocket ingress.
  • Mismatched oversized pumps: High-discharge pumps installed on low-yield borewells quickly pull the water column down into continuous cavitation.

The Severe Economic Impact (Financial Justification for Farmers & Industry):

- Advertisement -
  • Direct Equipment Loss: A standard 5 HP to 10 HP submersible agricultural pump costs ₹25,000 to ₹75,000. Replacing an eroded impeller and mechanical shaft seal assembly costs ₹8,000 to ₹15,000 per breakdown.
  • Agricultural Crop Ruin: Unscheduled pump failures during peak 48-hour irrigation intervals inflict soil moisture stress in cash crops, triggering crop losses running into lakhs of rupees.
  • High Return on Investment (ROI): Our clip-on AIoT retrofit unit costs under ₹3,500 (~$42) in BOM parts—paying for itself on day one by preventing even a single pump overhaul.
Fig 2. Close-Up View of the Centrifugal Pump Plant showing the non-invasive clip-on piezoelectric vibration sensor on the suction flange, manual throttle valve for inducing cavitation, and battery wiring.

2. Fluid Dynamics: How Cavitation Destroys Impellers

According to Bernoulli’s principle, fluid accelerates through the pump suction eye, causing static pressure to drop to its lowest point. If the Net Positive Suction Head Available (NPSHa) drops below the Net Positive Suction Head Required (NPSHr), water spontaneously vaporizes into millions of micro-bubbles.

As these vapour bubbles are carried into the high-pressure volute region, they implode within 1 microsecond. Because the collapse is asymmetrical near the blade surface, high-velocity micro-jets slam into the metal with localized shockwave pressures exceeding 1 GPa (10,000 atmospheres) and temperatures exceeding 5,000 K. This micro-blast bombardment creates microscopic surface fractures, progressive metal pitting, loss of impeller mass, hydraulic head collapse, and severe dynamic unbalance.

3. Multi-Modal Non-Invasive Sensor Fusion Architecture

Traditional inline pressure sensors are invasive, requiring pipe drilling and causing leaks. Furthermore, vibration monitoring at low frequencies (< 5 kHz) gets drowned by motor hum, electrical hum, and normal turbulent flow.

Our unit straps directly onto existing pump casings using a high-temperature silicone clip-on mount, fusing three distinct sensory modalities:

  1. Dual Piezoelectric Vibration Pickups (PZ1 Suction, PZ2 Discharge): Piezoelectric ceramics exhibit broadband mechanical resonance. By monitoring both the suction eye and the discharge volute, the system isolates cavitation acoustic emissions from structural bearing rumble.
  2. Acoustic Microphone (MIC1): Captures the airborne ultrasonic “gravel crackle” emitted by collapsing vapour cavities.
  3. Low-Side Current Shunt (A2): Measures micro-ripples in motor armature current. When vapour bubbles collapse against impeller blades, instantaneous hydraulic torque fluctuates wildly, inducing detectable high-frequency current signatures.
Fig 3. Edge Physical AI Block Diagram: Bare-metal 50 kHz ADC conversion on STM32 MCU, 4096-pt Hann FFT engine, RouterBridge IPC, on-device Random Forest classifier, and closed-loop motor driver feedback.

4. Dual-Core Asymmetric Processing Architecture

The core challenge in edge vibration analysis is handling continuous, jitter-free high-frequency sampling while executing machine learning inference and serving web telemetry. A single microcontroller cannot keep up, and a pure Linux microprocessor lacks real-time deterministic I/O.

Our design divides the computational workload across the dual-core architecture of the Arduino UNO Q:

  • Real-Time STM32 Microcontroller Core (Zephyr RTOS): Executes continuous bare-metal 50,000 samples/sec (50 kHz) 14-bit ADC conversions across all three analog channels (A0, A1, A2). It buffers samples in triple 16,384-sample ring buffers and computes an onboard 4096-point Radix-2 FFT in hardware.
  • Linux Microprocessor Core: Runs Debian Linux and connects to the MCU via the internal high-speed Arduino_RouterBridge. It fetches computed FFT spectra, extracts 20 band-power energy features across the 8 kHz – 20 kHz cavitation spectrum, runs an on-device Random Forest classifier, and serves the local SCADA HMI telemetry dashboard.

5. Autonomous “Sense → Decide → Act” Closed-Loop Feedback

Unlike conventional monitoring tools that merely trigger a passive warning buzzer, our unit provides an active closed-loop physical response:

  1. Sense: Dual piezo sensors, acoustic mic, and current shunt capture high-frequency signals at 50 kHz.
  2. Decide: The on-device Random Forest classifier evaluates the 8–20 kHz band-power vector every 100 ms, classifying pump state into Healthy (Nominal Flow), Incipient Cavitation, or Severe Cavitation.
  3. Act: If cavitation is detected, the adaptive PID controller immediately throttles the Cytron MDD3A PWM duty cycle (or adjusts a 0–10V VFD reference), reducing impeller speed by 15% to 25%.
  4. Restoration: Slowing the impeller reduces fluid velocity, raising static pressure above vapour pressure (P > Pv). Cavitation collapses vanish, sensor signatures normalize, and the system restores safe, steady-state water pumping without tripping or requiring manual intervention.

Coding Explanation and Configuration

1. High-Speed Bare-Metal Zephyr ADC & Onboard FFT (`Firmware/MCU_ADC_FFT/sketch.ino`)

To achieve the 50 kHz sampling rate required by the Nyquist criterion for 20 kHz cavitation detection, standard Arduino abstraction was replaced with direct Zephyr RTOS hardware configuration:

// Zephyr RTOS Fast ADC Configuration on STM32 Core

#include “Arduino_RouterBridge.h”

#include <zephyr/drivers/adc.h>

#include <zephyr/device.h>

#define BUFFER_SIZE      16384     // Triple parallel ring buffer size

#define SAMPLE_RATE      50000     // 50 kHz deterministic sampling (20 µs interval)

#define FFT_SIZE         4096

#define FFT_BINS         (FFT_SIZE / 2 + 1)

#define DC_OFFSET        8192      // 14-bit midpoint bias

static const struct adc_channel_cfg ch_cfg_a0 = {

  .gain             = ADC_GAIN_1,

  .reference        = ADC_REF_INTERNAL,

  .acquisition_time = ADC_ACQ_TIME(ADC_ACQ_TIME_TICKS, 5), // <0.5 µs conversion

  .channel_id       = 9, // Pin A0 Suction Piezo

};

Key Firmware Innovations:

  • Pre-Calculated Twiddle & Hann Tables: A 4096-sample Hann window array and N/2 twiddle factor trigonometric arrays are precalculated in setup(), eliminating floating-point trig calls inside the time-critical loop.
  • Decimation-in-Time Radix-2 FFT: Executes in under 12 milliseconds on the STM32, calculating exact spectral bin magnitudes in decibels (dB).
  • Zero-Copy Inter-Core RPC: The MCU registers get_new_samples_synced, get_sample_count, get_fft_result, and get_fft_update_count via Bridge.provide_safe().

2. Linux Python Bridge & Data Acquisition Daemon (`Firmware/Edge_Service/main.py`)

The Python service polls the RouterBridge, extracts synchronized sample batches, and records microsecond-accurate CSV datasets:

# Linux Edge RPC Client & Batch Processing

from arduino.app_utils import Bridge

import numpy as np

# Poll synchronized 3-channel batches from STM32 ring buffer

payload = Bridge.call(“get_new_samples_synced”, 1024)

if payload and len(payload) > 0:

    samples_a0 = payload[0::3] # Suction Piezo (A0)

    samples_a1 = payload[1::3] # Discharge Piezo (A1)

    samples_a2 = payload[2::3] # Motor Current (A2)

3. Feature Extraction & Machine Learning Classification

Bubble-collapse shockwaves emit high-frequency acoustic and structural vibration energy concentrated between 8,000 Hz and 20,000 Hz. Normal motor rotation and flow turbulence occur below 8,000 Hz.

Fig 4. Onboard 50 kHz FFT Magnitude Spectrum showing signature energy resonance in the 8–20 kHz bubble-collapse band.
89.44%AUDIO MODEL ACCURACY (ROC-AUC: 0.9795)87.50%PIEZO VIBRATION ACCURACY (ROC-AUC: 0.9623)

Frames of 100 ms (5,000 samples at 50 kHz) are windowed, transformed via real FFT, and integrated into 20 linearly-spaced band-power energy bins across 8,000 Hz – 20,000 Hz (Δf = 600 Hz per band):

Energy[b] = Sum of |X[k]|2 for frequencies in band b (b = 1 to 20)

Separate regularized CART Random Forest models (criterion=’gini’, max_depth=12, min_samples_leaf=5, ccp_alpha=0.001) were trained and validated on independent recording holdouts:

Evaluation MetricAudio Classifier (Bubble Crackle)Piezo Classifier (Casing Vibration + Current)
Testing Accuracy89.44%87.50%
Weighted Precision0.89930.9125
Weighted Recall0.89440.8750
Weighted F1-Score0.89480.8644
Weighted ROC-AUC0.97950.9623

SCADA HMI Dashboard & Telemetry Architecture

A local SCADA HMI web application is hosted directly on the Linux SoC (port 3000), providing real-time telemetry gauges, an interactive P&ID pump schematic, and autonomous safety toggles.

Fig 5. SCADA Telemetry & Hydrodynamic HMI Dashboard showing real-time RMS vibration, motor current, pump speed, Cavitation Risk Index (%), and interactive P&ID cutaway animation.

Dashboard Capabilities:

  • Vibration Monitoring Tiles: Suction Vibration (Nominal: 0.43 gRMS), Discharge Vibration (Nominal: 0.31 gRMS).
  • Motor Current Load Gauge: Continuously displays armature current (Nominal: 9.51 A) and tracks high-frequency ripple.
  • Cavitation Risk Index (%): Empirically weights spectral energy in the 8–20 kHz band against the baseline, displaying a clear risk percentage (0–100%) and tri-color health state (Green = Optimal, Amber = Incipient Cavitation, Red = Severe Cavitation).
  • Auto-Protection Mode Switch: When engaged, allows the closed-loop PID controller to autonomously govern PWM throttle.

Connection Explanation & Circuit Details

Fig 6. Complete Hardware Circuit Schematic designed in KiCad showing Microcontroller pinouts, Piezoelectric Signal Conditioning, Current Shunt Filter, Cytron MDD3A driver, and MP1584 Buck Power Tree.

Hardware Circuit Protection Highlights:

  1. Piezoelectric Transient Clamping: Piezo discs generate high open-circuit voltage spikes when mechanically shocked. A 1 MΩ load resistor (R1, R5) drains baseline charge, a 100 kΩ series resistor (R2, R6) limits current, and antiparallel 1N5822 Schottky diodes (D1–D4) clamp analog lines strictly between -0.3 V and +3.6 V, protecting the STM32 ADC.
  2. Low-Side Current Shunt Network: Four 0.1 Ω 3W SMD resistors are connected in parallel (Req = 0.025 Ω) on the motor negative return line (MOT- to GND). Even at 10 A peak current, dissipation is only 2.5 W across a 12 W rated package. A 1 kΩ + 10 µF low-pass filter strips motor PWM commutation noise.
  3. Power Distribution & Star Grounding: The 3S 11.1V 4200 mAh LiPo battery powers the motor driver directly. The SmartElex MP1584 buck converter supplies regulated 5.0V to logic power. All grounds converge at a star-point ground to prevent motor inductive noise from coupling into the analog sensors.
SubsystemComponent InterfaceMicrocontroller PinSignal Description
Vibration SensorPZ1 (Suction) Conditioning NodePin A0 (Zephyr Ch 9)High-speed 50 kHz Suction Vibration Input
Vibration SensorPZ2 (Discharge) Conditioning NodePin A1 (Zephyr Ch 10)High-speed 50 kHz Discharge Vibration Input
Current SensorShunt RC Low-Pass Filter OutPin A2 (Zephyr Ch 11)Motor Armature Current Load Signature
Motor ControlCytron MDD3A M1APin A4 (PWM)Motor Forward / Speed Modulation Output
Motor ControlCytron MDD3A M1BPin A5 (PWM)Direction / Low-side Return Output
Power InputMP1584 Buck Converter Out5V & GNDRegulated 5.0V Logic Power Rail

Testing & Results

Step-by-Step Validation Protocol:

  1. Nominal Baseline Operation: The suction valve was fully opened (100% flow). The pump drew 9.5 A at 3,594 RPM. Vibration remained below 0.45 gRMS, and the Cavitation Risk Index registered a healthy 11%.
  2. Inducing Suction Starvation: The intake ball valve was gradually throttled, decreasing the Net Positive Suction Head Available (NPSHa) below NPSHr.
  3. Incipient Cavitation Detection: High-pitched crackling erupted, and the live FFT spectrum registered an immediate +18 dB energy surge in the 8–20 kHz band. Within 100 ms, the Random Forest model flagged Partial Cavitation, pushing the Risk Index to 68%. Under complete constriction, the system registered Severe Cavitation (>85%).
  4. Autonomous Adaptive Suppression: When Auto-Protection mode was activated, the closed-loop controller automatically dialed back the PWM duty cycle from 100% to 75% and then 60%. Lowering impeller speed raised local pressure above vapour pressure. Cavitation stopped instantly, vibration subsided to baseline (0.38 gRMS), and steady water discharge was maintained without damaging the pump.

State Progression During Physical Testing:

[Valve 100% Open] ─────────► [Healthy Flow: Risk Index 11%] ──► [Maintain 100% Throttle]

                                    │

                                    ▼ (Suction Throttled)

[8–20 kHz Acoustic Surge] ──► [Partial Cavitation Flagged: Risk Index 68%]

                                    │

                                    ▼

[Adaptive Controller Engages] ──► [PWM Trimmed to 75% -> 60%]

                                    │

                                    ▼

[Vapour Cavities Suppressed] ──► [Sensor Signatures Normalize: Risk Index < 25%]

                                    │

                                    ▼

[Stable Safe Water Delivery Maintained Without Pump Shutdown or Impeller Damage]

Full Experimental Hydraulic Testing video: click here

Source Code & Repository

The complete open-source project codebase, firmware, KiCad schematics, datasets, and machine learning pipelines are available in the public repository:

GitHub Repository: click here

Declaration

We confirm that this is our original work, developed by Team ElectroDynamix from the Manipal Institute of Technology (MAHE), Manipal. All team members have reviewed and approved this project submission.


SHARE YOUR THOUGHTS & COMMENTS