A smart health monitoring system for early cramp detection using EMG, temperature, and oxygen saturation analysis.
This project implements a non-invasive muscle cramp detection system by integrating biomedical sensors, IoT, and machine learning techniques. The system continuously monitors EMG signals, skin temperature, and tissue oxygen saturation (StO₂), processes the data using MATLAB on ThingSpeak, and provides real-time alerts.
- EMG Sensor: Captures muscle activity.
- IR Temperature Sensor: Measures skin temperature.
- Photodiode + Linear Regression: Estimates StO₂ by calculating IR intensity ratio (hardcoded values).
- The EMG signal undergoes noise filtering using an analog front-end circuit.
- The StO₂ value is derived using a hardcoded linear regression model.
- The ESP32 microcontroller sends real-time EMG, temperature, and StO₂ data to ThingSpeak IoT platform.
- MATLAB scripts on ThingSpeak process the signals and determine cramp probability.
- If a cramp is detected, the ESP32 triggers a buzzer and displays the cramp ratio on an LCD screen.
graph TD;
A[EMG Sensor] -->|Analog Filtering| B[ESP32]
C[IR Temp Sensor] --> B
D[Photodiode] -->|Linear Regression| B
B -->|Wi-Fi| E[ThingSpeak IoT]
E -->|MATLAB Analysis| F[Cramp Detection]
F -->|Result| G[ESP32]
G -->|Cramp Detected?| H{Yes/No}
H --Yes--> I[Buzzer Alert & Display]
✔️ EMG Sensor
✔️ IR Temperature Sensor
✔️ Photodiode
✔️ ESP32
✔️ LCD Display
✔️ Buzzer
🔹 Embedded C (ESP32 Firmware)
🔹 MATLAB (Signal Processing on ThingSpeak)
🔹 ThingSpeak IoT Platform (Cloud Analysis)
🔹 LTSpice (Circuit Simulation)
🔹 Linear Regression (StO₂ Estimation)
- Power on the ESP32-based device.
- Wear the EMG and temperature sensors on the target muscle area.
- Data is transmitted to ThingSpeak in real-time.
- MATLAB analysis determines the likelihood of a cramp.
- If cramp detected:
- The buzzer sounds an alert.
- The cramp ratio is displayed on the LCD.
✅ Improve StO₂ accuracy using optimized machine learning models.
✅ Develop a mobile app for real-time cramp monitoring.
✅ Integrate Bluetooth support for offline data analysis.
🔗 ThingSpeak IoT Platform
🔗 ESP32 Documentation