Programming Piezo Vibration Sensor

Hey guys,

My name is Bryant and I am senior in high school. I am enrolled in a four year engineering program called Project Lead the Way and for senior year, we have to create a product that solves any problem in the world. Well, to save some time, my partner and I decided on creating a volleyball tile that senses whether the ball landed inside the court or outside. We were thinking about using Piezo Vibration sensors to detect the impact force and the time of this impact force. This way, the sensor would be able to distinguish between a volleyball and a human stepping or sliding on the tile.

So I was wondering if anyone is familiar with these Piezo Vibration sensors and if anyone could help us out on the programming? We have no knowledge on programming and are hoping to learn a lot about Arduino programming.

We greatly appreciate any help we can get!

Thank you very much!

Bryant Holland :% :.

Do you mean piezo disks used for acoustic pickups?

A couple of years ago I started with the circuit shown in this video:

And adopted it to trigger a transistor through with 5V through 2200 ohms to the collector since pounding a piezo will produce more than 5.5V. Then I split the diode-rectifier up to get separate signals for tap and release.

Think of a piezo as a capacitor with special properties. If you stress it, it will charge. If you put voltage across, it will bend.

You need to determine time and strength of events through testing. How you make and support your tiles will matter. My guess is that the human will not be so fast as the ball but your group had better have notes backing all your choices.

Good Luck.

I'd look at frequency content, and amplitude. As a guess, I'd say a volleyball bounce is going to have higher frequency contact, but that a footfall with have much higher amplitude at lower frequencies.

Build one sensor circuit. Mine loaded a charge on the wire to a digital pin that I read until it went from HIGH to LOW in 10's to 100's of usecs depending on if I just touched the bare disc to smacked it with a screwdriver handle. The act of digital read draws a very small bit of charge off the wire and my read loops run about 1 usec each. I count loops, not micros().

The charge/time could be adjusted a few different ways including the choice of diodes, mine have the 0.7V threshold while Shottkeys have 0.3V (those are nominal values), and what current the NPN transistor collector is fed.

For each piezo lead there should be one diode pointing from ground to the lead and one from the lead to whatever you feed to the pin. You must protect the pin. In my case the transistor collector input did that and the result was a kind of RC circuit between the wire and the high impedance pin reads.

You might get a frequency out of the tile if your circuit doesn't mush it. Sensor under the tile, you may not have to worry about overvolting a pin. That's something to test and design to.
If you don't want a wire to charge, add a lead to ground through maybe 10k ohms to the wire or pin. You will only get the vibration, not the strength on a digital pin. Note that a 10 bit analog read takes 105 usecs so if you have to use analog, use 8 bit fast analog.

Other things:
Don't use floating point if you can help it at all. Don't use String or Container class objects. AVR's are not suited to those things. They don't have FPU's or much RAM at all.
For decimal values, it's better off to use smaller units and integers. Meters to 3 places are millimeters. It takes a bit of thinking but the speed difference and accuracy (Arduino floating point is ALL 32-bit and s-l-o-o-w-w-w-w-w).
It's also better not to print when anything time-critical is going on.

This page describes using piezos to detect hard/soft/rim hits on a drum.

Good link.

If you are looking for a vibration sensor to detect movement in close proximity I got a piezo element working nicely with an op-amp and comparator in a high sensitivity vibration sensor using Arduino Uno. More on my blog at Internet of Things: High Sensitivity Vibration Sensor Using Arduino

If you are looking to differentiate between spurious bumps vs other vibration events you may also be interested in this enhanced version of the circuit
Internet of Things: How to Avoid False Positives with a High Sensitivity Piezo Vibration Sensor . The example sketch can screen our spurious bumps that can lead to false positives. You could build on this circuit to further differentiate the various types of vibrations eg footsteps vs volleyball. Have fun.