Arduino & Embedded C/C++

MercuryTank

Smart Tank Level & Volume Monitoring System. Built with advanced signal processing and precise geometric modeling for horizontal cylindrical tanks.

MercuryTank Hardware Setup

System Architecture & Features

Advanced Signal Processing

Eliminates sensor noise via a 7-sample Median Filter and dampens liquid surface ripples using an Exponential Moving Average (EMA) algorithm.

Precise Geometric Modeling

Calculates exact, non-linear volume in horizontal cylinders using the circular segment area formula:

Area = R² · cos&sp;¹((R-h)/R) - (R-h)√(2Rh-h²)

Robust Error Handling

Employs custom clampf and maxf functions to filter out-of-bounds ultrasonic readings, preventing mathematical errors and system crashes.

Real-Time UI & Configuration

Provides live monitoring of height (cm) and fill percentage (%) via an I2C 16x2 LCD display, with easily configurable tank dimensions in the source code.

Technical Specifications