Last month, I was able to 3D print a shaft that fits both onto the nema motor and the ukulele. The slot design was much easier to design and implement. I also verified that the motor has enough torque to turn the strings. Once getting the more hardware-y components out of the way I started testing out different sensors to see which one would work the best for detecting frequency of my ukulele.
I started out with a large piezo vibration sensor from adafruit, but the output I was getting was weak and not very detailed, even when I tried changing the circuit by using different combinations of resistors. I was however, able to write some code that made the motor rotate 360 degrees in both directions when a vibration was detected, which is the most basic version of what I want my project to end up being. These sensors are better for absolute thresholds or detecting knocks rather than a specific vibration of an object.
My teacher suggested another type of sensor to use, an electret microphone. (specifically the Max 9814) At first, I was against the idea, as I wanted my input to be solely vibrations. But since I was having so much trouble getting usable data from vibration sensors, I decided to give it a try. The microphone actually had quite a lot of perks. For one, it dims sounds that come from further away and amplifies closer sounds, which helps with my initial worries of surrounding sounds interfering with data collection. The signal from this sensor is also stronger due to a built in op-amp, so I didn't need to create my own circuit since it was all built in.
Now that I have a sensor that gives good output (still debating on buying another version that's simpler and easier to use), I am now working on the most difficult aspect of this project: the code. Specifically, the FFT (Fast Fourier Transform) code that does all the work of determining the frequency of incoming raw data from sound/vibration waves. It's much easier to run FFT on something like Python or MATLAB, since arduino is more limited than those languages. However, libraries for FFT on arduino exist, and I'm currently trying to figure it all out or maybe write my own. It's very complicated, but I'm sure I'll figure it out.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.