This project presents the design and implementation of an intelligent wearable health assistant built around the Nordic Semiconductor nRF5340-DK development platform. The system integrates the MAX30100 pulse oximeter and heart-rate sensor together with the MPU6050 six-degree-of-freedom inertial measurement unit to create a compact real-time biomedical and motion-monitoring device.
The wearable assistant measures heart rate, estimates blood oxygen saturation (SpO2), analyzes user movement, detects physical activity, and identifies potential fall events. Communication with a smartphone is achieved using Bluetooth Low Energy (BLE), enabling wireless monitoring and real-time data visualization.
The firmware is implemented using the Zephyr RTOS within the nRF Connect SDK ecosystem. A companion Flutter-based smartphone application provides a modern cross-platform interface for mobile monitoring.
The project demonstrates the practical integration of biomedical sensing, inertial motion analysis, wireless communication, embedded signal processing, and low-power IoT design within a single wearable architecture.
Modern wearable electronics are increasingly used in healthcare, sports monitoring, elderly assistance, rehabilitation systems, and Internet of Things (IoT) environments. Advances in embedded systems, low-power wireless communication, and biomedical sensors have enabled compact devices capable of collecting and transmitting physiological information in real time.
The primary objective of this project was to design a wearable electronic assistant capable of:
- heart-rate monitoring,
- blood oxygen saturation estimation,
- motion analysis,
- activity classification,
- fall detection,
- smartphone communication,
- future cloud and AI integration.
The system was designed using commercially available modules and open embedded development frameworks to provide a scalable and extensible platform suitable for educational, research, and prototyping purposes.
The system is based on:
- nRF5340-DK development board,
- MAX30100 Heart Rate & Pulse Oximeter sensor,
- MPU-6050 GY-521 module (accelerometer + gyroscope),
- Bluetooth Low Energy (BLE),
- Zephyr RTOS / nRF Connect SDK.
The project can be extended with:
- a mobile application,
- SOS alarm functionality,
- sleep analysis,
- stress detection,
- GPS localization,
- IoT cloud integration.
The wearable assistant consists of four major subsystems:
- Processing subsystem,
- Biomedical sensing subsystem,
- Motion analysis subsystem,
- Wireless communication subsystem.
The complete architecture is centered around the nRF5340-DK development kit.
The core processing unit of the project is the Nordic Semiconductor nRF5340-DK.
The board contains:
- Dual-core ARM Cortex-M33,
- Bluetooth Low Energy 5.4,
- Thread and Zigbee support,
- Hardware cryptographic acceleration,
- Integrated debugging interface.
- Low power consumption,
- Zephyr RTOS support,
The dual-core architecture enables separation of application tasks and communication tasks, improving overall responsiveness and power efficiency.
The development board also provides:
- USB debugging,
- UART communication,
- GPIO interfaces,
- I2C support,
- SPI support,
- PWM
- programmable LEDs and buttons.
Responsibilities in the project:
- Sensor communication,
- Data processing,
- Signal filtering,
- BLE transmission,
- Power management,
- User activity analysis.
The nRF5340 was selected because of its modern wireless capabilities, excellent Zephyr RTOS support, and suitability for wearable IoT applications.
2. MAX30100 Pulse Oximeter and Heart-Rate SensorThe MAX30100 is an integrated biomedical sensor designed for pulse oximetry and heart-rate measurement.
The sensor combines:
- red LED,
- infrared LED,
- photodetector,
- analog signal processing,
- digital signal conversion.
The operating principle is based on photoplethysmography (PPG), where light emitted into the skin is partially absorbed by blood flow. Variations in absorption caused by cardiac activity allow the extraction of pulse information.
Two wavelengths are used:
- infrared light for pulse measurement,
- red light for blood oxygen saturation estimation.
The sensor communicates through the I2C bus and operates at 3.3 V, making it fully compatible with the nRF5340 platform.
Functions in the Project:
- BPM measurement,
- SpO2 measurement,
- Finger presence detection,
- Signal quality analysis.
Parameters:
- I2C communication,
- Operating voltage: 1.8–3.3 V,
- IR + RED LEDs,
- Integrated ADC.
The MPU6050 module provides six degrees of freedom using:
- a three-axis accelerometer,
- a three-axis gyroscope.
The accelerometer measures linear acceleration along the X, Y, and Z axes, while the gyroscope measures angular velocity.
This subsystem enables:
- activity recognition,
- posture estimation,
- orientation tracking,
- motion analysis,
- fall detection.
Parameters:
- I2C communication,
Accelerometer ranges:
- ±2g,
- ±4g,
- ±8g,
- ±16g,
Gyroscope ranges:
- ±250,
- ±500,
- ±1000,
- ±2000 °/s.
Functions:
- Motion detection,
- Activity analysis,
- Step counting,
- Fall detection,
- Spatial orientation.
The MPU6050 communicates using the same shared I2C bus as the MAX30100.
I2C was selected because of:
- low pin count,
- multi-device capability,
- low complexity,
- wide sensor compatibility.
The sensor addresses are:
I2C requires pull-up resistors. Pull-up resistors on SDA and SCL ensure proper signal integrity.
Typical values:
- 4.7kΩ
- 10kΩ
Most breakout boards already include pull-ups.
4. Power SystemThe system operates using a 3.3 V power rail compatible with all integrated modules.
For wearable operation, the future production version may use:
- 3.7 V lithium-ion battery,
- TP4056 charging controller,
- low-dropout voltage regulator.
Low-power design considerations are essential for wearable devices and were incorporated into the firmware architecture.
Firmware ArchitectureThe firmware was implemented using Zephyr RTOS as part of the Nordic nRF Connect SDK.
Zephyr provides:
- task scheduling,
- hardware abstraction,
- BLE stack integration,
- driver management,
- memory management,
- modular software architecture.
The use of Zephyr simplifies scalability and improves portability across embedded platforms.
The firmware was divided into multiple software layers:
main.c - Main application loop
max30100.c - Biomedical sensor driver
mpu6050.c - Motion sensor driver
filters.c - Signal processing
activity.c - Motion analysis
ble_service.c - Bluetooth communicationThis modular architecture improves maintainability and simplifies debugging.
Signal Processing and FilteringWearable biomedical systems require reliable signal conditioning.
The project implements:
- moving average filtering,
- threshold analysis,
- temporal peak detection.
The project based on nRF5340-DK, MAX30100, and MPU6050 enables the development of a modern wearable system for monitoring user health and activity.
Main project features:
- heart rate and SpO2 monitoring,
- motion analysis,
- fall detection,
- BLE communication,
- low power consumption,
- extensibility with AI and IoT.
The MAX30100 is initialized through I2C register configuration.
The firmware configures:
- operating mode,
- SpO2 mode,
- LED current,
- sample rate.
The device is placed into SpO2 mode to simultaneously measure pulse and oxygen saturation.
int max30100_init(void)
{
uint8_t config;
config = 0x03;
i2c_reg_write_byte(i2c_dev,
MAX30100_ADDR,
MAX30100_MODE_CONF,
config);
config = 0x27;
i2c_reg_write_byte(i2c_dev,
MAX30100_ADDR,
MAX30100_SPO2_CONF,
config);
config = 0x24;
i2c_reg_write_byte(i2c_dev,
MAX30100_ADDR,
MAX30100_LED_CONF,
config);
return 0;
}Sensor samples are read from the internal FIFO buffer.
int max30100_read(max30100_data_t *data)
{
uint8_t buffer[4];
i2c_burst_read(i2c_dev,
MAX30100_ADDR,
MAX30100_FIFO_DATA,
buffer,
4);
data->ir = (buffer[0] << 8) | buffer[1];
data->red = (buffer[2] << 8) | buffer[3];
return 0;
}Each sample contains:
- infrared signal value,
- red signal value.
The raw signals are processed continuously in real time.
Raw PPG signals contain significant noise caused by:
- motion artifacts,
- ambient light,
- ADC quantization,
- skin contact variation.
A moving average filter was implemented to reduce high-frequency noise.
The filtering process stabilizes the waveform and improves pulse peak detection reliability.
Heart-rate signals contain:
- motion artifacts,
- ADC noise,
- ambient light disturbances.
A moving average filter is used.
#define FILTER_SIZE 8
uint16_t moving_average_filter(uint16_t input)
{
static uint16_t samples[FILTER_SIZE];
static uint8_t index = 0;
uint32_t sum = 0;
samples[index++] = input;
if (index >= FILTER_SIZE)
index = 0;
for (int i = 0; i < FILTER_SIZE; i++) {
sum += samples[i];
}
return sum / FILTER_SIZE;
}Heart rate is calculated by detecting periodic peaks in the filtered infrared waveform.
The algorithm performs:
- threshold comparison,
- peak detection,
- RR interval measurement,
- BPM calculation.
The heart-rate formula is:
BPM = 60000 / RR_interval_msThe algorithm produces stable real-time pulse measurements suitable for wearable applications.
uint8_t calculate_bpm(uint16_t ir)
{
static uint32_t last_peak = 0;
static uint16_t threshold = 50000;
uint32_t now = k_uptime_get_32();
if (ir > threshold) {
uint32_t delta = now - last_peak;
if (delta > 300 && delta < 2000) {
last_peak = now;
return 60000 / delta;
}
}
return 0;
}Blood oxygen saturation is estimated using the ratio between red and infrared absorption.
The implemented approximation is:
SpO2 = 110 − 25 × R
where : R = (ACred/DCred) / (ACir/DCir)Although simplified, the algorithm demonstrates the principles of pulse oximetry and provides realistic oxygen saturation estimates.
uint8_t calculate_spo2(uint16_t red,
uint16_t ir)
{
float ratio = (float)red / (float)ir;
int spo2 = 110 - (25 * ratio);
if (spo2 > 100)
spo2 = 100;
if (spo2 < 0)
spo2 = 0;
return spo2;
}Main Loop Integration is as follows:
max30100_data_t hr;
max30100_read(&hr);
hr.filtered_ir = moving_average_filter(hr.ir);
hr.bpm = calculate_bpm(hr.filtered_ir);
hr.spo2 = calculate_spo2(hr.red,
hr.ir);The accelerometer continuously measures linear acceleration along all three axes.
The data enables:
- motion intensity analysis,
- posture estimation,
- activity recognition.
int mpu6050_init(void)
{
i2c_reg_write_byte(i2c_dev,
MPU6050_ADDR,
MPU6050_PWR_MGMT_1,
0x00);
return 0;
}Acceleration magnitude is calculated using:
The gyroscope measures rotational motion and orientation changes.
int mpu6050_read(mpu6050_data_t *data)
{
uint8_t buffer[14];
i2c_burst_read(i2c_dev,
MPU6050_ADDR,
MPU6050_ACCEL_XOUT,
buffer,
14);
data->accel_x = (buffer[0] << 8) | buffer[1];
data->accel_y = (buffer[2] << 8) | buffer[3];
data->accel_z = (buffer[4] << 8) | buffer[5];
data->gyro_x = (buffer[8] << 8) | buffer[9];
data->gyro_y = (buffer[10] << 8) | buffer[11];
data->gyro_z = (buffer[12] << 8) | buffer[13];
return 0;
}Gyroscope data improves movement tracking and helps distinguish between normal activity and sudden impacts.
angle = 0.98 * gyro + 0.02 * accelMovement intensity thresholds were used to classify activity states:
This approach provides basic but effective activity recognition.
int magnitude = abs(ax)
+ abs(ay)
+ abs(az);
if (magnitude < 5000) {
printk("Idle\n");
}
else if (magnitude < 15000) {
printk("Walking\n");
}
else {
printk("Running\n");
}Fall detection is one of the most important safety features of the system.
#define FALL_THRESHOLD 25000
if (magnitude > FALL_THRESHOLD) {
printk("FALL DETECTED\n");
}The algorithm identifies:
- sudden acceleration peaks,
- rapid orientation changes,
- inactivity following impact.
When acceleration exceeds a predefined threshold, the system generates a fall alarm event.
This feature is particularly important for elderly care and rehabilitation systems.
Bluetooth Low Energy CommunicationBluetooth Low Energy was implemented using the Zephyr BLE stack.
#include <zephyr/bluetooth/bluetooth.h>
int ble_init(void)
{
int err;
err = bt_enable(NULL);
if (err) {
printk("BLE init failed\n");
return err;
}
printk("Bluetooth initialized\n");
return 0;
}The wearable device operates as a BLE peripheral and advertises custom GATT services.
BT_GATT_SERVICE_DEFINE(health_svc,
BT_GATT_PRIMARY_SERVICE(BT_UUID_DECLARE_16(0x180D)),
BT_GATT_CHARACTERISTIC(BT_UUID_DECLARE_16(0x2A37),
BT_GATT_CHRC_READ |
BT_GATT_CHRC_NOTIFY,
BT_GATT_PERM_READ,
NULL,
NULL,
&hr_value),
);
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS,
(BT_LE_AD_GENERAL |
BT_LE_AD_NO_BREDR)),
BT_DATA(BT_DATA_NAME_COMPLETE,
CONFIG_BT_DEVICE_NAME,
sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};BLE was selected because of:
- low power consumption,
- smartphone compatibility,
- real-time communication capability,
- wearable suitability.
Custom BLE characteristics were implemented for:
- heart rate,
- SpO2,
- accelerometer data,
- motion events.
The smartphone receives data using BLE notifications.
bt_le_adv_start(BT_LE_ADV_CONN,
ad,
ARRAY_SIZE(ad),
NULL,
0);
...
bt_gatt_notify(NULL,
&health_svc.attrs[1],
&hr_value,
sizeof(hr_value));The firmware periodically transmits:
- BPM values,
- SpO2 values,
- acceleration data,
- fall alerts.
ble_update_heart_rate(hr.bpm);
ble_update_spo2(hr.spo2);
ble_update_motion(imu.accel_x,
imu.accel_y,
imu.accel_z);Real-time transmission allows continuous mobile monitoring.
Smartphone ApplicationA cross-platform mobile application was developed using Flutter.
Flutter enables:
- Android support,
- iOS support,
- modern UI design,
- rapid development.
The mobile application performs:
- BLE scanning,
- automatic connection,
- GATT service discovery,
- notification subscription,
- real-time data display.
The application displays:
- current heart rate,
- oxygen saturation,
- motion information.
- health history graphs,
- cloud synchronization,
- emergency notifications,
- smartwatch integration,
- AI-based analytics.
The nRF5340 platform provides high computational performance and energy efficiency, making it suitable for further development into a professional wearable device for medical or sports applications.












Comments