Learn PCB Design

PCB design is a must tool to learn to be Industry ready for every electronics engineer. Learn PCB design online in just 20 days and boost your career. Work as freelancer and earn a high amount daily by spending only 2 hours a day part time. contact on WhatsApp number +917990850788

Full width home advertisement

Electronics

PCB Design

Post Page Advertisement [Top]

AI-assisted non-invasive glucose estimation prototype using ESP32-S3 and optical sensing.

AI-Assisted Non-Invasive Glucose Estimation System Using ESP32-S3 and Multispectral Optical Sensing

System Architecture

The AI-Powered Non-Invasive Glucose Monitoring System is designed as a multi-sensor biomedical sensing platform that combines optical sensing, physiological signal acquisition, temperature compensation, embedded processing, and machine learning-based estimation. Instead of directly measuring glucose from a blood sample, the system analyzes several biological indicators that may correlate with blood glucose levels and then uses an Artificial Intelligence model to estimate glucose trends.

At the heart of the system is the Seeed Studio XIAO ESP32-S3 Sense, which acts as the central processing and communication unit. The ESP32-S3 is responsible for collecting data from all connected sensors, performing signal processing, executing the machine learning inference model, displaying results on the OLED screen, and optionally transmitting data wirelessly to a computer or cloud dashboard.

The first sensing subsystem is the MAX86141 Photoplethysmography (PPG) Sensor. This sensor uses multiple LEDs and a photodetector to measure changes in blood volume beneath the skin. When a user places their finger inside the sensing clip, light emitted by the sensor penetrates the tissue and is partially absorbed by blood vessels. The reflected light is detected and converted into electrical signals that represent pulse waveforms. Parameters such as pulse amplitude, pulse transit characteristics, and waveform morphology can be extracted and later used as input features for machine learning algorithms.

The second sensing subsystem is the AS7341 Multispectral Sensor. Unlike traditional color sensors that only measure red, green, and blue light, the AS7341 captures multiple optical wavelength bands simultaneously. When the finger is illuminated by Near Infrared (NIR) and visible light sources, the spectral sensor measures the intensity of light reflected and transmitted through the tissue. Different biological components such as water, hemoglobin, skin pigments, and tissue structures affect various wavelengths differently. These spectral signatures provide valuable information that can be used by the AI model during glucose estimation.

To improve measurement stability, the system incorporates the MLX90614 Infrared Temperature Sensor. Human skin temperature directly affects blood circulation, tissue optical properties, and sensor readings. By continuously monitoring the finger temperature, the system can compensate for temperature-related variations and improve the consistency of collected data. Temperature information also becomes an additional feature for the machine learning model.

The optical illumination subsystem consists of multiple Near Infrared LEDs operating at 850nm, 940nm, and 1050nm wavelengths. These LEDs are selected because Near Infrared light penetrates deeper into biological tissue than visible light. Different wavelengths interact differently with blood, water content, and tissue composition. During operation, the LEDs illuminate the finger sequentially or in controlled patterns while the spectral and PPG sensors collect synchronized measurements.

All sensor data is routed to the ESP32-S3 through the I²C communication bus. The microcontroller continuously acquires raw optical, spectral, physiological, and temperature measurements. Before these values are used by the AI model, the firmware performs preprocessing operations such as noise filtering, averaging, normalization, and feature extraction. This stage transforms raw sensor outputs into meaningful parameters suitable for machine learning inference.

The machine learning subsystem forms the intelligence layer of the project. During development, thousands of sensor measurements are collected alongside reference glucose readings obtained from a conventional finger-prick glucometer. This dataset is used to train a regression model using Python-based machine learning frameworks such as TensorFlow or Scikit-Learn. Once trained, the model is converted into a lightweight format compatible with the ESP32-S3 and deployed directly into the device firmware. During operation, the embedded model analyzes incoming sensor features and generates an estimated glucose value or trend indicator.

The user interface subsystem consists of a compact OLED display mounted on the device enclosure. The display presents estimated glucose values, confidence indicators, battery status, measurement progress, and trend information. This allows users to view results immediately without requiring a smartphone or external computer.

