Why Run AI Inside the Meter?
Traditional ultrasonic meters measure, store and transmit. The intelligence lives in back-end systems: the head-end server processes readings, a data lake runs analytics, and alarms are generated days or weeks after the event. For time-critical conditions — a burst pipe, a tamper attempt, a failing transducer — this latency is unacceptable.
Edge AI shifts the intelligence to the device itself. The AI inference engine runs on the same MCU that already drives the ultrasonic transducers, consuming less than 1 mW of additional power. The result: decisions happen in microseconds, locally, without sending a single byte to the cloud.
Core principle: The ultrasonic module already captures a continuous, high-resolution acoustic waveform. Every event in the pipe — a bubble, a crack, a flow anomaly, a calibration drift — leaves a distinctive signature in that signal. Edge AI reads those signatures in real time.
The Raw Data Available Inside the Module
Before listing what AI can analyse, it helps to understand what data the module actually captures. Most utility meters discard 99% of this information and transmit only the final volume reading. Edge AI uses all of it.
- Full ultrasonic waveform: The complete time-domain signal from each transducer firing — hundreds of sample points per measurement cycle, captured at MHz sampling rates.
- Time-of-Flight (ToF) pair: The precise upstream and downstream transit times, measured to sub-nanosecond resolution.
- Signal amplitude and attenuation: How much the acoustic signal is attenuated as it traverses the fluid — sensitive to bubble content, contamination and pipe fouling.
- Signal-to-noise ratio (SNR): The ratio of signal energy to background noise — degrades with transducer aging, pipe scale buildup or physical damage.
- Frequency spectrum (FFT): The frequency content of the received waveform, which shifts characteristically with pipe material, flow turbulence and acoustic resonances.
- Temperature (PT1000/PT500): Supply and return fluid temperatures, sampled continuously — relevant for heat metering and fluid density correction.
- Flow velocity profile: The time series of instantaneous velocity readings, revealing flow regime, pulsation and consumption patterns over time.
- Differential pressure (optional): In some installations, a co-located pressure sensor adds a further dimension to the acoustic analysis.
The 8 Classes of Edge AI Analysis
Each class below is a category of on-device inference that becomes possible when a trained ML model runs alongside the ultrasonic measurement engine.
01 — Pipe Leak & Burst Detection
Acoustic turbulence from a leak creates distinctive waveform perturbations invisible to simple flow threshold logic. An LSTM or convolutional model trained on labelled leak waveforms detects micro-leaks at flow rates below the meter's Q_min — events a cloud system would never see because the meter wouldn't even report a reading.
02 — Physical & Magnetic Tamper
Magnet attacks on mechanical meters are well-known. Ultrasonic meters are immune to magnetic interference, but physical manipulation — tilting, flow reversal injection, acoustic jamming — all produce specific acoustic signatures. A classifier running on-device flags these events with timestamps and certainty scores in real time, triggering immediate encrypted alarms over NB-IoT or M-Bus.
03 — Acoustic Signal Classification
The received ultrasonic waveform encodes information about the fluid and pipe that goes far beyond flow velocity. A multi-class CNN can simultaneously identify: flow regime (laminar vs turbulent), entrained air or gas bubbles, pipe material (steel, copper, PE, cast iron), internal scale or fouling layer thickness, and presence of solids or particulates — all from the same waveform the meter is already capturing.
04 — Flow Profile & Regime Recognition
Standard ToF meters assume a specific flow profile (typically turbulent, fully developed). In reality, elbows, partially closed valves and short installation runs create distorted profiles that introduce systematic measurement errors. An edge AI model trained on velocity profile patterns applies real-time correction factors, improving accuracy by up to 1.5% in non-ideal installations without any additional hardware.
05 — Transducer Degradation Prediction
Transducer signal amplitude and SNR decay predictably as the coupling layer ages or the piezo element degrades. A regression model tracking SNR trend over time can predict transducer end-of-life 6–12 months in advance, enabling planned maintenance before measurement failure — converting reactive replacement into predictive asset management.
06 — Adaptive Drift Compensation
All measurement systems drift over time. For ultrasonic meters, drift sources include transducer coupling degradation, temperature-induced dimensional changes in the spool piece, and electronic component aging. An on-device Kalman filter or adaptive model continuously tracks these drift components and applies real-time compensation — maintaining measurement accuracy over a 15+ year service life without manual recalibration.
07 — Consumption Pattern & Demand Forecasting
The velocity time series contains rich behavioural information: daily usage patterns, peak demand hours, seasonal trends, anomalous consumption events. A lightweight time-series model running on-device builds a local consumption profile and detects deviations — catching continuous leakage (the "running toilet" signature), abnormal night flow, or sudden consumption spikes that indicate a burst or theft event, all without transmitting raw time-series data.
08 — Demand-Response & Load Forecasting
In district heating, gas distribution and electricity networks, demand-response requires near-real-time consumption data at the meter edge. An on-device forecasting model predicts short-term demand (15-minute ahead) using local consumption history and temperature data. The meter can participate in grid demand-response programmes autonomously — adjusting reporting frequency, pre-computing aggregates and transmitting compact predictions rather than raw readings.
Data Inputs vs Analysis Outputs
The table below maps each raw data input to the analyses it enables and the value it delivers at the system level.
| Raw Input Signal | AI Analysis | Output / Value |
|---|---|---|
| Ultrasonic waveform (time domain) | Leak & turbulence detection, tamper classification, flow regime recognition | Real-time alarm, accuracy correction, theft prevention |
| ToF upstream / downstream pair | Drift compensation, velocity profile correction | Long-term accuracy without recalibration |
| Signal amplitude & SNR | Transducer health monitoring, fouling detection | Predictive maintenance, end-of-life warning 6–12 months ahead |
| Frequency spectrum (FFT) | Pipe material classification, bubble content estimation, resonance detection | Automatic installation commissioning, air purge detection |
| Flow velocity time series | Consumption pattern analysis, micro-leak detection, demand forecasting | Night-flow analysis, demand-response, revenue protection |
| Temperature (PT1000) | Fluid density correction, thermal anomaly detection | Improved heat energy accuracy, district heating optimisation |
| Multi-signal fusion | Holistic pipe health score, combined tamper + leak probability | Single confidence metric per measurement cycle |
Hardware Constraints and Model Architecture
Running machine learning on MCU-class hardware demands radically different model architectures than cloud ML. The inference engine must fit within the memory and compute budget of the host microcontroller — typically an ARM Cortex-M4 or M33 core running at 64–168 MHz with 256–512 KB of SRAM.
Model types used per analysis class
- Convolutional Neural Network (1D-CNN): Waveform classification — leak detection, tamper identification, acoustic signal classification. 1D convolutions over the time-domain signal extract local features efficiently. Typical size: 20–40 KB after INT8 quantisation.
- LSTM / GRU (recurrent): Time-series analysis — consumption pattern learning, transducer degradation tracking. Operates on windows of 100–500 consecutive flow readings. Memory-efficient architectures with hidden state size of 16–32 units.
- Random Forest / Gradient Boosting (quantised): Tabular feature classification — flow regime, pipe material, fouling level. Extremely memory-efficient (2–8 KB) and fast inference. Used when feature engineering replaces raw waveform processing.
- Kalman Filter + ML hybrid: Calibration drift compensation. The Kalman filter provides the state estimation framework; an ML model learns the non-linear drift components that a classical model cannot capture.
- Autoencoder: Unsupervised anomaly detection. Trained only on normal operation data; reconstruction error spikes when an anomalous condition occurs. Requires no labelled anomaly data — trained purely on field readings.
Key design constraint: All models must be quantised to INT8 (8-bit integer weights) to fit within MCU SRAM. This reduces accuracy by 1–3% compared to full-precision FP32 models, which is acceptable for most classification and anomaly detection tasks. For high-precision regression (drift compensation), FP16 or mixed-precision architectures are used where the MCU supports hardware FP16.
Training and Deployment Pipeline
On-device AI does not eliminate the need for cloud infrastructure — it relocates it from the inference path to the training path. Models are trained offline on labelled datasets, then quantised and compiled for the target MCU. Deployment is handled over the normal firmware update path (OTA via NB-IoT or direct M-Bus).
Training data sources
- Lab acoustic datasets: Controlled pipe rig recordings under known conditions — known leak rates, known tamper events, known flow regimes. Forms the labelled foundation for supervised classification models.
- Field deployment data: Anonymised waveform data from deployed meters, used for domain adaptation — adjusting models to real-world pipe conditions that differ from lab recordings.
- Synthetic data augmentation: Acoustic simulation tools generate synthetic waveforms for rare events (burst pipe, extreme tamper) where labelled real-world data is scarce.
- Federated learning (future): In large deployments, models can be updated using gradient aggregates from the field without transmitting raw waveform data — privacy-preserving distributed training.
Deployment lifecycle
- Train and validate model on labelled dataset (Python, TensorFlow / PyTorch)
- Quantise to INT8 using TensorFlow Lite post-training quantisation
- Convert to C array using
xxdor TFLite Micro converter - Compile into firmware image with TFLite Micro runtime (<20 KB)
- Deploy via OTA firmware update — no hardware changes required
- Monitor inference confidence scores in field; retrain when distribution shift detected
Privacy and Security Implications
Running AI at the edge has significant privacy advantages over cloud analytics. Consumption data is among the most sensitive information a utility meter collects — hourly gas or water profiles can reveal occupancy patterns, daily routines and household size with high confidence.
- No raw time-series transmission: Instead of transmitting a 15-minute interval profile, the edge AI transmits only processed outputs — a daily consumption total, an anomaly flag, a maintenance score. The behavioural signal never leaves the device.
- GDPR compliance by architecture: When sensitive inferences happen on-device and only aggregated, non-reversible outputs are communicated, the system is privacy-preserving by design rather than by policy.
- Encrypted alarms: All alarm and event messages from Dualmicro modules are encrypted using AES-128 before transmission, ensuring that tamper events and anomaly flags cannot be read in transit.
- No cloud dependency for critical functions: Leak detection and tamper alarms function regardless of network connectivity. The device is autonomous by design.
Standards alignment: The edge AI architecture in Dualmicro modules is designed to align with the EU's forthcoming requirements under the Energy Efficiency Directive and the Smart Metering Mandate, which increasingly require on-device processing and privacy-by-design for AMI deployments.
Practical Results: What Changes in the Field
Moving from a traditional transmit-and-analyse architecture to edge AI + ultrasonic delivers measurable operational improvements across the utility value chain.
| Metric | Traditional AMR | Edge AI Ultrasonic |
|---|---|---|
| Leak detection latency | Days to weeks (batch analytics) | Microseconds (on-device) |
| Tamper alarm latency | Next read cycle (15 min–24 hr) | <1 second, encrypted NB-IoT push |
| Calibration drift | Undetected until meter exchange | Continuous on-device compensation |
| False alarm rate | High (threshold-based rules) | Low (ML classifier, confidence-weighted) |
| Data volume transmitted | High (interval profiles) | Low (events + aggregates only) |
| Network dependency | Required for all analytics | Optional — edge functions always active |
| Privacy exposure | Raw consumption profiles in cloud | Aggregates only, GDPR by design |
Integrating Edge AI into your metering hardware?
Dualmicro develops ultrasonic metering modules with embedded AI inference from the ground up — hardware design, embedded firmware, model integration and MID certification support. Let's discuss your application.