After researching around, I found another useful tutorial on piezo elements at the Arduino website (Arduino Knock Tutorial). Since our class just learned how to make LEDs blink using the Arduino (Thanks Todd!), I modified the code just a little bit to incorporate both the piezo knock and LED blinking light.
In the first part of this circuit, I attached my bare piezo disc (along with a 1 MΩ resistor to limit the voltage and current drops) to the analog input pin A0 and ground. After, I wired up a 220Ω resistor from digital pin 13, along with a pink LED to ground.
Sadly, this third part was the most frustrating thing I’ve dealt with all day. Apparently, when I tried to type “sensorReading = analogRead(knockSensor),” I needed to watch what my pinky finger actually pressed on the keyboard… – is not the same as = and it took me nearly 20 minutes to catch that error!
After that tiny mishap, I verified the code and uploaded it to my Arduino. Here is a screenshot of the code:
At first, I set the threshold to 100 and I realized that the piezo wasn’t as sensitive, as seen here with my kitten :3
So, I decided to change the threshold to 75 and it was successful.
After reviewing in class this past Thursday, I learned that capacitive-touch and piezo-based-touch were two completely different things. Oops.. So, I did more research on piezoelectricity and piezo discs (because I already have a few in hand) by researching through a few different websites and YouTube videos. I tried to look in the Art of Electronics to see if I could find anything, but there wasn’t much. I did, however, find the dictionary meaning of piezo. The word is derived from the Greek language to mean “to press” or “to squeeze.”
Continue reading “Piezos and Project Update”
For my project this spring semester, I decided that I wanted to do some type of capacitive-touch drum kit or piano set and it eventually led to discussions about trying something out with MIDI.
I just learned how to program a “basic” key of C 8-octave piano keyboard with tactile buttons and a piezo buzzer with my Arduino (in the picture below), so it led me to look at the options of doing MIDI with the Arduino. Here’s a link to the page: https://www.arduino.cc/en/Tutorial/Midi.
I also found this Youtube video on MIDI (Collin’s Lab: MIDI) and it definitely helped explained the basic facts that I need to know and get started.