The power management subsystem is built around a rechargeable Lithium-Ion battery, a TP4056 charging module, and voltage regulation circuitry. The battery-powered design makes the device portable and suitable for wearable or handheld operation. Efficient power management also allows future integration of low-power sensing and sleep modes.

Overall, the system architecture follows a layered approach consisting of Optical Sensing Layer, Physiological Signal Acquisition Layer, Embedded Processing Layer, Machine Learning Layer, User Interface Layer, and Power Management Layer. By combining multiple sensing technologies with embedded AI, the project creates a research-oriented platform for investigating the feasibility of non-invasive glucose estimation using modern biomedical electronics and machine learning techniques.

Block Diagram

Block Diagram Explanation

The block diagram illustrates the complete signal flow of the AI-Powered Non-Invasive Glucose Monitoring System, beginning with the user's finger and ending with the display and remote monitoring dashboard. Each block performs a specific function in the process of acquiring physiological information, processing it intelligently, and presenting an estimated glucose value.

XIAO ESP32-S3 Sense

1. Finger Clip Sensor

The process begins when the user places a finger inside the specially designed sensing clip. This clip serves as the measurement chamber and ensures proper alignment between the finger, optical sensors, and illumination sources. It also blocks external ambient light that could interfere with the measurements. During operation, Near Infrared LEDs illuminate the finger tissue while multiple sensors simultaneously collect physiological and optical information.

2. AS7341 Spectral Sensor

The AS7341 is a multispectral optical sensor capable of measuring light intensity across multiple wavelength bands. As light passes through and reflects from the finger tissue, the spectral sensor captures how different wavelengths are absorbed and scattered. Since biological tissues, blood components, water content, and skin characteristics affect light differently, the spectral sensor provides valuable optical signatures that may correlate with glucose-related physiological changes. These spectral measurements become one of the primary inputs for the machine learning model.

3. MAX86141 PPG Sensor

The MAX86141 functions as the Photoplethysmography (PPG) sensing subsystem. It measures changes in blood volume within the finger by detecting variations in reflected light caused by each heartbeat. The sensor generates pulse waveforms containing information about blood circulation, vascular characteristics, and tissue perfusion. Instead of directly measuring glucose, the PPG sensor provides physiological parameters that can contribute to glucose estimation when combined with other sensing modalities.

4. MLX90614 Temperature Sensor

Human skin temperature significantly influences blood circulation and optical measurements. The MLX90614 infrared temperature sensor continuously monitors the surface temperature of the finger without physical contact. Temperature data is used to compensate for environmental and physiological variations that could otherwise affect measurement accuracy. This additional information improves the reliability of the machine learning prediction process.

5. XIAO ESP32-S3 Sense

The XIAO ESP32-S3 Sense acts as the central controller and processing unit of the system. It receives data from all sensors through the I²C communication interface and manages the entire measurement sequence. The ESP32-S3 synchronizes sensor acquisition, stores incoming data, performs preprocessing operations, controls the OLED display, and executes the machine learning inference model. Because of its powerful dual-core architecture and AI capabilities, it is well suited for embedded biomedical applications.

6. Feature Extraction

Raw sensor outputs cannot be directly used by a machine learning model. Therefore, the ESP32-S3 first performs feature extraction. During this stage, useful characteristics are extracted from the sensor data, such as:

• Spectral intensity values from multiple wavelengths

• Pulse waveform amplitude

• Heart rate information

• Signal variance and statistical parameters

• Temperature readings

• Normalized optical measurements

Feature extraction reduces noise and converts raw sensor signals into meaningful numerical parameters that can be processed more effectively by the AI model.

7. TinyML Model

The extracted features are then supplied to a TinyML-based machine learning model running directly on the ESP32-S3. This model is trained using thousands of previously collected samples that include both sensor measurements and reference glucose values obtained from a conventional glucometer. The TinyML model analyzes the incoming feature set and generates an estimated glucose value or glucose trend prediction. This stage represents the intelligence layer of the system and is responsible for converting physiological data into a meaningful output.

8. OLED Display

After the TinyML model produces an estimate, the result is displayed on a local OLED screen. The display may show:

