Open source, battery powered, stand-off acoustic water leak detection

Aug 22, 2022

Project update 4 of 11

AquaPing Design: Signal Filtering and Power Management

by Mike H

This update briefly reviews multi-tiered frequency filtering of the AquaPing. The sensor targets acoustics in a narrow frequency range centered at ~9 kHz. Removing low frequencies is crucial for obtaining an acceptable signal-to-noise ratio. It also makes eavesdropping on conversations physically impossible.

An important design goal is to maintain the sensor in a low-power, "sleep" state for as long as possible. This will maximize battery life for remote IoT applications. Texas Instruments’ MSP430 microcontroller product line is well known for exceptional low-power performance.


A design challenge when listening for small leaks is separating signals from the ambient background. This is essential to prevent false triggers and reduce the likelihood of false alarms. Leaks are sufficiently broadband that discernible acoustic energy is present at frequencies above 6 kHz. AquaPing uses a combination of filtering techniques (mechanical, analog electronic, digital) to attenuate low frequencies.

Mechanical filtering is implemented with a miniature Helmholtz resonator which is formed by a small, plastic, rectangular chamber glued above the board-mounted, Knowles SiSonic MEMS microphone (see figure). It works on the same principle as a wind instrument or referee’s whistle. The center frequency is around 9 kHz with Q ~ 30. Testing shows the resonator roughly doubles the sensitivity.

MEMS microphones are less expensive and smaller than conventional through-hole electrets, have better high frequency response, and are suitable for pick-and-place assembly and reflow soldering. They are found in all cellphones.

The microphone signal is amplified 40 dB and sent to a 2-stage, 4th-order Sallen-Key high-pass filter with 3 dB cutoff at ~ 8 kHz. This is followed by a 23 dB post-filter gain stage. Natural rolloff at high frequencies makes bandpass filtering unnecessary; all filter poles are placed on the low frequency side of the cutoff frequency to sharpen the response.

After the electronically filtered signal leaves the analog front-end, a 12-bit ADC in the MCU collects 256 sample points at 33.3 kS/s, corresponding to a 7.68 ms duration temporal acquisition. The data is checked for ADC saturation and tagged as noisy if necessary. If no saturation has occurred, the MCU performs an FFT of the time data using a uniform window, as appropriate for broadband white noise. The spectral data is rendered as an array of complex numbers separated by 130.2 Hz frequency steps. A 34 point subset in the range 7–11.5 kHz is selected. The spectral energy at each frequency step is calculated and then summed to provide the total acoustic energy in the frequency window. This sum represents one point in an accumulated data set that is analyzed statistically by the MCU. This analysis will be discussed in the next update (or you can read about it now in the User Manual).

Note that digital filtering alone is inadequate. Without prior signal conditioning by mechanical and electronic filtering, there is increased risk of ADC saturation from ambient acoustics.

How long will the batteries last?

The AquaPing is designed for deployment as a battery-powered remote IoT node. Great care has been taken to minimize energy consumption. A working assumption is that leaks are persistent, which means the sensor should not be acquiring signals continuously as for example, in an always-on voice recognition system. Sub-Hz polling rates are entirely sufficient to identify small water leaks, allowing the system to sleep for the vast majority of the duty cycle. In the lower power state, the CPU is off; only the 32.768 kHz internal clock is running to time the polling interval.

When the sensor wakes up, the microphone and filtering/amplification electronics are powered on. A short delay allows turn-on transients to settle. The ADC acquires an ~8 ms audio sample, the required signal processing takes place, and the device re-enters sleep mode. Total current draw when sleeping is estimated to be < 4 µA. In active mode with the LEDs disabled, the momentary peak current is measured to be ~3.2 mA so that each acoustic sampling event consumes about 140 µJ. Depending on the user-selectable polling rate and the stability of the acoustic environment, the AquaPing is expected to operate continuously for multiple years on two AAA batteries. This analysis does not consider the power requirements of the I2C master/controller and/or any wireless hardware.

What about leak triangulation?

Considerable experimentation has been done to determine whether an acoustic leak detection scheme can not only identify the presence of a leak, but also point to its location. The idea is to introduce directivity with multiple, orthogonal inputs as shown in the following conceptual sketch:

Off-axis parabolic reflectors were used to focus sound on an array of PCB-mounted microphones. Because the frequencies of interest are in the range 8—12 kHz, the reflector only needs to have a collection aperture of a few centimeters diameter, which is the approximate acoustic wavelength. This makes for a reasonably compact design.

A small parabolic collector was found to extend the stand-off detection distance as expected, but leak triangulation proved to be problematic. The issue is reflections from various planar surfaces (walls, ceilings, floors, etc) that can cause a single, localized sound source to impinge on the sensor from different directions. Although this may be somewhat mitigated by clever signal processing, it was decided that this functionality was not worth the expense and complexity of additional hardware. Once a leak is known to be present somewhere in the vicinity of the sensor, observation of damp spots or puddles should quickly lead to its source.

In the present AquaPing design, the MEMS microphone and Helmholtz resonator provide some sound collection directivity. The PCB can be oriented for this purpose, but the user must be aware of possible complications from echoes.

Campaign has hit its funding target

The AquaPing project has reached its funding goal at Crowd Supply. The contract manufacturing process will start when funds are released at the conclusion of the campaign in September 2022. We are well aware that transitioning to production is much, much harder than building prototypes, but we will work hard to make it a success. We appreciate the interest and confidence of all the backers. Thanks for your support!

Questions and comments on any aspect of the design or possible applications are most welcome. Send direct to me using the link below.

Sign up to receive future updates for AquaPing.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects