Electronics II: Using micropython & an IMU (intertia measurement unit) with questionable accuracy combined with beat detection algorithms to make a miniature segway dance to Bollywood music.
This was one of the more engaging and enjoyable projects we have done in my course in the “Electronics” category. After 7 weeks of labs experimenting with MATLAB, micropython, and the whole interface of using serial port communication to control the functions on an external microprocessor, the practical aspect of the module concluded with this fun project – yes we still have a theory based examination worth 60% of the class but still.
Each lab session we used the readings from an accelerometer & a gyroscope (combining them using a complementary filter to make up for the noise in accelerometer readings and drift errors from the gyro) to work towards a self-balancing program that would use motor/PID control to correct the segway when it started to go off-balance. This was combined with a beat detection algorithm using the built-in microphone and instantaneous energy readings to choreograph a set of dance moves to a song of our choice. My wonderful professor, Peter Cheung, has an open source website here as well which explains everything much better than I ever could.