Awesome
HallSensor RPM meter using Machine Learning with EdgeImpulse
The project is a section of the training course "Introduction to Embedded Machine Learning", by Shawn Hymel, the main instructor in collaboration with Edge Impulse
Intro
I chose a simple 12v fan for measuring the rotational velocity in 4 states (OFF, LOW, MED, HIGH), for achieving that I attached a magnet on a blade of the fan and I added up a hall sensor for measuring the magnetism when the magnet gets closer to the sensor.
Here I used an ESP32 as a functional microcontroller for obtaining the hall sensor values and collecting the data, using some filtering techniques and data synthesis inside of the code in the microcontroller I obtained different waveforms in those 4 states(see DataForwarder_HallSensor.c)
I used the Edge Impulse Data Forwarder which helped me to connect the ESP32 directly to Edge Impulse, I collected almost 4 minutes of data dividing equally each label used. Then I created my impulse using spectral features where at the beginning I obtained some random points in the plots, then I understood that my samples are not too repetitive through the data sample, so I had to modify my window size to a big one to adjust the period of the signal, after struggling with the period of the data, I obtained some interesting forms in my feature explorer window.
Once I got the spectral features, I proceeded with the NN classifier using two layers with almost 15 neurons in total (5 neurons on the first layer and 10 neurons on the second layer). obtaining a pretty accurate model.
I understood that different data samples might have some crucial characteristics to regard while analyzing the signals, in my case, the period of the lower and medium signals have affected my results in the beginning, finally, I applied the anomaly detection into the project and after programming the microcontroller I identified that it detects accurately the different states of the fan and it detects anomalies when I turn the fan manually with my hand.