This project is a simulation of a drum set using an Arduino Nano and the BNO055 IMU sensor. It allows users to play drums without a physical drum set. The project is primarily developed in C for a course requirement that emphasized writing all libraries from scratch.
- PlatformIO in VScode (or whatever you like)
- Arduino Nano with Atmega328P (new bootloader)
- BNO055 IMU
- Clone the repository.
- In VScode with PlatformIO, upload the C code to the Arduino Nano.
- After uploading
main.c
, execute theplay_sound.py
to get audio output. - To calibrate, swing the drumsticks in a figure eight motion and then press the button with the drumsticks pointing away from you.
- The
collect_data.c
under MAINS pairs withcollect_data.py
to log IMU data to a .txt file for analysis. Theplot3.m
matlab file plots the data but you could use whatever program you like. - The project also includes foundational C++ code under CPP but this code is really bad in its current state. I began testing the hardware in C++ before refining the method of simulating the drum set in C.
- The latency is not bad but it can be decreased. The python program playing the samples can probably be improved.
- The conditional logic for determining which sound to play in “main.c” can be fine-tuned and optimized. Currently it is tuned to my left handed playing style.
- Velocity sensitivity can be added if desired. It requires changing the way communication is handled between the arduino and the python program.
- Include more error handling.
- Enhancements or replacement of the custom libraries I created could improve the project's maintainability.
Contributions are welcome! Feel free to fork the project, make changes, and submit a pull request.
For queries or collaborations, reach out through GitHub issues or email arnihafthor@gmail.com.