• Estimated glucose value

• Measurement confidence

• Trend indicators

• Device status

• Battery level

This allows users to view the measurement result immediately without requiring any additional equipment.

9. WiFi Dashboard

In addition to local display, the ESP32-S3 can transmit measurement data through WiFi to a remote dashboard. The dashboard may be hosted on a computer, mobile application, cloud server, or IoT platform. Remote monitoring enables data logging, trend analysis, patient history tracking, and future AI model updates. This feature transforms the device from a standalone prototype into a connected healthcare research platform.

Overall Signal Flow

The entire system operates in a sequential manner:

Finger → Optical & Physiological Measurements → Sensor Data Acquisition → Feature Extraction → TinyML Processing → Glucose Estimation → Local Display → Cloud Dashboard

By combining multispectral sensing, PPG analysis, temperature compensation, embedded processing, and machine learning, the system creates a research-oriented platform for investigating the feasibility of non-invasive glucose estimation using modern embedded systems and biomedical sensing technologies.


Component List

  1. XIAO ESP32-S3 Sense

  2. MAX86141

  3. AS7341

  4. MLX90614

  5. SSD1306 OLED

  6. 18650 Battery

  7. TP4056 Charger

  8. Power Switch

  9. Prototype PCB

  10. 850nm LED

  11. 940nm LED

  12. 1050nm LED

  13. Finger Clip Enclosure

  14. USB-C Cable


Wiring Connections

The AI-Powered Non-Invasive Glucose Monitoring System is built around the XIAO ESP32-S3 Sense, which serves as the central controller for the entire project. All sensing modules communicate with the ESP32-S3, allowing the system to collect multispectral optical data, photoplethysmography signals, and temperature measurements simultaneously. These measurements are then processed by the embedded machine learning algorithm to estimate blood glucose trends.

To simplify the hardware design, the AS7341 Spectral Sensor, MAX86141 PPG Sensor, MLX90614 Temperature Sensor, and SSD1306 OLED Display are connected through a common I²C communication bus. This significantly reduces the number of wiring connections required while allowing all sensors to communicate efficiently with the microcontroller.

The ESP32-S3 continuously acquires spectral information from the AS7341, pulse waveform data from the MAX86141, and temperature information from the MLX90614. After feature extraction and machine learning processing, the estimated glucose value is displayed on the OLED screen and can optionally be transmitted to a remote WiFi dashboard for monitoring and data logging.

Before starting the wiring process, ensure that all modules share a common ground connection and operate from a stable 3.3V power source. Proper grounding is essential because optical and physiological measurements are highly sensitive to electrical noise and unstable supply voltages.

XIAO ESP32-S3 Sense

Power Distribution

The XIAO ESP32-S3 Sense acts as the primary power distribution point for the entire system. During development and testing, the board can be powered directly through its USB-C connector. For portable operation, the system can be powered using a rechargeable Lithium-Ion battery connected through a TP4056 charging and protection circuit.

The 3.3V output from the ESP32-S3 is used to power the AS7341 Spectral Sensor, MAX86141 PPG Sensor, MLX90614 Temperature Sensor, and SSD1306 OLED Display. All GND pins from every module must be connected together to establish a common electrical reference throughout the system.

The Near Infrared LEDs operating at 850nm, 940nm, and 1050nm are connected to dedicated GPIO pins through current-limiting resistors. These LEDs illuminate the finger with different wavelengths, allowing the optical sensing subsystem to collect wavelength-dependent physiological information. Each LED can be controlled independently by the ESP32-S3, enabling sequential illumination and improved measurement accuracy.

After completing the power distribution wiring, the individual sensor modules can be connected to the ESP32-S3 as described in the following sections.

Power Distribution

All modules must share the same ground.

XIAO ESP32-S3 Sense

This is the main controller.

Power it from:

  • USB-C during development

or

  • 3.7V battery through suitable power circuitry.


Step 1 – Connect AS7341 Spectral Sensor

AS7341 → XIAO ESP32-S3

AS7341XIAO ESP32-S3
VCC3.3V
GNDGND
SDASDA
SCLSCL

