Building Anupraan: Our AI-Powered Health Monitoring System
Building Anupraan: Our AI-Powered Health Monitoring System#
Posted on January 15, 2024
Anupraan represents our most ambitious project yet - combining IoT sensors, machine learning, and healthcare technology into a comprehensive health monitoring solution. This post covers our journey from concept to working prototype.
The Vision#
We wanted to build something that could genuinely improve people’s lives. Traditional health monitoring is reactive - you only know something’s wrong after it happens. Anupraan aims to be proactive, using AI to detect patterns and provide early warnings.
Hardware Design#
Sensor Selection#
After extensive research, we chose these sensors for their accuracy and reliability:
- MAX30100: Pulse oximeter and heart rate sensor
- MLX90614: Infrared temperature sensor (non-contact)
- MPU6050: Accelerometer for movement and fall detection
- ESP32: Dual-core microcontroller with WiFi/Bluetooth
PCB Design#
We designed a custom PCB to integrate all sensors cleanly:
# Main board layout
ESP32-WROOM-32 (center)
├── MAX30100 (top-left)
├── MLX90614 (top-right)
├── MPU6050 (bottom-left)
└── Power management (bottom-right)
The board includes proper filtering, voltage regulation, and EMI shielding for medical-grade reliability.
Software Architecture#
Edge Processing Pipeline#
class HealthMonitor:
def __init__(self):
self.sensors = {
'heart_rate': MAX30100(),
'temperature': MLX90614(),
'movement': MPU6050()
}
self.ml_model = AnomalyDetector()
def collect_data(self):
readings = {}
for name, sensor in self.sensors.items():
readings[name] = sensor.read()
return readings
def analyze(self, data):
# Local ML inference
anomaly_score = self.ml_model.predict(data)
if anomaly_score > THRESHOLD:
self.trigger_alert(data, anomaly_score)
return anomaly_score
Machine Learning Model#
We trained a lightweight anomaly detection model using TensorFlow Lite:
# Model architecture
model = Sequential([
LSTM(64, input_shape=(timesteps, features)),
Dropout(0.2),
Dense(32, activation='relu'),
Dense(1, activation='sigmoid')
])
# Training data: 10,000+ hours of normal vital signs
# Anomaly detection using One-Class SVM approach
Calibration & Validation#
Sensor Calibration#
Each sensor requires careful calibration:
def calibrate_max30100():
"""Calibrate pulse oximeter using known reference values"""
reference_values = [95, 98, 100] # SpO2 percentages
measured_values = []
for ref in reference_values:
# Use calibration device
measured = sensor.read_spo2()
measured_values.append(measured)
# Calculate calibration coefficients
calibration_factor = np.mean(reference_values) / np.mean(measured_values)
return calibration_factor
Clinical Validation#
We’re working with healthcare professionals to validate our measurements against medical-grade equipment. Initial results show 95%+ accuracy for heart rate and 90%+ for SpO2.
Power Management#
Sleep Modes#
void enter_sleep_mode() {
// Deep sleep for 30 seconds
esp_sleep_enable_timer_wakeup(30 * 1000000);
// Keep only essential sensors active
gpio_deep_sleep_hold_en();
// Enter deep sleep
esp_deep_sleep_start();
}
Battery Life Optimization#
- Active mode: 12 hours continuous monitoring
- Sleep mode: 7+ days standby
- Selective sensing: Only activate sensors when needed
Data Privacy & Security#
Local Processing#
All sensitive health data is processed locally on the ESP32. Only anonymized, aggregated data is sent to the cloud (with user consent).
Encryption#
from cryptography.fernet import Fernet
def encrypt_health_data(data):
key = Fernet.generate_key()
cipher = Fernet(key)
encrypted_data = cipher.encrypt(json.dumps(data).encode())
return encrypted_data, key
Current Challenges#
1. Sensor Drift#
Over time, sensor readings can drift. We’re implementing auto-calibration using known good values.
2. Battery Life#
Continuous monitoring is power-hungry. We’re exploring energy harvesting from body heat and movement.
3. Regulatory Compliance#
Medical devices require FDA approval. We’re consulting with regulatory experts to navigate this process.
What’s Working#
- ✅ Sensor integration and basic readings
- ✅ Local ML inference (95% accuracy)
- ✅ Power management (7+ days battery)
- ✅ Data encryption and privacy controls
- ✅ Real-time anomaly detection
What’s Next#
- Mobile App: React Native companion app for data visualization
- Cloud Backend: FastAPI server with PostgreSQL database
- Clinical Trials: Partner with healthcare providers for validation
- Regulatory: Begin FDA approval process
Lessons Learned#
- Medical-grade accuracy is hard - consumer sensors need extensive calibration
- Privacy is paramount - health data security can’t be compromised
- Battery life matters - users won’t charge devices daily
- Validation takes time - clinical testing is essential for health tech
Get Involved#
Anupraan is open source! We’re looking for contributors in:
- Embedded systems and IoT
- Machine learning and data science
- Mobile app development
- Healthcare and medical expertise
- Regulatory compliance
Check out our GitHub repository and join our Discord community.
Questions about the build? Want to contribute? Get in touch or join our development discussions.