• Toothbrush timer using accelerometer and ML

    Jon Nordby01/04/2025 at 16:18 0 comments

    I recently made an automatic toothbrush timer, using an accelerometer and a microcontroller. It is intended to be a fun and practical example for the emlearn-micropython machine learning library.



    Below is a quick demo of the gadget in operation:

    The project is available at: https://github.com/jonnor/toothbrush/
    You will find there the software, firmware, data, ML training pipeline and 3d-printed parts.

  • Human Activity Recognition using MicroPython and emlearn

    Jon Nordby01/04/2025 at 14:07 0 comments

    There is now an example project in emlearn-micropython for doing (human) activity recognition using accelerometer/IMU. It can be found here: https://github.com/emlearn/emlearn-micropython/tree/master/examples/har_trees
    Example applications of human activity detection could be sleep tracking, overall everyday activities' classification (sitting, walking, running, etc), exercise tracking (can be specific exercises like jacks/lunges/pushups/etc). Since machine learning is dependent on datasets, what exactly we will be able to do is of course a bit dependent on what datasets we are able to find and/or gather.


    The feature extraction code is in MicroPython, but it could easily be ported to C. The classifier used is Random Forest, and that is implemented in C using the emlearn C library.


  • emlearn-micropython - Machine Learning and DSP for MicroPython

    Jon Nordby01/04/2025 at 13:17 0 comments

    emlearn-micropython is a Machine Learning and Digital Signal Processing library for MicroPython. It enables MicroPython applications to run efficient Machine Learning models on microcontroller,
    without having to touch any C code. It builds on the emlearn C library and exposes a set of small, independent MicroPython modules. The modules (as .mpy files) can be installed at runtime, using the MicroPython package manager "mip". This aims to enable a user experience that is just as convenient and powerful as we already have on standard (C)Python, for microcontrollers.

    Here is the first presentation on this library.

  • emlearn - a scikit-learn for microcontrollers

    Jon Nordby01/04/2025 at 11:53 0 comments

    emlearn is an open-source library for implementing. It allows to convert models trained with Python (using scikit-learn or Keras) into portable C99 code.
    Here are two presentations that introduce the project. The first is very short and concise, where-as the other is a bit longer and detailed.