EdgeCare: phase 1 - setup IDE, MCU and BLE - element14 Community
EdgeCare: phase 2 - setup I2C, read MAX30100 and create VI in LabView - element14 Community
EdgeCare will be a Multi-Sensor Metabolic & Autonomic Datalogging Wearable with LabVIEW R&D Analytics.
***********************************************************************************************************************************************************
OBS: at this moment, the sensors sent by element14 to me for this contest are blocked in custom because an issue with my EORI code.
I will continue to work on this project using MAX30100 and DS18B20 temperature sensor.
These sensors will be replaced if the competition package reaches me in time.
***********************************************************************************************************************************************************
In this post I will present the following implementations:
A. Determination of body hydration using the dielectric profile (using GSR, Tau and Temp);
B. Cardiorespiratory efficiency and tissue perfusion (using HR and SpO2);
C. The body's thermoregulatory response (using Temp + GSR);
A. Determination of body hydration using the dielectric profile (using GSR, Tau and Temp);
The circuit used to determine the dielectric profile for skin and to show the hydratation indes on the body can be one of the following solutions:
- a simple one with two resistors;
- with a specialized circuit, like AD5933 or MAX30009 (future implementation/upgrade).
I used first option, with two resistors and two ports from ESP32C6, like in the schematic diagram:

OBS: the circuit used to read the braceled dry electrodes are powered borm an power bank to avoid interferenced induced by the switching power supply and to have a total separation between sensors and PC with Labview.
All the calculation are done in LabView.
Parameter used:
- GSR (Rskin in Kohm) - measure the DC resistance of the skin; It is particularly influenced by surface moisture, perspiration and electrolytes.
- Skin capacity (Cskin) - It reflects the dielectric properties of deep cellular tissue (dermis and living epidermis); It depends directly on the bound and free water within the cells and in the interstitial space.
- Tau (Rskin x Cskin in us) - It measures the response speed to a transient pulse; It measures the rate at which the skin's dielectric capacitance charges and discharges in response to a pulse applied by the ESP32-C6.
The parameters Temp (using DS10B20 one-wire temp sensor with metalic capsule), GSR and Tau (using the bracelet two electrodes) are read by the ESP32C6 (see the photos below) and sent to LabVIEW for processing and display:

