troubles with knock sensor (wrong resistor?)

hi!

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?

cheers, pt

The resistor is probably fine, but the sensitivity of an un-amplified analog sensor like this will be low. You may need to amplify the signal from the piezo sensor before feeding it to the analog input. An op-amp (e.g the LM3900 quad op-amp) wired up as a non-inverting amplifier would be OK. Search for op-amp and non-inverting amplifier circuits, and see what you get.

thanks for your answer anachrocomputer!

i searched for op-amps and non-inverting apmlifiers and learnded, that the signal gain is determined by the use of two resistors with different resistance. unfortunately i have no idea of how much gain i need and which resistors i should use. can you help me out please? it doesn't seem to matter which op-amp i use, right? i found some for abour 30 cents.

Well, resistors are cheap, so why not get a few extra ones! Aim for gain values of 5, 10, 20 maybe as much as 50. If you have any test equipment, see if you can measure the voltage produced by the piezo element, and work out the gain needed to reach 5V. Trouble is, you may need an oscilloscope or even a storage scope.