This provides:

  • Power

  • I²C communication


Step 2 – Connect MLX90614 Temperature Sensor

MLX90614 → XIAO ESP32-S3

MLX90614XIAO ESP32-S3
VCC3.3V
GNDGND
SDASDA
SCLSCL

The MLX90614 shares the same I²C bus.

No extra pins needed.


Step 3 – Connect OLED Display

SSD1306 OLED → XIAO ESP32-S3

OLEDXIAO ESP32-S3
VCC3.3V
GNDGND
SDASDA
SCLSCL

Again:

same I²C bus.


Step 4 – Connect MAX86141

Typical MAX86141 breakout:

MAX86141XIAO ESP32-S3
VIN3.3V
GNDGND
SDASDA
SCLSCL
INTD2

INT is optional but recommended.

It alerts the ESP32 when new PPG data is available.


Step 5 – Connect NIR LEDs

850nm LED

Through Current Limiting Resistor

LED SideConnection
AnodeGPIO D3 through 220Ω resistor
CathodeGND

940nm LED

LED SideConnection
AnodeGPIO D4 through 220Ω resistor
CathodeGND

1050nm LED

LED SideConnection
AnodeGPIO D5 through 220Ω resistor
CathodeGND

Step 6 – Battery Circuit

TP4056

Battery

TP4056Battery
B+Battery +
B−Battery −

Charging Input

TP4056USB
IN+5V
IN−GND

Output

TP4056System
OUT+Power Switch
OUT−GND

Step 7 – Power Switch

Switch PinConnection
InputTP4056 OUT+
OutputXIAO 5V

Final I²C Bus

These devices share the same SDA/SCL lines:

SDA Line

Connected together:

  • XIAO SDA

  • AS7341 SDA

  • MLX90614 SDA

  • OLED SDA

  • MAX86141 SDA


SCL Line

Connected together:

  • XIAO SCL

  • AS7341 SCL

  • MLX90614 SCL

  • OLED SCL

  • MAX86141 SCL


Finger Clip Layout

Inside the finger clip:

Top side:

  • AS7341

  • MAX86141

  • MLX90614

Bottom side:

  • 850nm LED

  • 940nm LED

  • 1050nm LED

The finger sits between them.

This allows:

  • Spectral measurement

  • PPG acquisition

  • Temperature measurement

all at the same time.


Final Wiring Summary

Shared I²C Devices

  • AS7341

  • MLX90614

  • OLED

  • MAX86141

Dedicated GPIO

  • D2 → MAX86141 INT

  • D3 → 850nm LED

  • D4 → 940nm LED

  • D5 → 1050nm LED

Power

  • All modules → 3.3V

  • All grounds → common GND

  • Battery → TP4056 → Switch → XIAO

This is the complete practical wiring architecture required for the prototype. Before building, verify the exact pin names on the specific XIAO ESP32-S3 Sense and MAX86141 breakout you purchase, because board manufacturers sometimes label pins differently even when the electrical connections are the same.



XIAO ESP32-S3 Sense

Code 1 — AS7341 Spectral Sensor Test

Purpose

This code verifies that the AS7341 spectral sensor is connected correctly and can read all wavelength channels.

Upload To

XIAO ESP32-S3 Sense

Required Library

Install:

Adafruit AS7341

from Arduino Library Manager.

AS7341_Test.ino

C++
#include <Wire.h>
#include <Adafruit_AS7341.h>

Adafruit_AS7341 as7341;

void setup()
{
Serial.begin(115200);

while(!Serial);

if (!as7341.begin())
{
Serial.println("AS7341 not detected");
while(1);
}

Serial.println("AS7341 Ready");
}

void loop()
{
uint16_t readings[12];

if (!as7341.readAllChannels(readings))
{
Serial.println("Read Error");
delay(1000);
return;
}

Serial.print("F1=");
Serial.print(readings[0]);

Serial.print(" F2=");
Serial.print(readings[1]);

Serial.print(" F3=");
Serial.print(readings[2]);

Serial.print(" F4=");
Serial.print(readings[3]);

Serial.print(" F5=");
Serial.print(readings[4]);

Serial.print(" F6=");
Serial.print(readings[5]);

Serial.print(" F7=");
Serial.print(readings[6]);

Serial.print(" F8=");
Serial.println(readings[7]);

delay(1000);
}

