Project Description #
This assignment implemented a complete data‑driven pipeline that recognises four distinct body motions—stationary, walking, running, and a newly added “jumping” class—using raw three‑axis acceleration data from an LIS3DH MEMS sensor. The sensor is interfaced to an STM32F042K6 microcontroller via SPI, and the board’s built‑in Bluetooth‑Low‑Energy (BLE) radio is used to stream the 1000‑sample recordings (sampled at 25 Hz) to a host PC for offline analysis. The software side utilizes a low‑level SPI driver, EXTI‑based data‑ready interrupt handling, and BLE communication stack. A publicly available dataset of 112 recordings (28 per class) was loaded, normalised, and split into training and test subsets (75 %/25 %). A lightweight 1‑D convolutional neural network was defined in TensorFlow/Keras, trained for 30 epochs, and achieved a test accuracy above 99% with a loss under 0.03. The trained model was then exported to TensorFlow Lite (.tflite) and saved in both the standard Keras format and the lightweight format for deployment on the microcontroller.All steps, from data collection through model conversion, are documented in a Jupyter notebook that visualises sample recordings, model summaries, and confusion matrices. The project demonstrates how a BLE‑capable embedded sensor can be turned into an on‑device human‑activity classifier while keeping the on‑board inference footprint small enough for real‑time operation.
My Role #
Working together with a teammate, I was responsible for bridging the hardware acquisition layer and the machine‑learning pipeline. I extended the existing SPI‑based driver to configure the LIS3DH for a ±2 g full‑scale range and a 25 Hz output data rate, added the EXTI interrupt that signals data‑ready events, and integrated the BLE stack so that each 1000‑sample record could be transmitted to the development PC without a wired connection. On the software side I curated the new “jumping” dataset, wrote a Python routine to trim the pre‑jump idle period by discarding samples whose Z‑axis deviation stayed below 150 mg, and updated the label list and the final dense layer of the neural network to handle four output classes.