This repository is an example how to use tensorflow with a microcontroller.
The example is using a GY521
sensor to detect and recognise standing, walking and running.
The code can recognise and also collect new data to a SD card. Everything is visible on a simple SSD1306 OLED display.
The current model is currently not correctly trained. Because this is just an example i haven't collected enough data.
Please check on every update if the output by train.py equals the array ACTIVITIES
in main.cpp
. The indexes must match! Also check if the features are in the correct order.
data
- this directory is for the data processingprocessed
- output directory fortrain.py
model_data.cpp
- tensorflow lite model auto generated bytrain.py
raw_data
- this directory holds all raw data collected by the microcontroller*.csv
requirements.txt
- python module requirementstrain.py
- python code to generate a tensorflow model
src
- microcontroller codeNeuralNetwork.cpp
- Tensorflow lite Wrapper by @atomic14main.cpp
- main arduino framework code
To get the newest tensor flow lite library for the Arduino framework just visit this repository and download the newest tflite-micro
folder.