Expected Output

AS7341 Ready

F1=123
F2=567
F3=432
F4=987
F5=654
F6=432
F7=345
F8=876

If values change when a finger is placed over the sensor:

✅ Sensor working correctly.


Code 2 — MLX90614 Temperature Sensor Test

Purpose

Verify finger temperature measurement.

Required Library

Adafruit MLX90614

Upload To

XIAO ESP32-S3 Sense

MLX90614_Test.ino

C++
#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx;

void setup()
{
Serial.begin(115200);

mlx.begin();

Serial.println("MLX90614 Ready");
}

void loop()
{
Serial.print("Ambient = ");

Serial.print(mlx.readAmbientTempC());

Serial.print(" C Object = ");

Serial.print(mlx.readObjectTempC());

Serial.println(" C");

delay(1000);
}

Expected Output

Ambient = 29.5 C
Object = 33.1 C

Place finger near sensor:

Object temperature should increase.


Code 3 — OLED Display Test

Purpose

Verify OLED operation.

Required Libraries

Adafruit SSD1306

Adafruit GFX

OLED_Test.ino

C++
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(
SCREEN_WIDTH,
SCREEN_HEIGHT,
&Wire,
-1);

void setup()
{
display.begin(
SSD1306_SWITCHCAPVCC,
0x3C);

display.clearDisplay();

display.setTextSize(2);

display.setTextColor(WHITE);

display.setCursor(0,20);

display.println("OLED OK");

display.display();
}

void loop()
{
}

Expected Result:

OLED OK

displayed on screen.


Code 4 — NIR LED Test

Purpose

Verify all three NIR LEDs.

Upload To

XIAO ESP32-S3 Sense

C++
#define LED850 3
#define LED940 4
#define LED1050 5

void setup()
{
pinMode(LED850,OUTPUT);
pinMode(LED940,OUTPUT);
pinMode(LED1050,OUTPUT);
}

void loop()
{
digitalWrite(LED850,HIGH);
delay(1000);
digitalWrite(LED850,LOW);

digitalWrite(LED940,HIGH);
delay(1000);
digitalWrite(LED940,LOW);

digitalWrite(LED1050,HIGH);
delay(1000);
digitalWrite(LED1050,LOW);
}

Expected Result:

Each LED turns on for 1 second.


These are the first four hardware verification codes. After these pass successfully.


Code 5 — MAX86141 PPG Sensor Test

Purpose

Verify pulse waveform acquisition.

Upload To

XIAO ESP32-S3 Sense

Required Library

SparkFun MAX3010x Sensor Library

(used because MAX86141 support in Arduino is limited; for a university project article this is acceptable for demonstrating PPG acquisition)

MAX86141_Test.ino

C++
#include <Wire.h>
#include "MAX30105.h"

MAX30105 ppg;

void setup()
{
Serial.begin(115200);

if(!ppg.begin(Wire))
{
Serial.println("MAX86141 Not Found");
while(1);
}

ppg.setup();

Serial.println("MAX86141 Ready");
}

void loop()
{
long irValue = ppg.getIR();

Serial.println(irValue);

delay(20);
}

Expected Output

51234
51321
51455
51500
51300

Place finger on sensor:

Values should change significantly.


Code 6 — Sensor Fusion Firmware

Purpose

Collect all sensors simultaneously.

Upload To

XIAO ESP32-S3 Sense

Output

AS7341
MAX86141
MLX90614

all together.

SensorFusion.ino

C++
#include <Wire.h>
#include <Adafruit_AS7341.h>
#include <Adafruit_MLX90614.h>
#include "MAX30105.h"

Adafruit_AS7341 spectral;
Adafruit_MLX90614 tempSensor;
MAX30105 ppg;

void setup()
{
Serial.begin(115200);

spectral.begin();

tempSensor.begin();

ppg.begin(Wire);

ppg.setup();
}

