- System Overview
- Scientific Background
- Hardware Implementation
- Software Architecture
- Data Processing
- Visualization System
- System Flow
- Mathematical Formulations
- Mermaid Diagrams
- References
PulseMind is an integrated Galvanic Skin Response (GSR) monitoring system that combines:
- ESP32-based hardware sensor
- GitHub-based data storage
- Web-based visualization dashboard
The system measures electrodermal activity (EDA) as an indicator of sympathetic nervous system arousal, which correlates with psychological stress levels.
GSR measures changes in skin conductance (SC) with two components:
- Skin Conductance Level (SCL): Tonic baseline level (0.05-20 μS)
- Skin Conductance Response (SCR): Phasic responses to stimuli (>0.05 μS)
Key physiological relationships:
- Sweat gland activity ∝ Skin conductance
- Sympathetic arousal ∝ Sweat production
- Stress level ∝ SCL magnitude
Based on Boucsein (2012) and Dawson et al. (2011), we classify stress levels:
| Conductance (μS) | Stress Level | Physiological State |
|---|---|---|
| <2.0 | Relaxed | Parasympathetic dominance |
| 2.0-5.0 | Normal | Balanced autonomic tone |
| 5.0-10.0 | Stressed | Moderate sympathetic arousal |
| >10.0 | High Stress | Strong sympathetic activation |
graph LR
A[Finger Electrodes] --> B[Voltage Divider]
B --> C[ESP32 ADC Pin 34]
C --> D[3.3V Regulator]
D --> E[WiFi Module]
Key parameters:
- Electrode voltage: 3.3V DC
- Series resistance: 1MΩ
- ADC resolution: 12-bit (0-4095)
- Sampling rate: 10Hz (100ms interval)
-
Raw ADC reading (0-4095)
-
Voltage conversion:
V = (ADC × 3.3) / 4095 -
Conductance calculation:
G = (V / R) × 10^6 [μS]Where R = 1MΩ (constant)
-
Moving average filter (window size=5):
G_filtered = Σ(G_i...G_i+4) / 5
classDiagram
class GSRMonitor {
+float edaBuffer[5]
+String fileSHA
+void connectWiFi()
+void calibrateGSR()
+float readGSR()
+String getCurrentSHA()
+void uploadData(float conductance)
+String getSCLStatus(float conductance)
}
class WiFiManager {
+const char* ssid
+const char* password
+void reconnect()
}
class GitHubClient {
+const char* token
+const char* repo
+String getSHA()
+void updateFile()
}
GSRMonitor --> WiFiManager
GSRMonitor --> GitHubClient
Key components:
- WiFi Connectivity: Manages network connection with automatic reconnection
- GSR Sensor: Handles calibration and data acquisition
- GitHub API Client: Manages data storage in repository
sequenceDiagram
participant Sensor
participant ESP32
participant GitHub
participant Dashboard
loop Every 30 seconds
Sensor->>ESP32: Analog Reading
ESP32->>ESP32: Convert to μS
ESP32->>ESP32: Apply Filter
ESP32->>GitHub: GET SHA
GitHub-->>ESP32: Current SHA
ESP32->>GitHub: PUT New Data
GitHub->>Dashboard: Data Update
Dashboard->>Dashboard: Visualize
end
- 30-second baseline measurement (300 samples)
- Calculate mean baseline conductance:
G_baseline = (Σ(V_i)/n) × (10^6/R) - Adaptive thresholds:
G_relaxed = 0.5 × G_baseline G_stressed = 2.5 × G_baseline
- Moving average filter:
window = [G1, G2, G3, G4, G5] G_filtered = sum(window) / len(window)
- Outlier rejection (3σ principle):
if |G_i - μ| > 3σ: discard sample
flowchart TB
subgraph Web Dashboard
A[Data Fetcher] --> B[Chart Renderer]
A --> C[Status Indicator]
A --> D[Trend Analyzer]
B --> E[GSR Time Series]
C --> F[Stress Meter]
D --> G[Forecast Model]
end
subgraph Data Source
H[GitHub JSON] --> A
end
Key components:
- Real-time GSR chart (Chart.js)
- Stress level classification
- Historical trend analysis
- Predictive forecasting
stress_level =
if G < 2.0: (G/2.0)×25
elif G < 5.0: 25 + ((G-2.0)/3.0)×25
elif G < 10.0: 50 + ((G-5.0)/5.0)×25
else: 75 + ((G-10.0)/10.0)×25
journey
title PulseMind System Workflow
section Hardware
ESP32 Boot: 5: ESP32
WiFi Connect: 3: ESP32
Sensor Calibrate: 8: ESP32
Data Acquisition: 15: ESP32
section Software
Data Processing: 10: ESP32
GitHub Sync: 7: Cloud
section Visualization
Data Fetch: 5: Dashboard
Real-time Update: 20: Dashboard
User Feedback: 15: User
-
Conductance Conversion:
G(t) = (V(t) × 10^6) / RWhere:
- V(t) = Measured voltage at time t
- R = Fixed 1MΩ resistance
-
Moving Average:
Ḡ(t) = 1/N Σ G(t-i) for i=0 to N-1(N=5 in implementation)
-
Stress Score:
S(t) = 100 × (G(t) - G_min)/(G_max - G_min)Where:
- G_min = 1.0 μS
- G_max = 20.0 μS
-
Recovery Rate:
R = (T_recovery / T_total) × 100%Where:
- T_recovery = Time spent below baseline
- T_total = Total observation time
graph TD
A[GSR Sensor] --> B[ESP32]
B --> C[WiFi]
C --> D[GitHub API]
D --> E[Web Dashboard]
E --> F[User]
F -->|Feedback| A
flowchart LR
A[Raw ADC] --> B[Voltage Conversion]
B --> C[Conductance Calc]
C --> D[Filtering]
D --> E[Classification]
E --> F[Storage]
F --> G[Visualization]
- Boucsein, W. (2012). Electrodermal Activity. Springer Science.
- Dawson, M. E., et al. (2011). The electrodermal system. Handbook of Psychophysiology.
- Lykken, D. T., & Venables, P. H. (1971). Direct measurement of skin conductance. Psychophysiology.
This documentation provides a comprehensive technical overview of the PulseMind system, from physiological principles to implementation details. The system demonstrates how physiological signals can be captured, processed, and visualized to provide meaningful stress monitoring.