piezo knock

hi

ive received an arduino decimilia in the post.

what i am trying to do is to recreate the piezo knock example shown at http://webzone.k3.mah.se/projects/arduino-workshop/projects/arduino_meets_processing/instructions/piezo.html

So far just using the arduino example code (not processing yet)

I have the piezos and 1k resistors but after compiling & uploading to the board I look at the serial monitor and recieve A LOT of 'knocks' without actually touching the piezo.

I know the equipment is fine because i have successfully used it to output a musical riff through the piezo.

all advice much appreciated!!

regards mike

after removing the resistor and piezo from the board i am still recieving the knocks! - weird...

in the tutorial i posted, the picture suggests that the piezo is going to pin 5, whereas the code suggests pin 0. ive tried both to no avail.

also, my aim is to have 2 piezos sending the arduino data when they are struck, possibly increasing to 4 piezos time permitting. I know VERY little about electronics - can someone tell me is there a limit to the number i can interface with the arduino?

thanks

I had the same problem this morning and unfortunately I can't remember how I got around it :P

A checklist (in order) - Red (+) of the piezo going to pin 0 - Black (-) of the piezo going to gnd - 1 MOhm resistor plugged into both (it should probably be plugged in second, as it tends to be thicker than the piezo wires)

Also try: - Raising/lowering the int THRESHOLD value - Making sure everything is connected right (check and double check!) - Remember to upload the sketch when you make changes to your code

I think your problem might be just that you might have 0 and 5 mixed up still. Try switching them again, both on your board and on your code.

that is totally weird that they have specified a 1K resistor, it should be at least 100K, and more like 1 mega-ohm.

Try that and see what happens. 1K is just going to completely drain away the tiny signal given off by the piezo. In my expereince you need the resistor to drain away the piezo signal from the high-impednace ( i.e. very sensitive, extremely low current) input pins of the Arudino. If that "drainage" isn't set up properly, the piezo generates electricty but the electricity is not dissipated, leading to continuous "knocks". So there is a balance to be struck between too little resistance and too much. I usually use 1M , and it works perfectly.

D

Try that and see what happens. 1K is just going to completely drain away the tiny signal given off by the piezo. In my expereince you need the resistor to drain away the piezo signal from the high-impednace ( i.e. very sensitive, extremely low current) input pins of the Arudino. If that "drainage" isn't set up properly, the piezo generates electricty but the electricity is not dissipated, leading to continuous "knocks". So there is a balance to be struck between too little resistance and too much. I usually use 1M , and it works perfectly.

Interesting. Good to know!

As for your second question: I don't see why you couldn't have one on each analog input pin if you wanted. The instructions for the tutorial have you attaching the resistor in parallel with the piezo. I believe this would work with multiple piezos as well.

appreciate the advice. the 1m resistor did the trick. maplin arent the best shop for stock though. any uk people recommend an alternative for general components?

kind regards mike