i'm new to arduino and have very little knowledge of electronics. i would like to build a sensor which measures the loudness of tabletop soccer goals and thought the knock sensor example (arduino.cc/en/Tutorial/Knock) would be a great starting point but i just can't get it right.
i tried the melody sketch first, to make shure my piezo element works – and i does. unfortunately i don't get any input when i try using it as a sensor.
my setup: i connected the black wire of the piezzeo element with ground and the red wire with analog pin 5. I also connected the two wires of the piezo elemen with a 1 megaohm resistor (i think that's a parallel connection) on the picture in the example the resistor was connecting analog pin 5 and the ground pin next to the 9V pin – i tried that as well but it didn't work either.
i used the example input sketch which came with the arduino library for processing to check the analog input values (worked fine for reading a potentiometer) but didn't get any results for the knock sensor.
i think the problem must be something with the resistor. in the example it says "We also have to connect a resistor in the range of the Megaohms in parallel to the Piezo element". is one Megaohm too little resistance? or did i get the connection wrong? how do i figure out what iss the correct value for the resistor?