← Back to Projects

02 — IoT Healthcare System

LEAP VITAL CARE

IoT-Based Real-Time Patient Monitoring & Emergency Alert System

Active — v1.0.0 Jan 2026 Release IoT + Web

A comprehensive healthcare monitoring platform integrating ESP32 microcontroller sensors with a Flask backend and responsive web interfaces to enable continuous patient vital sign tracking, GPS location monitoring, and emergency alert capabilities for healthcare providers and caregivers.

ESP32 Flask Python Chart.js HTML / CSS / JS ngrok Google Maps API IoT
↗ View on GitHub System Architecture API Docs

What LEAP VITAL CARE does

LEAP VITAL CARE addresses the critical need for remote patient monitoring by combining edge computing (ESP32), backend processing (Flask), and secure remote access (ngrok) into a complete healthcare monitoring solution.

The system enables real-time vital sign tracking, emergency response capabilities, and location-based services for patient safety — deployable in homes, clinics, or assisted living facilities.

👵
Remote Patient Monitoring

Continuous vital sign tracking for elderly care, post-operative patients, and chronic disease management.

🚨
Emergency Response

Instant alerts with GPS location tracking for wandering patients and direct caregiver communication.

📊
Healthcare Provider Tools

Multi-patient dashboard, historical chart analysis, alert management, and geographic patient tracking.

🗺️
GPS Location Services

Coordinates transmitted every 30 seconds via Geolocation API and shown on Google Maps in real time.

Three-tier system design

Hardware sensors connect through a Python Flask backend to dual web interfaces — one for medical staff with full monitoring controls, one for patients with emergency tools.

Hardware Layer
ESP32 Development Board
🌡 Temperature Sensor ❤️ Heart Rate BPM 👆 Touch Sensor 📶 WiFi Module
HTTP / JSON over WiFi
Application Layer
Flask Backend — localhost:8000
/api/data /api/usr/status /api/usr/location CORS + ngrok
ngrok HTTPS Tunnel
Presentation Layer
Web Interfaces
🖥 Admin Dashboard 📱 Patient Interface Chart.js Google Maps

Admin & Patient views

Two purpose-built interfaces serve different users with tailored controls and information density.

Admin Dashboard
  • Real-time temperature & BPM trend charts (last 20 readings)
  • 2-second automatic data refresh
  • Embedded Google Maps with 10-second GPS refresh
  • DISTRESS vs HELP two-tier emergency alerts
  • Audio notification + popup on alert trigger
  • Alert acknowledgment and patient location context
  • Patient registration, login & profile management
Patient Interface
  • Current temperature & heart rate display
  • 5-second automatic vital sign refresh
  • Yellow DISTRESS button — non-critical assistance
  • Red REQUEST HELP button — critical emergency
  • Confirmation dialogs prevent accidental triggers
  • Auto GPS transmission every 30 seconds
  • Mobile-first, touch-optimised, accessibility-focused

Emergency alert sequence

When a patient triggers an alert, data flows from the patient interface through Flask to the admin dashboard in under 5 seconds.

1

Patient presses DISTRESS or HELP — a confirmation dialog prevents accidental activation.

2

Browser POSTs to /api/usr/status — Flask stores the emergency state in memory immediately.

3

Admin dashboard detects the alert — polling runs every 5 seconds and picks up the new state.

4

Audio-visual popup notification fires — alert type and patient context are clearly displayed to the caregiver.

5

Patient GPS retrieved and shown on map — admin views the exact location and can respond immediately.

Backend endpoints

🖼 View Screenshots

Three REST endpoints consumed by both interfaces over an ngrok HTTPS tunnel with CORS headers enabled.

GET /api/data

Retrieve current vital signs from ESP32. Returns cached values if sensor is unreachable. Polled every 2 s by admin, every 5 s by patient interface.

// Response { "temperature": 36.5, "bpm": 72 }
POST /api/usr/status

Send or receive emergency alert status. Used by patient to trigger and by admin to poll.

// Request { "distress": true, "help": false } // Response { "status": "received", "distress": true }
POST /api/usr/location

Update patient GPS coordinates. Auto-sent by patient interface every 30 seconds via the Geolocation API.

// Request { "latitude": 12.853794, "longitude": 80.175039 } // Response { "status": "location_updated" }

System in action

All 11 screenshots across the admin dashboard, patient interface, emergency alerts, GPS tracking, and backend.

AI Report on User Vitals — Desktop
Vitals Report — Desktop Admin
AI Report on User Vitals — Mobile
Vitals Report — Mobile Admin
Caretaker Login
Caretaker Login Admin
Caretaker Sign Up
Caretaker Sign Up Admin
Flask Server Running
Flask Server Backend
ngrok Tunnel
ngrok Tunnel Backend
Patient Side App
Patient App Patient
Patient Sign Up
Patient Sign Up Patient
Real-Time Data View and Graph
Real-Time Vitals Graph Admin
Real-Time Location
Real-Time Location Map
Request Help — Patient Side
Request Help Alert

What you need to build it

🔌
Microcontroller
  • ESP32-WROOM-32 or equivalent
  • Dual-core Xtensa 32-bit CPU
  • WiFi 802.11 b/g/n
  • 520 KB SRAM / 4 MB Flash
  • USB cable for programming
🌡
Sensors
  • DS18B20 / DHT11 (temperature)
  • MAX30100 / MAX30102 (heart rate)
  • Capacitive touch or button
  • Optional: ESP32-CAM module
  • Breadboard & jumper wires
🌐
Network
  • 2.4 GHz WiFi router
  • Stable internet for ngrok
  • ngrok free tier account
  • HTTPS tunnel required
💻
Software
  • Python 3.7+
  • Arduino IDE 1.8.10+
  • flask ≥ 2.0.0
  • flask-cors ≥ 3.0.10
  • requests ≥ 2.26.0

Getting the server running

1
Clone the repository
Download the project from GitHub to your local machine.
2
Install Python dependencies
Run pip install -r requirements.txt to set up Flask, CORS, and requests.
3
Flash ESP32 firmware
Open sensor_readings.ino in Arduino IDE, set your WiFi credentials, and upload to board.
4
Start Flask server
Run python flask_server_fixed.py — server starts on port 8000.
5
Launch ngrok tunnel
Run ngrok http 8000, copy the HTTPS URL, and paste it into both HTML files.
# Install dependencies pip install flask flask-cors requests # Start Flask server python flask_server_fixed.py # In a new terminal — expose via ngrok ngrok http 8000

Planned enhancements

Version 1.0.0 is a working prototype. These features are planned for upcoming releases.

🗄️
Database Integration
  • PostgreSQL or MongoDB
  • Historical data analysis
  • CSV / PDF data export
  • Patient record management
📡
Enhanced Monitoring
  • SpO2 & blood pressure
  • ECG monitoring
  • Fall detection algorithm
  • Sleep pattern analysis
🔐
Security & Compliance
  • End-to-end encryption
  • HIPAA compliance
  • OAuth2 authentication
  • Audit logging
📣
Notifications
  • SMS / Email alerts
  • Mobile push notifications
  • Two-way video calling
  • Auto-dial emergency contacts