ULTRAFLOAT: Intelligent IoT Water Monitor

MAY 2026| Personal Project
ULTRAFLOAT: Intelligent IoT Water Monitor

Overview & Abstract

This project presents **ULTRAFLOAT**, an intelligent, contactless, temperature-compensated water level monitoring and automated pump control system. It is designed to address the fundamental limitations of conventional mechanical float switches, such as binary-only state reporting, mechanical wear, mineral corrosion, and the lack of remote telemetry. ULTRAFLOAT provides continuous, high-precision distance readings and dynamic automation.

System Architecture

ULTRAFLOAT is built using a distributed two-unit hardware architecture, communicating via a single CAT5 cable. The system blocks are structured as follows:

System Architecture

Dynamic Temperature Compensation

Temperature variation is a critical source of systematic error in ultrasonic sensing because the speed of sound in air varies significantly with ambient temperature (from ~340 m/s at 15°C to ~353 m/s at 36°C). This introduces systematic errors of up to 2% if left uncorrected. ULTRAFLOAT eliminates this drift through a real-time dynamic compensation algorithm governed by the relation:

V = 331.3 + 0.606 × T (m/s)

where T is the ambient temperature in degrees Celsius measured by a colocated AHT20 digital sensor at the tank site. This ensures precision down to 2.5 mm across all seasonal temperature changes.

Temperature Compensation Chart

Embedded Hardware & High-Efficiency Custom SMPS

The system utilizes a distributed hardware design divided into two units connected by a single CAT5/RJ45 Ethernet cable which runs both 12V DC power and digital data (I²C and UART):

• **Main Control Unit (MCU):** Houses the ESP32-S3 microcontroller, OLED status display, relay module, status LEDs, and buzzer interface.
• **Remote Sensor Unit (RSU):** Placed at the tank rim, housing the waterproof JSN-SR04M ultrasonic transducer, the AHT20 sensor, and local voltage regulation.

Powering the MCU is a custom-designed **Switched-Mode Power Supply (SMPS)** transforming 240V AC mains to a highly stable 12V DC output, achieving an outstanding **96% conversion efficiency**.

Hardware Schematic

Hardware Schematic

Power Output & Oscilloscope Validation

Oscilloscope testing validated the custom SMPS under load. The output waveform shows a highly stable 12.1V DC output with a peak-to-peak ripple of only **80 mV**, keeping voltage fluctuation well within safe operational limits. This clean power delivery prevents noise-induced spikes and jitter in the downstream sensor readings.

SMPS PCB Layout Custom SMPS PCB Layout
Oscilloscope Output Oscilloscope Validation (80mV Pk-Pk)

Physical Realisation & Installation Phases

The system prototype was constructed on a soldered Veroboard layout, containing all core MCU components. The RSU is housed in a rugged 3D-printed enclosure mounted directly to the rim of the water tank, keeping all sensitive circuitry safe and dry indoors.

Veroboard Assembly Veroboard Assembly
RSU Tank Installation RSU at Water Tank
MCU Ground Station MCU at Ground Station

WebSocket Web Dashboard Interface

ULTRAFLOAT features a single-page web application embedded directly in the ESP32-S3 flash memory as a PROGMEM string. Telemetry is streamed from the MCU to browser instances via a persistent **WebSocket connection**, yielding a refresh latency under **1 second** with zero external cloud dependencies. Users can configure fill limits, set custom calibration offsets, and trigger manual pump overrides.

Desktop Dashboard Desktop Dashboard View
Mobile Dashboard Responsive Mobile View

Firmware Core: Compensated Range Calculation

Ultrafloat_IK.ino
1float calculateCompensatedDistance(float durationUs, float temperatureC) {
2  // V = 331.3 + 0.606 * T (m/s)
3  float speedOfSound = 331.3 + (0.606 * temperatureC);
4
5  // Convert microsecond pulse width to seconds (Time of Flight)
6  float timeSeconds = durationUs / 1000000.0;
7
8  // Distance = (V * t) / 2
9  float distanceMeters = (speedOfSound * timeSeconds) / 2.0;
10
11  // Return distance in centimeters
12  return distanceMeters * 100.0;
13}
← Back to Portfolio