I am moving on to the next component of my project: a buzzer that is controlled by a triple-axis accelerometer which can detect tapping and a SparkFun pro micro. As I mentioned before, the small vibration motor can cause spikes in voltage that could potentially be dangerous for the microcontroller. I did some research and found this circuit as an example of how to build in a filter to prevent that disaster from happening:
From this website: http://learningaboutelectronics.com/Articles/Vibration-motor-circuit.php
I’m in the process of collecting the materials I need to make it happen, like the diode and capacitor.
For the accelerometer, I have found a nicely organized library written for the ADXL 345 I have and it has made the code for the accelerometer pretty accessible. The Bildr blog tutorial introduced me to this library, which has handy methods for calling the different functions of the accelerometer including freefall, tap, double tap (seen above), and of course, change in angle.
Bildr tutorial with ADXL345 library: http://bildr.org/2011/03/adxl345-arduino/
So…. that’s working on its own. Now I just have to make it work with the motor. I am also drafting some versions of a 3D-printed casing for this component, and am especially concerned with creating a housing that will allow the motor to cause an audible amount of noise. This is supposed to be the percussive feature of my project, so the design of this piece must suit that raucous purpose by creating a space in which the motor will react against the material to create the sound.