LabVIEW interfacing is an important part of my HealthGuard project because it allows me to visualize and monitor the collected health data in real time on a computer. The system receives data from the ESP32, including body temperature, heart rate, and SpO₂, ECG and displays the values through a user-friendly graphical interface. LabVIEW also allows me to plot real-time graphs, observe changes in vital signs, and set up alarms to notify users when the measured values exceed predefined limits. This graphical interface makes it easier to understand the collected data, identify unusual changes, and demonstrate the system's functionality. By integrating LabVIEW with the ESP32-based monitoring device, I can create a more interactive and informative monitoring system for educational and prototype applications, while recognizing that clinical use requires appropriate medical validation.
To interface the ESP32 with LabVIEW, I used the VISA (Virtual Instrument Software Architecture) protocol to establish serial communication between the hardware and the graphical user interface. The ESP32 transmits the collected health data to LabVIEW through a serial connection at a baud rate of 9600 bps. LabVIEW receives and processes the incoming data, separates the individual values (using Scan from String block), and displays them through a user-friendly monitoring interface. Body temperature, heart rate, and SpO₂ levels are presented using both numerical indicators and meter indicators, allowing users to read the exact measurements and quickly understand the current status of each parameter. In addition, the ECG data is plotted on a real-time chart, making it possible to observe changes in the electrical activity of the heart as the data arrives from the ESP32.
The complete LabVIEW interfacing and visualization setup is shown in the screenshot below. I did not use LabView before, so it took too much time for me to make it working. The LabView official documentation was very helpful and I also watched some YouTube tutorials on it. My overall experience with LabVIEW is really good.

The block for my primary LabVIEW interface is shown below.

But this is a draft interface; I am going to make it complete and show the full interface in my final project documentation. Without the actual sensor, I just generate random data from the ESP32, convert the data to a string, and send it to the Computer using the Serial.print() function.
ESP32 Demo Code is given below:
#include <math.h>
// Put these global variables OUTSIDE setup() and loop()
float ecgPhase = 0.0;
float phaseStep = 0.005;
float baselineDrift = 0.0;
float noiseState = 0.0;
float generateECG() {
// Approximately 1-second heartbeat cycle
ecgPhase += phaseStep;
if (ecgPhase >= 1.0) {
ecgPhase -= 1.0;
// Slight beat-to-beat variation
phaseStep = 0.005 + random(-3, 4) * 0.00001;
}
float t = ecgPhase;
// P wave
float p = 18.0 * exp(-pow((t - 0.17) / 0.035, 2));
// QRS complex with slightly distorted peaks
float q = -28.0 * exp(-pow((t - 0.385) / 0.014, 2));
float r = random(165, 221) *
exp(-pow((t - 0.405) / 0.012, 2));
float s = -65.0 * exp(-pow((t - 0.435) / 0.022, 2));
// T wave
float tw = 48.0 * exp(-pow((t - 0.68) / 0.075, 2));
// Slow baseline movement
baselineDrift = 12.0 * sin(2.0 * PI * t * 1.2)
+ 5.0 * sin(2.0 * PI * t * 0.4);
// Random high-frequency noise
float muscleNoise = random(-9, 10);
// Mild 50 Hz mains interference (simulated)
static int noiseSample = 0;
float mainsNoise = 3.0 * sin(noiseSample * 1.5708);
noiseSample++;
// Occasional small electrode/contact disturbance
float contactNoise = 0;
if (random(0, 100) < 3) {
contactNoise = random(-18, 19);
}
float ecg = 512.0 + p + q + r + s + tw
+ baselineDrift + muscleNoise
+ mainsNoise + contactNoise;
return constrain((int)ecg, 0, 1023);
}
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// One simulated heartbeat, sampled over time
float temperature = random(3600, 3789) / 100.0; // 20.00–40.00
int value2 = random(70, 80); // 50–100
int value3 = random(96, 99); // 30–80
int ecgValue = generateECG();
String dataString = String(temperature, 2) + "," +
String(value2) + "," +
String(value3) + "," +
String(ecgValue);
Serial.println(dataString);
delay(10);
}
I also recorded my screen while LabVIEW was receiving data from ESP32 board.