Algorithm: the processing is carried out in four main stages in LabVIEW (within the Formula Node):
Step 1: Thermal Compensation (DS18B20 Sensor)
Skin temperature alters electrical resistance through vasodilation/vasoconstriction. To eliminate temperature-induced errors:
| Status | GSR value (Rskin) | Skin capacity Cskin | Fisiologin interpretation |
|---|---|---|---|
| Dehydrated / Dried | Big (> 200 kΩ) | Low (<0.8 nF) | Dry stratum corneum, low cellular volume. |
| Moderate hydratation | Medium (80 - 180 kΩ) | Medium (1.0 - 2.2 nF) | Optimal dermal/epidermal water balance. |
| Hydrated / optimal | Normal-low (50 - 100kΩ) | Big (2.2 - 3.5 nF) | Well-hydrated interstitial tissue. |
| Surface perspiration | Very low (< 40 kΩ) | Rapidly Changing | Excess electrolytes on the surface (surface perspiration, not cellular hydration). |
The function used in Labview for all above calculatiuon is this (in formula node):
// Intrari: gsr, tau, temp
// Iesiri: hydratation_index, c_skin_nF, status_code
if (gsr >= 9999.0 || tau == 0) {
c_skin_nF = 0.0;
hydratation_index = 0.0;
status_code = 0; // Deconectat
} else {
// 1. Compensare termica pentru GSR (Referinta: 33.0 °C, Coeficient: 2% per °C)
float t_ref = 33.0;
float alpha = 0.02;
// Corectam GSR-ul daca temperatura este valida
float gsr_corr = gsr;
if (temp > 25.0 && temp < 42.0) {
gsr_corr = gsr * (1.0 + alpha * (temp - t_ref));
}
// 2. Calcul capacitate dielectrici compensata
c_skin_nF = tau / gsr_corr;
// 3. Scalare Indice de Hidratare (0 - 100%)
float c_min = 0.5; // nF
float c_max = 3.0; // nF
float raw_index = ((c_skin_nF - c_min) / (c_max - c_min)) * 100.0;
if (raw_index < 0.0) raw_index = 0.0;
if (raw_index > 100.0) raw_index = 100.0;
hydratation_index = raw_index;
// 4. Clasificare stare
if (gsr_corr < 40.0) {
status_code = 4; // Transpiratie / Hiperhidroza
} else if (hydratation_index >= 60.0) {
status_code = 3; // Hidratat / Optim
} else if (hydratation_index >= 30.0) {
status_code = 2; // Hidratare Moderata
} else {
status_code = 1; // Deshidratat / Uscat
}
}
Demo:
OBS: The EdgeCare system utilizes the parallel RC equivalent model for epidermal impedance described by Geddes & Baker (1989) and Martinsen & Grimnes (2011).
The determination of the dielectric capacitance (Cskin = Tau / R) and its scaling to derive the hydration index follow the dynamics of electrodermal activity (EDA) variation established by Boucsein (2012),
with a thermal correction using an alpha coefficient of 0.02°C applied in accordance with Wenig & Martinsen (2000).
B. Cardiorespiratory efficiency and tissue perfusion; apnea detection
This module assesses in real time how efficiently the cardiovascular system delivers oxygen to peripheral tissues and how the body reacts to stress or hypoxia.
To achive this, an new parameter is introduced: PI (Tissue Perfusion Index).
How it is working: PI it represents the ratio between the pulsatile alternating component (AC, pulsating arterial blood) and the non-pulsatile continuous component (DC, tissue, bone, static venous blood)
The formula used is this: PI = (AC / DC ) * 100%
Interpretation:
- PI >=1.0% - indicates good tissue perfusion in the finger;
- PI < 0.5% - indicates peripheral vasoconstriction, cold fingers, or a weak signal.
SpO2 and HR are both displayed on the same Waveform Chart with double Y-axes:
- on the left side is displayed HW that monitors variations in ventricular rate (40 --180 BPM), in pink colour;
- on the right side is displayed SpO2 that mMonitors arterial oxygenation levels (70-100\%).
Apnea detection: the algorithm runs inside the Formula Node block in LabVIEW and evaluates the conditions for an episode of obstructive or central sleep apnea.
The algorithm and Labview implementation:
// Intrari: gsr, tau, temp, pi, spo2
// Iesiri: hydratation_index, c_skin_nF, status_code, low_perfusion, cardio_status, apnea_alert
// ==========================================
// 1. EVALUARE PROFIL DIELECTRIC (GSR + TAU)
// ==========================================
if (gsr >= 9999.0 || tau == 0) {
c_skin_nF = 0.0;
hydratation_index = 0.0;
status_code = 0; // Deconectat
} else {
// 1. Compensare termica pentru GSR (Referinta: 33.0 °C, Coeficient: 2% per °C)
float t_ref = 33.0;
float alpha = 0.02;
// Corectam GSR-ul daca temperatura este valida
float gsr_corr = gsr;
if (temp > 25.0 && temp < 42.0) {
gsr_corr = gsr * (1.0 + alpha * (temp - t_ref));
}
// 2. Calcul capacitate dielectrici compensata
c_skin_nF = tau / gsr_corr;
// 3. Scalare Indice de Hidratare (0 - 100%)
float c_min = 0.5; // nF
float c_max = 3.0; // nF
float raw_index = ((c_skin_nF - c_min) / (c_max - c_min)) * 100.0;
if (raw_index < 0.0) raw_index = 0.0;
if (raw_index > 100.0) raw_index = 100.0;
hydratation_index = raw_index;
// 4. Clasificare stare
if (gsr_corr < 40.0) {
status_code = 4; // Transpiratie / Hiperhidroza
} else if (hydratation_index >= 60.0) {
status_code = 3; // Hidratat / Optim
} else if (hydratation_index >= 30.0) {
status_code = 2; // Hidratare Moderata
} else {
status_code = 1; // Deshidratat / Uscat
}
}
// ==========================================
// 2. EVALUARE INDICE DE PERFUZIE (PI)
// ==========================================
int low_perfusion = 0;
if (pi > 0.0 && pi < 0.5) {
low_perfusion = 1; // Vasoconstruc?ie / Degete reci
}
// ==========================================
// 3. STARE CARDIORESPIRATORIE
// ==========================================
// 0: Deconectat | 1: Normal | 2: Hipoxie | 3: Aritmie/Anormal
if (spo2 == 0 || hr == 0) {
cardio_status = 0;
} else if (spo2 >= 95.0 && hr >= 50.0 && hr <= 100.0) {
cardio_status = 1;
} else if (spo2 < 90.0) {
cardio_status = 2;
} else {
cardio_status = 3;
}
// ==========================================
// 4. ALGORITM ALERTA APNEE ÎN SOMN
// Scadere SpO2 <= 92% corelata cu micro-trezire (HR >= 85 BPM)
// ==========================================
int apnea_alert;
if (spo2 > 0 && spo2 <= 92.0 && hr >= 85.0) {
apnea_alert = 1; // Alerta apnee / desaturare
} else {
apnea_alert = 0;
}
Working mechanism:
- Respiratory pause (Apnea): During the cessation of breathing, blood oxygen levels begin to drop progressively;
- Desaturation (SpO_2 <= 92\%): When the SpO_2 level falls below the critical threshold of 92\%, the body enters a state of mild hypoxia;
- Micro-arousal / Sympathetic stress response (HR >= 85 BPM): The brain detects the lack of oxygen and activates the sympathetic nervous system, triggering a sudden increase in heart rate (compensatory tachycardia) to circulate the remaining oxygenated blood more rapidly;
- Signal validation (SpO_2 > 0): Prevents false alarms from triggering when the sensor is removed from the finger (disconnected state).
Demo:OBS: The perfusion index (PI) was evaluated according to the methodology described by Allen [5], while the arterial desaturation thresholds for apnea follow the recommendations of Penzel et al. [7].
C. Detection of febrile conditions or heat shock.
The Temp + GSR (Body Thermoregulatory Response) module complements the EdgeCare biometric system by adding the component of metabolic and autonomic nervous system (ANS) assessment.
If oximetry (HR, SpO_2, PI) measures cardiorespiratory function, the combination Temperature + GSR monitors heat stress and electrodermal reactivity.
The role of parameters:
a. Peripheral/Skin Temperature (Temp):
- Febrile State / Hyperthermia (Temp > 37.5C): The body tries to eliminate excessive heat through peripheral vasodilatation and sweating.
- Heat Shock / Hypothermia / Vasoconstriction (Temp < 35.0C): The body redirects blood from the periphery to the vital organs (fingers become cold, correlated with a massive drop in PI).
b. Galvanic Skin Response (GSR / Electrodermal Conductance)
- The eccrine sweat glands are innervated exclusively by the sympathetic nervous system.
- In case of intense physical exertion, thermal shock, pain or emotional stress, sweat activity increases instantly.
- Water and minerals in sweat remove skin resistance and increase GSR conductance.
Code for this module (this code will be added in Formula node from Labview):
// Detectie Soc Termic sau Stare Febrila
if (temp > 38.0) {
fever_alert = 1; // Indicator Febrăa/ Hipertermie
} else if (temp < 35.0 && pi < 0.5) {
shock_alert = 1; // Indicator Posibil Soc Termic / Hipotermie
} else {
fever_alert = 0;
shock_alert = 0;
}
Demo:
OBS: to simulate fever in "The Body's termoregulatory Response" area I heated the temperature sensor a little above the trigger threshold of the alert.
Bibliography:
- Geddes, L. A., & Baker, L. E. (1989). Principles of Applied Biomedical Instrumentation (3rd ed.). John Wiley & Sons.
- Martinsen, O. G., & Grimnes, S. (2011). Bioimpedance and Bioelectricity Basics (3rd ed.). Academic Press.
- Wenig, P. B., & Martinsen, O. G. (2000). Thermal influence on skin bioimpedance measurements. Annals of Biomedical Engineering, 28(5), 582–588.
- Boucsein, W. (2012). Electrodermal Activity (2nd ed.). Springer Science & Business Media.
- J. Allen, „Photoplethysmography and its application in clinical physiological measurement”, Physiological Measurement, vol. 28, no. 3, pp. R1–R39, 2007.
- MAXIM Integrated, „MAX30100: Pulse Oximeter and Heart-Rate Sensor IC”, Datasheet & Application Notes, Rev. 0, 2014.
- T. Penzel, et al., „The apnea-hypopnea index: history, clinical use, and future potential”, Journal of Clinical Sleep Medicine, 2012.
I will continue here with the implementations...