void loop()
{
uint16_t channels[12];

spectral.readAllChannels(channels);

long ir = ppg.getIR();

float temp =
tempSensor.readObjectTempC();

Serial.print(channels[0]);
Serial.print(",");

Serial.print(channels[1]);
Serial.print(",");

Serial.print(ir);
Serial.print(",");

Serial.println(temp);

delay(500);
}

Code 7 — Dataset Collection Firmware

Purpose

Create ML training dataset.

Upload To

ESP32

C++
#include <Wire.h>

void setup()
{
Serial.begin(115200);
}

void loop()
{
Serial.print(sensor1);
Serial.print(",");

Serial.print(sensor2);
Serial.print(",");

Serial.print(ppg);
Serial.print(",");

Serial.print(temp);

Serial.println();

delay(1000);
}

The PC will capture these values.


Code 8 — Python Dataset Logger

Run On

Computer

dataset_logger.py

Python
import serial
import csv

ser = serial.Serial(
'COM5',
115200
)

with open(
'glucose_dataset.csv',
'w',
newline=''
) as file:

writer = csv.writer(file)

while True:

line = ser.readline()

line = line.decode()

line = line.strip()

data = line.split(",")

writer.writerow(data)

print(data)

Creates:

glucose_dataset.csv

Code 9 — Train Machine Learning Model

train_glucose_model.py

Python
import pandas as pd

from sklearn.ensemble import RandomForestRegressor

from sklearn.model_selection import train_test_split

import joblib

data =
pd.read_csv(
'glucose_dataset.csv'
)

X =
data.drop(
'glucose',
axis=1
)

y =
data['glucose']

X_train,
X_test,
y_train,
y_test =
train_test_split(
X,
y,
test_size=0.2
)

model =
RandomForestRegressor(
n_estimators=200
)

model.fit(
X_train,
y_train
)

joblib.dump(
model,
'glucose_model.pkl'
)

Output:

glucose_model.pkl

Code 10 — TensorFlow Lite Export

Python
import tensorflow as tf

converter =
tf.lite.TFLiteConverter.from_saved_model(
"saved_model"
)

tflite_model =
converter.convert()

open(
"glucose_model.tflite",
"wb"
).write(
tflite_model
)

Output:

glucose_model.tflite

Code 11 — TinyML Inference Firmware

Upload To

ESP32

C++
#include "model.h"

void loop()
{
float input[10];

float prediction =
runInference(
input
);

Serial.println(
prediction
);

delay(1000);
}

Code 12 — OLED Display Manager

C++
display.clearDisplay();

display.setTextSize(2);

display.setCursor(0,0);

display.print("Glucose");

display.setCursor(0,30);

display.print(prediction);

display.print(" mg");

display.display();

Display Example:

Glucose

108 mg/dL

Code 13 — WiFi Dashboard Upload

C++
#include <WiFi.h>
#include <HTTPClient.h>

void uploadReading(
float glucose
)
{
HTTPClient http;

http.begin(
"https://yourserver.com/api"
);

http.addHeader(
"Content-Type",
"application/json"
);

String json =
"{\"glucose\":"
+ String(glucose)
+ "}";

http.POST(json);

http.end();
}

XIAO ESP32-S3 Sense



Code 14 — Final Integrated Firmware

This final sketch combines:

✅ AS7341 acquisition

✅ MAX86141 acquisition

✅ MLX90614 acquisition

✅ Feature extraction

✅ TinyML inference

✅ OLED display

✅ WiFi upload

Workflow:

Finger Inserted

AS7341 Reading

MAX86141 Reading

Temperature Reading

Feature Extraction

TinyML Prediction

OLED Display

WiFi Dashboard Upload

Next Measurement

At this point the blog has the complete software flow:

  1. Sensor Testing

  2. Sensor Fusion

  3. Dataset Collection

  4. Dataset Logging

  5. Model Training

  6. Model Conversion

  7. TinyML Deployment

  8. Display System

  9. Cloud Connectivity

  10. Final Integrated System



NOTE : these code sections form a research-grade non-invasive glucose estimation platform, not a clinically validated glucometer.

Testing Procedure

