Cellular IoT Multi-Sensor Patient Monitoring System
by CodersCafeTech in Circuits > Arduino
178 Views, 3 Favorites, 0 Comments
Cellular IoT Multi-Sensor Patient Monitoring System
Access to continuous healthcare monitoring remains a major challenge, especially in rural and remote areas where reliable internet connectivity is limited. Traditional systems depend heavily on Wi-Fi or hospital infrastructure, making them inaccessible in many real-world situations.
This project presents a multi-sensor patient monitoring system powered by Cellular IoT, capable of tracking vital health parameters in real time and transmitting them globally—without relying on Wi-Fi.
Built using advanced biomedical sensors, a powerful microcontroller, and a cellular communication module, this system enables:
- Real-time monitoring of heart rate, SpO₂, and ECG
- Remote access via cloud dashboards
- Instant alerts during critical conditions
The system demonstrates how IoT, sensors, and edge intelligence can transform healthcare accessibility, enabling continuous monitoring anywhere in the world
Supplies
Hardware
- STM32 Nucleo F429ZI (main controller)
- Seeed Studio XIAO nRF52840 Sense (for motion + ML)
- Blues Notecard (cellular connectivity)
- MAX30102 (SpO₂ + heart rate sensor)
- ECG sensor module
- Wires
- Power supply
Software
- Arduino IDE / STM32 IDE
- Notehub (Blues Wireless cloud)
- Kaa IoT platform (dashboard)
- Twilio API (alerts)
How It Works
The system works by continuously collecting and transmitting vital health data through a structured flow of sensing, processing, and communication. Biomedical sensors such as the ECG sensor, SpO₂ sensor, and motion sensor first capture the patient’s physiological signals in real time. These signals are sent to the STM32 Nucleo F429ZI microcontroller, which acts as the central processing unit. The microcontroller filters noise, processes the raw data, and converts it into meaningful health parameters.
Once processed, the data is forwarded to the Blues Notecard, which enables cellular communication. The Notecard securely transmits this information to the Blues Notehub cloud platform, making it accessible from anywhere without relying on Wi-Fi. From there, the data is integrated with platforms like Kaa IoT for visualization on dashboards, allowing continuous remote monitoring. If any abnormal condition is detected, such as irregular heart rate or low oxygen levels, the system triggers alerts through services like Twilio, which sends an SMS notification to caregivers or medical professionals. This entire flow ensures reliable, real-time healthcare monitoring regardless of location.
Understanding the Sensors
This system relies on multiple sensors working together to provide a complete picture of the patient’s health. Each sensor captures a different type of data, and when combined, they enable accurate and reliable monitoring.
The MAX30102 sensor is used to measure heart rate and blood oxygen levels (SpO₂). It works based on a principle called photoplethysmography, where red and infrared light are passed through the skin. By analyzing how much light is absorbed by the blood, the sensor can determine oxygen saturation and pulse rate. This allows continuous, non-invasive monitoring using just a fingertip.
The ECG sensor measures the electrical activity of the heart. Electrodes are placed on the body, typically on the chest, to detect tiny electrical signals generated during each heartbeat. These signals form a waveform that can be analyzed to identify irregular heart rhythms or abnormalities. Unlike pulse sensors, ECG provides deeper insight into cardiac health.
To enhance the system further, the project uses the Seeed Studio XIAO nRF52840 Sense, which includes built-in sensors such as an inertial measurement unit (IMU) and a microphone. The IMU can detect motion, orientation, and sudden changes in movement, making it useful for identifying unusual activity patterns. The onboard microphone can capture sound-based signals, which can also be used for advanced health monitoring applications.
What makes the XIAO Sense especially powerful is its ability to run TinyML (machine learning at the edge). Instead of sending all raw data to the cloud, the device can process sensor data locally and detect patterns in real time. This improves speed, reduces power consumption, and enables smarter decision-making directly on the device.
In the next steps, we will develop a machine learning model on the XIAO nRF52840 Sense to analyze motion and sensor data more intelligently. This will allow the system to detect anomalies and patterns that are difficult to identify using simple threshold-based methods, making the monitoring system more accurate and reliable.
Machine Learning on XIAO NRF52840 Sense
The Seeed Studio XIAO nRF52840 Sense enables on-device intelligence using its built-in LSM6DS3 accelerometer. It captures motion data and processes it using TinyML, allowing the system to recognize states such as idle, hand raise, and anomalous movement in real time.
Data Acquisition
As we all know machine learning starts with the data. The following simplified process outlines data acquisition for training the TinyML model using Edge Impulse.
Upload the provided code to the XIAO, capturing accelerometer data using the LSM6DS3 sensor.
Start the data forwarder using the command edge-impulse-data-forwarder, and then connect the XIAO to Edge Impulse through the CLI by providing your account credentials. Once connected, navigate to the Data Collection tab and begin recording accelerometer data for different activities such as Hand Raise and Idle. Make sure to properly label and split the data into respective categories, maintaining a balanced dataset, as having more diverse and well-labeled data will significantly improve the performance and accuracy of the model.
ImpulseDesign
An impulse in Edge Impulse represents the machine learning pipeline used for feature generation, which is a crucial step in building an accurate model. While neural networks are powerful, they struggle with unseen data and tend to classify everything into known categories. To address this, an anomaly detection block is added to identify unusual patterns beyond the trained classes. After designing the impulse for this project, the features are generated using the feature generation tab, which prepares the data for model training.
Model Training and Testing
During training, the neural network adjusts its weights and biases to minimize the loss function and achieve optimal performance. In the NN Classifier tab, parameters can be tuned to improve accuracy, and after adjustments, the model achieved around 95% accuracy. An anomaly detection block is also configured by selecting the appropriate axis, enabling the system to detect unusual patterns. Once training is complete, the model is tested using the “Classify All” option in the Model Testing section, where it achieved an accuracy of approximately 98.3%, demonstrating strong performance on new data.
Deployment
For deployment, the trained model is exported as an Arduino library and uploaded to the XIAO nRF52840 Sense. Due to memory constraints on embedded devices, a quantized version of the model is used to reduce size while maintaining performance. To enable communication between the XIAO and the STM32, UART is used, and after reviewing the STM32 Nucleo’s hardware serial options, USART2 is selected for reliable data transmission.
Microcontroller
At the core of this system is the STM32 Nucleo F429ZI, which acts as the central brain of the entire setup. It is responsible for reading sensor data, processing it in real time, and coordinating communication between all components.
This microcontroller is built around a powerful ARM Cortex-M processor, making it suitable for handling multiple sensors simultaneously without delays. In this project, it continuously collects data from the SpO₂ sensor, ECG module, and motion sensing unit, ensuring that all vital parameters are monitored together.
Instead of simply forwarding raw values, the microcontroller performs essential processing. It filters noise from the signals, converts them into meaningful readings, and checks whether any values fall outside safe thresholds. This is crucial in medical applications where accuracy and reliability are important.
Another key role of the microcontroller is communication. It acts as a bridge between the sensing layer and the cloud system by sending processed data to the cellular module. Because of its multiple communication interfaces such as I2C, SPI, and UART, it can easily handle different devices in the system.
Overall, the microcontroller transforms raw sensor inputs into actionable health data, making the system intelligent and responsive.
Blues Notecard – Cellular Connectivity
To make the system truly independent and usable anywhere, the project uses the Blues Notecard for communication. This module enables the device to send data over cellular networks, removing the need for Wi-Fi entirely.
In many real-world situations, especially in rural or remote areas, Wi-Fi is either unreliable or completely unavailable. The Notecard solves this problem by providing built-in cellular connectivity along with secure cloud integration. This makes the system far more practical for real healthcare scenarios.
The microcontroller sends processed sensor data to the Notecard, which then packages it into structured messages and transmits it to the cloud using Notehub. This process happens automatically and securely, allowing doctors or caregivers to access patient data from anywhere in the world.
Another advantage of the Notecard is its simplicity. It does not require complex networking setup, and communication with the microcontroller can be handled through standard interfaces like I2C or UART. This makes integration straightforward while still offering powerful capabilities.
By using cellular communication, the system becomes location-independent and reliable, which is one of the most important aspects of this project. It ensures that patient data is always available when it is needed, regardless of network limitations.
Real-Time Operating System (RTOS)
A Real-Time Operating System (RTOS) is a crucial software layer used in embedded systems to enable multitasking with precise timing control. Unlike traditional systems that execute tasks sequentially, an RTOS allows multiple tasks to run concurrently by rapidly switching between them, creating the effect of parallel execution while maintaining deterministic behavior.
In this project, integrating an RTOS significantly improves system efficiency and responsiveness. Instead of handling all operations in a single loop, the system is divided into independent tasks with assigned priorities. This ensures that critical operations such as sensor data acquisition and communication are executed reliably without delays or conflicts.
At the core of the RTOS is the kernel, which manages task execution. Each function in the system is treated as a task or thread, and the scheduler determines when and how each task runs. Higher-priority tasks are executed first, while lower-priority tasks are scheduled accordingly, ensuring smooth and predictable operation.
To maintain proper coordination between tasks, synchronization mechanisms such as semaphores, mutexes, and queues are used. These help manage shared resources, prevent data corruption, and enable structured communication between different parts of the system.
In this implementation, the system is divided into three main tasks. One task continuously reads ECG data and sends it to the cloud. Another handles SpO₂, heart rate, and temperature measurements, ensuring periodic updates. The third task reads motion data from the XIAO nRF52840 Sense via serial communication to detect movement or anomalies. By separating these functions into dedicated tasks, the RTOS ensures that all operations run efficiently and without interference.
Overall, the use of an RTOS transforms the system into a robust, real-time healthcare monitoring platform capable of handling multiple sensor inputs and communication processes simultaneously.
Assembly & Electronics
The MAX30102 sensor and the XIAO nRF52840 Sense are mounted onto a finger clip to enable continuous and accurate data collection. A suitable 3D model for the finger clip is selected, ensuring that both components can fit securely while remaining comfortable for the user. The sensors are positioned properly so that the MAX30102 aligns with the fingertip for reliable readings.
Once the finger clip is ready, the MAX30102 and XIAO are fixed in place. Necessary wires are carefully routed out from the clip to connect with the rest of the system. Proper wire management is important here to avoid loose connections and ensure durability during use.
To organize and protect the remaining components, a 3D-printed enclosure is used. The STM32 Nucleo board, Blues Notecard, and power components are placed inside this enclosure, ensuring a compact and secure setup.
The system is powered using a 12V, 3A power supply. Since the components require 5V, a Mini-360 buck converter is used to step down the voltage. The output of the converter is adjusted to 5V, which is then used to power the STM32, XIAO, and Notecard safely
All components are connected one by one, ensuring proper communication between sensors, microcontroller, and the cellular module. Special attention is given to the connection between the Blues Notecard and the STM32, as this is essential for transmitting data to the cloud.
After completing all connections, the entire system is checked for any missing or loose wiring. Once verified, the components are secured inside the enclosure, and the finger probe is connected properly.
With the hardware fully assembled and tested, the system is now ready for software integration and real-time operation.
Building Dashboard With Kaa IoT
Kaa IoT is a powerful platform used to manage connected devices and visualize real-time data. It supports lightweight communication protocols such as MQTT, making it ideal for transmitting sensor data efficiently in real-time monitoring applications.
In this project, Kaa IoT acts as the central interface where all patient data is collected, displayed, and analyzed. It provides a user-friendly dashboard that allows caregivers or doctors to monitor vital parameters from anywhere.
The dashboard displays real-time values such as heart rate, SpO₂, ECG signals, and motion data using graphs and widgets. This helps in identifying trends, patterns, and abnormal conditions quickly. It also supports alerts and notifications, ensuring that any critical change in patient health is immediately brought to attention.
To connect the device, a digital representation called an endpoint is created in the Kaa platform. After registering the device and generating an endpoint token, the system is configured to receive telemetry data. Once the device starts sending data, it becomes visible in the platform, confirming a successful connection.
After establishing the connection, a custom dashboard is created under the Solutions section. Widgets such as charts, indicators, and data panels are added and configured to display the required parameters. The dashboard can be tailored to show only the most relevant information, making it easy to monitor the patient’s condition at a glance.
With this setup, the system provides a complete real-time monitoring solution, where sensor data is not only collected but also presented in a meaningful and actionable way.
Twilio for Sending Alerts
Twilio is a cloud communication platform that enables applications to send messages, make calls, and handle notifications using simple APIs. In this project, Twilio is used to send real-time SMS alerts whenever abnormal conditions are detected, such as sudden changes in vital signs, patient distress, or unusual motion.
This alert system ensures that caregivers or medical professionals are notified instantly, allowing quick response in critical situations.
To integrate Twilio, start by creating an account on the platform. Once registered, obtain a Twilio phone number, which will be used to send SMS alerts. After that, collect the required credentials, including the Account SID, Auth Token, and the Twilio phone number.
These credentials are then configured within Notehub, enabling the system to automatically send SMS alerts whenever predefined conditions are triggered.
With this setup, the monitoring system not only tracks patient data but also actively responds to emergencies, making it far more effective and reliable.
Setting Up Routes in Notehub
To begin, log in to Notehub and navigate to the Routes section. Click on “Create Route” and choose the required service depending on the type of data you want to send. Routes define how data from the device is forwarded to external platforms.
To forward patient vitals to the Kaa IoT platform, create an MQTT route. Enter the broker URL, port number, and topic provided by Kaa.
The MQTT topic follows a structured format: kp1/{application_version}/{extension_instance_name}/{endpoint_token}/{resource_path}
In this project, the extension name is set to ecr, and the resource path is JSON. The endpoint token uniquely identifies the device.After configuring these details, scroll down to the filters section and select the appropriate notefile that contains the sensor data. This ensures only relevant data is sent to the dashboard.
To notify a caregiver when abnormal motion or a help request is detected, create a Twilio route in Notehub. Enter the required credentials including Account SID, Auth Token, and the Twilio phone number.Configure the message content and select the notefile responsible for motion or alert data. This allows the system to send SMS alerts instantly when assistance is needed.
A similar Twilio route is created to alert doctors in case of sudden changes in vital signs such as heart rate or SpO₂ levels. The configuration remains the same, but a different notefile and message content are used to distinguish medical alerts from general assistance requests.
Project Files and Resources
To make this project easy to replicate and modify, all the necessary files including source code, schematics, and 3D designs are available in the official GitHub repository.
You can access the complete project here.
The repository contains all essential resources required to build the system, such as firmware for the microcontroller, machine learning integration files, and design files for the enclosure.
By referring to these files, you can directly upload the code, understand the implementation in detail, and even customize the project according to your needs.