Posts Tagged ‘arduino tutorial’

How to use a piezo element as an arduino sensor

Friday, November 2nd, 2007

Piezo sensor

A bare piezo element makes a really cheap force sensor .

This example uses two piezo elements, back to back, with an o-ring in between.

Solder wires to the piezo element, one to the center piece and one to the rim (or one on each side - the rim and the back are the same).

Connect the center to an analog input on your arduino - pin 0, say. Connect the rim to ground. To get better readings, you should connect a fairly large resistor in parallel, from the analog input to ground. This acts as a pull-down resistor and stops some noise. If you’re just going to use the piezo element as a “knock sensor”, a resistor of about 1 kOhm is ok - for a wider range of reading, you will need a bigger resistor. (Perhaps this varies with the exact make of your piezo element as well)

We put two piezo sensors back to back with a rubber ring in the middle, and then put the whole thing inside a large shrink tube. This gave us a nice force-sensitive push sensor the size of a coin and a few millimeters thick.

We ended up using a 820 kOhm resistor. This gave us full range input when we pushed on the two sides of the cylinder.

Piezo sensor diagram

To read the values in the Arduino, just use analogRead.

Examples of components similar to those we used:

  • bare piezo element: Murata 7BB-12-9, Farnell #1192550
  • elastic o-ring with a diameter a little smaller than the piezo element. From your hardware store. In Sweden: Clas Ohlson #31-1704
  • Arduino board or other microcontroller with analog input