Embedded program that collects data from multiple 6+3 axis sensors and sends them over to a local server via Bluetooth LE for ML inference. Designed to be deployed and synchronized on multiple MCUs.
This repository is part of our Capstone project at METU NCC: Multi Sensor Activity Detection Based Health Monitoring System
The sensors are placed on various locations on the body (arms, wrists, knee, etc.), replicating a subset of the setup used in the OPPORTUNITY dataset for Human Activity Recognition:
-
Each group of closely placed sensors is connected on an I2C bus to an MCU that collects the data, filters it, serializes it, and sends it over Bluetooth LE to a separate on-body device.
-
The on-body device synchronizes the packets from the MCU nodes, and sends the aggregated data to a Python server.
-
The Python server performs inference on the data using a Random Forest ML model for activity recognition (trained using this same setup).
-
The results of the inference are displayed on an Android app connected to the same local WiFi network as the server.
-
Compatibility with different MCU architectures using the PlatformIO ecosystem (we're using Xtensa and ARM devices together).
-
Stabilized sensor output using a hardware (built-in) low-pass filter and a software Kalman filter.
-
Efficient Bluetooth LE operation that uses advertising for connecting and notifications for transmitting the data periodically.
-
Compact serialized packets using MessagePack to fit the MTU size for Bluetooth LE.
-
Reliable recovery implementation that detects any disconnections and reinitializes the sensors/connection.
- 9x MPU-6050 6-axis accelerometer + gyroscope
- 4x QMC5883L 3-axis magnetometer
- 2x ESP32 MCU with two I2C controllers and Bluetooth LE
- e.g. ESP32-DevKitC V4
- 2x nRF52840 MCU with one I2C controller and Bluetooth LE
- Linux device with Bluetooth LE (bluez) to run the Python server
- e.g. Raspberry Pi 5
- Project demo
- Poster and Hardware setup