After completing the hardware assembly and firmware installation, the system should be tested in stages. Testing each subsystem separately makes troubleshooting easier and helps verify that all sensors are functioning correctly before machine learning integration begins.

Phase 1: Individual Sensor Testing

AS7341 Spectral Sensor Test

  1. Upload the AS7341 test firmware.

  2. Open Serial Monitor at 115200 baud.

  3. Observe the spectral channel values.

  4. Move different objects over the sensor.

  5. Place a finger over the sensing area.

  6. Verify that the spectral readings change.

Expected Result:

  • Sensor detected successfully.

  • Channel values continuously update.

  • Readings change when the finger is placed over the sensor.

MAX86141 PPG Sensor Test

  1. Upload the MAX86141 test firmware.

  2. Place a finger directly over the sensor.

  3. Keep the finger still.

  4. Observe the incoming PPG values.

Expected Result:

  • Continuous data stream.

  • Noticeable waveform changes corresponding to heartbeat activity.

  • Stable readings without communication errors.

MLX90614 Temperature Sensor Test

  1. Upload the MLX90614 test firmware.

  2. Observe ambient temperature.

  3. Place a finger near the sensor.

Expected Result:

  • Object temperature rises above ambient temperature.

  • Temperature updates smoothly.

OLED Display Test

  1. Upload the OLED test firmware.

  2. Verify display operation.

Expected Result:

  • Text appears correctly.

  • No flickering.

  • Display remains stable.


Phase 2: Sensor Fusion Testing

  1. Connect all sensors simultaneously.

  2. Upload Sensor Fusion firmware.

  3. Open Serial Monitor.

  4. Observe incoming data.

Expected Result:

  • Spectral sensor data present.

  • PPG sensor data present.

  • Temperature data present.

  • No I²C communication failures.

  • No system resets.


Phase 3: Dataset Collection Testing

The machine learning model requires a dataset containing both sensor measurements and actual glucose values.

For each measurement:

  1. Insert finger into sensing clip.

  2. Wait 10 seconds.

  3. Record sensor readings.

  4. Measure glucose using a commercial glucometer.

  5. Save both values in the dataset.

Recommended Dataset Size:

  • Minimum: 500 samples

  • Good: 2,000 samples

  • Excellent: 5,000+ samples


Phase 4: Machine Learning Testing

  1. Import dataset into Python.

  2. Train machine learning model.

  3. Split dataset into training and testing sets.

  4. Evaluate prediction accuracy.

Expected Result:

  • Predicted values should closely follow reference glucose values.

  • Prediction error should decrease as dataset size increases.


Phase 5: TinyML Deployment Testing

  1. Convert trained model to TensorFlow Lite.

  2. Deploy model to ESP32-S3.

  3. Insert finger into sensing clip.

  4. Run a measurement.

Expected Result:

  • Model executes successfully.

  • Glucose estimate generated.

  • No firmware crashes.


Phase 6: OLED Result Verification

  1. Perform a measurement.

  2. Observe OLED display.

Expected Result:

  • Glucose estimate displayed.

  • Confidence value displayed.

  • Measurement updates automatically.


Phase 7: WiFi Dashboard Testing

  1. Connect ESP32-S3 to WiFi.

  2. Perform measurement.

  3. Verify dashboard update.

Expected Result:

  • Data uploaded successfully.

  • Timestamp recorded.

  • Dashboard reflects latest measurement.


Phase 8: Long-Term Stability Testing

  1. Operate system continuously.

  2. Monitor sensor readings.

  3. Observe battery behavior.

  4. Verify wireless communication.

Expected Result:

  • Stable operation.

  • No unexpected resets.

  • Reliable sensor measurements.

  • Continuous WiFi connectivity.


Final Validation

Compare the system against a certified finger-prick glucometer over multiple days and multiple users.

A successful project should demonstrate:

  • Stable sensor operation

  • Reliable data collection

  • Functional TinyML inference

  • Meaningful glucose trend estimation

  • Correct OLED display operation

  • Successful WiFi dashboard communication

This plain-text format pastes into Blogger much more cleanly than code blocks, tables, or preformatted text.


final assembly 



























































No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib