piezo tutorial

i have read every piezo tutorial and tried thiso ver 10 times over the past 1 year... i simply cannot get it to work!

piezo, red wire connected to analog pin. black wire connected to ground. 1k resistor running from red wire, and/or analog pin to ground. i get back a serial display of 0's. when i disconnect the resistor i seem to get a little pulse ( goes from 0..0...0..0..0 to 0..0..67..68..0..0..0.. ) over and over, but still nothin correlating to my knocks. what could i be doing wrong? i tried this with several piezo's, some enclosed, some freed from their plastic holders, all however relate in the fact that they won't work!

are ther specific piezos' you must use? certain sized or voltaged ones? mine seem standard...

Had this same problem, for one thing, make sure you're using a 1 MEGohm resistor, not the 1-Kilohm you mentioned. I didn't get this working until I used a bigger piezo (from...sigh...RadioShack), but the 1Mohm did it for me.

The 1K is a mistake make it bigger.

Are you knocking directly on the sensor?

The other thing is that the spike is very short from these sensors so your software could be missing them while it is printing out your zeros. To hold the voltage a little longer put a 0.01uF capacitor across the analogue input. The with the software just sit it in a loop doing the reading of the analogue port and only print something out when it exceeds a certain threshold like 60.

Did you try this code:

http://todbot.com/arduino/sketches/midi_drum_kit/

Circuit described i one of the clas notes here:

http://todbot.com/blog/spookyarduino/

it's still giving me pulses! why are the pusles going??? what are the pulses? isint it just sapposed to be one signal? i tried the capacitor, i tried the megaohm resistor, i made sure i have the right connections a million times... i don't get why this is so hard, its sapposed to be so simple!! i make servo's work, i even made a code for half of the psarkfun button pad but i can't get this dinky little piezo working... this is very aggravating...

it's still giving me pulses!

Yes it will

isint it just sapposed to be one signal?

No

A piezoelectric transducer only gives a voltage as it is being deformed. It is the change in deformation that is a voltage. Think about it, suppose it gave a voltage output if you simply put a weight on it then it would be a free battery giving out power all the time. You would be getting something for nothing and although that works if you are a banker in the real world physics says you can't do that.

but my problem is that it won't give me some kind of change weather im knocking, or banging it, or doing anything/everything to it. it just gives me the regular pulses, with no change, no mater the condition. even the capacitor to hold the possible spike doesent seem to do anything ( i think it holds the pulses for a longer amount of time, but doesn't help me see a "knock"

to be sure my setup is:

piexo ground connected to arduino ground, piezo vcc connected to analog pin. resistor connected directly from pin to ground. and when i included the capacitor, then i had it hooked up the same way, except i connected the piezo vcc to the capacitor, then to the pin, with the same resistor. correct?

it just gives me the regular pulses

That bit is a puzzle, there should be no pulses produced by the transducer when you wire it up this way and don't bang it. Can you explain more about what you mean by this, it might be the clue into what is going wrong.

yea, sure. so i have the setup i described in my last post, and the arduinos serial box displays something similar to this over and over:

0
0
0
0
0
66
68
68
67
50
0
0
0
0
0
0
67
68
66
68
0
0
0
0
0
0
51
67
68
69
67
66
0
0
0
0
0
0

I'ts strange... and when this happens, it doesn't change weather i let the piezo be, or if i hit it, still same result. Sometimes when i try to shove the ground into the arduino pin further, it just types out all zeroe's without the pulses, but when i bang on the piezo, the zeros don't change, so that doeent fix it.

Can you think of why i would get thus pulse?

That does look like mains pickup how far apart are the peaks? If they are about 20ms apart (for 50Hz) or 16mS apart (for 60Hz) or double this then it is defiantly mains.

This normally happens when the analogue input is left floating and will go when there is a 10K or so resistor across the analogue input to ground. I know you say you have done this but this result strongly suggests that there is no connection between what you think is ground and what the arduino is actually taking as ground.

i will re try this with sturdier connections, and i will post back with my results, orry i would do it this second but im swamped with work! thank you saoo much for the help, atleast its something to go on haha!

Piezo only gives pulse when pressed or depressed, short short short!
Industrial Piezo relies on the fact that the resistance changes when pressed, so they are fed voltage! and the resistance is mesured and converted to an analog signal usually in the 4-20mA range or 0-5V. most usually the amperage is mesured. 0-4mA is faulty line or error, 4-20mA is signal.

D.