How can I convert the piezoelectric sensor output to Hertz?

Hey guys, I have a piezoelectric vibration sensor hooked up to my arduino. Here is the exact model:

I am trying to figure out a way that I can convert the voltage produced by the sensor into Hertz.
I'm pretty new to arduino so I'm not sure if this is possible unless I have a special Voltage - frequency chip. Any help would be great!

Here is my code:

void setup()

void loop()
int val;
Serial.print("Vibration is ");
Serial.println(val,DEC);//Print the analog value read via serial port

As per the link you gave, the sensor returns an analog voltage based on the intensity of the sound or vibration of the piezo. I don't see any relation of that signal to frequency, do you? Are you wanting to use a table lookup of frequencies based on the analog value?


Please describe what you have in mind for the relationship between voltage and Hz, and what you would do with the value in Hz.

To find a frequency you have to sample the waveform. The signal strength of a piezo is primarily related to the amplitude of the force applied to it, not the frequency.

I'm going to make a WAG that the OP's intent is to measure the frequency of some sound which is picked up by the piezo transducer. This would theoretically be possible for simple, clean waveforms, by measuring the number of times per second that the piezo output goes over some threshold. Tricky code might be able to auto-adjust that threshold, but at the outset I'd just look to have the Arduino reliably find the peaks, perhaps lighting an LED each time. You'd look for the situation when the LED is neither fully off nor fully on (or use an oscilloscope to monitor the output). The frequency range of this approach will be seriously limited by the conversion time of the Arduino ADC.

Taking it literally, it seems like he is after voltage-controlled oscillator, the sort of thing found in an analogue music synthesiser. Maybe they are still around.

Would this do?

Well, how about that, and all for $2.95. To think of the time I spent finding the parts and making it in 1975.....

I am trying to figure out a way that I can convert the voltage produced by the sensor into Hertz.

Are you intending to use the sensor to measure a vibration frequency? So you would want a display on the serial monitor in Hertz?

Or do you wish to use the sensor to trigger a sound of some description where the frequency (in Hz) is dependent on the amplitude of the signal picked up by the sensor?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.