← Back to Projects

Sweat Sodium Monitor

IoT Biosensing • Embedded Systems • Colorimetry • 2025

ESP32 C++ Firmware Optical Sensing REST API 3D Printing Web Dashboard

Project Overview

The Sweat Sodium Monitor is a non-invasive, strip-based colorimetric sensing platform designed to detect sodium levels in human sweat. By integrating a custom photodiode-optical module with the Kubelka-Munk theory, the system eliminates subjective interpretation of test strips, offering automated, quantitative analysis for early detection of electrolyte imbalances.

Who is it for?

For High-Risk Patients

Provides an early warning system for Hyponatremia and Hypernatremia—critical for elderly patients and those with chronic heart or kidney disease—without the pain of needles or blood draws.

For Athletes

Enables real-time hydration tracking. By monitoring sweat sodium loss during intense activity, athletes can prevent muscle cramps and neurological dysfunction caused by severe electrolyte depletion.

The Challenge

Sweat analysis is plagued by environmental interference. Small samples evaporate rapidly, causing falsely high concentration readings. Additionally, ambient light leakage and variable sample volumes often render low-cost colorimetric strips inaccurate outside of controlled lab settings.

The Innovation: Environmental Correction

Unlike standard wearables, this device features Dynamic Environmental Integration. It combines sodium colorimetry with live temperature and humidity sensing to mathematically correct for evaporation effects in real-time. The system uses the Kubelka-Munk equation to translate raw light reflectance ($R$) into precise concentration values ($K/S$), bridging the gap between paper strips and digital precision.

Technical Architecture

The solution is a Multi-Modal Biosensing Platform built on three pillars:

  • Optical Front-End: A custom 3D-printed enclosure housing a BPW34 Photodiode and multi-spectrum LEDs (Red/Green/Blue) to measure strip reflectance.
  • Processing Unit (ESP32): Handles signal digitization, runs the calibration algorithms, and manages non-blocking Wi-Fi auto-reconnection.
  • Wireless Dashboard: A lightweight web server hosted directly on the ESP32 serves a real-time UI, communicating via a REST API (/api/sensors) for live charting.

System Performance

1.0s

Real-Time Latency

90%

Simulation Accuracy

3-Band

Optical Analysis

Development Stack

The system leverages C++ for ESP32 firmware, HTML/JS for the embedded web interface, and Python for validating the Kubelka-Munk simulation models. The enclosure was designed in CAD and fabricated using PLA (Polylactic Acid).

Future Roadmap

  • Hybrid Sensing: Integrating electrochemical sensors for multi-biomarker detection (Glucose + Sodium).
  • Machine Learning: Implementing on-device ML to predict dehydration risks based on personal historical data.
  • Miniaturization: Moving from the prototype enclosure to a wearable patch form factor.