Brushing one's teeth is quite boring... And how looong is 2 minutes anyway? Spice things up using this gadget, which uses accelerometer and machine learning to track the time you are actively brushing.
This project is intended to be a fun and simple example of using machine learning on microcontrollers, in the area of Human Activity Recognition.It was designed as a demo project for emlearn-micropython, a Machine Learning and Digital Signal Processing library for MicroPython.
See it in actionHow it is made
The device continually analyzes the accelerometer data. The overall process is illustrated in the following diagrams:
Since the input data is an infinite continious stream, the data is cut into short fixed-size windows, which are processed and analyzed independently.
We collected data from several toothbrushing sessions. This was annotated to indicate which time has actively brushing and not. Using this labeled data, we could train a machine learning model that can classify this activity.We used the training recipe found in https://github.com/emlearn/emlearn-micropython/tree/master/examples/har_trees
Constructing the deviceYou will need to 3d-print the toothbrush holder. The files are provided in the attachments, and are included in the Github repository.
You will also need to have the M5Stick C PLUS 2 device at hand.
Here are the assembly steps
- Position the toothbrush in upper half of the base.
- Attach toothbrush using zipties. Tighten them well, using pliers
- Snap the lid onto the base to cover the toothbrush
- Use double-sided tape to put the M5Stick in lower half of the base
You will need to first flash MicroPython, then copy the firmware and its dependencies onto the device. An USB-C cable is neccesary.
Instructions are provided in the jonnor/toothbrush repository
Comments