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:
![](https://private-user-images.githubusercontent.com/52977072/345849759-f347b18a-2d14-4e27-84ee-f41492f3f8fe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMzkzNzIsIm5iZiI6MTcyMDMzOTA3MiwicGF0aCI6Ii81Mjk3NzA3Mi8zNDU4NDk3NTktZjM0N2IxOGEtMmQxNC00ZTI3LTg0ZWUtZjQxNDkyZjNmOGZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDA3NTc1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEwMzNiMTZlMzNmNjc2MDZkNzU4MzhkNTgzMGM4NzZmODdmOWUyOGVmZjRiNDA5MTEzZjcyZWFlZTMyNjgyYjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.meoVesPmw0l7Rw9V_8XNj_1M62SHJ1iLXpDCWypcnKY)
-
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