# Help: Increasing sensitivity of a Piezo Sensor

Hello, I'm VERY new to Arduino and I am trying to implement a breath sensor using a Piezo and the setup in this tutorial:

http://www.arduino.cc/en/Tutorial/KnockSensor

I simplified the code so that it dumps on the serial monitor any values coming in: 0 if I am not blowing, >0 if I am blowing on the sensor: The problem is that even if I blow very hard, I am not getting values greater than about 120.

Question: How do I take advantage of the whole resolution of the analog input (1024 if I am not mistaken) so that I get 0 if I am not blowing and 1024 if I am blowing the hardest?

Shall I decrease the value of the resistor in parallel (currently 1 MegaOhm)? I hesitate just to try because I understand that the piezo can deliver high voltage (up to 90 V or so) and I don't want to fry the Arduino.

TIA

Luca

P.s. The code I am using (modified from the tutorial) is:

int ledPin = 13; int knockSensor = 0; byte val = 0; int statePin = LOW;

void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); }

void loop() { val = analogRead(knockSensor); Serial.print(val); Serial.write(10); Serial.write(13); delay(50); // we have to make a delay to avoid overloading the serial port }

There’s a reason it is called a knock sensor. Blowing on it doesn’t give the sharp impulse that a piezo responds best to.

Increasing the value of the parallel resistor will increase the sensitivity, decreasing it reduces the sensitivity. If you’re worried about damaging the Arduino, put a 100K resistor between the piezo and the analog input pin.

Hey dc42, Thank you for the quick reply!

So if I replace my 1 MOhm resistor with, say, a 2 MOhm resistor I will increase its sensitivity (double?). Will that also protect the Arduino better or the higher the parallel resistor the more the need for the 100 KOhm resistor in series?

And, on a related topic, if a piezo is not ideal for detecting, actually measuring, breath velocity, what other sensor would you recommend?

Thanks

Luca

Thot: So if I replace my 1 MOhm resistor with, say, a 2 MOhm resistor I will increase its sensitivity (double?).

The sensitivity will probably increase, but not as much as double. There is a law of diminishing returns.

Thot: Will that also protect the Arduino better or the higher the parallel resistor the more the need for the 100 KOhm resistor in series?

A parallel resistor as high as 1M gives he Arduino little protection. If you hit the piezo with a hammer, maybe you will damage the Arduino, but it's unlikely otherwise.

Thot: And, on a related topic, if a piezo is not ideal for detecting, actually measuring, breath velocity, what other sensor would you recommend?

Do you mean detecting a person breathing lightly, or a blowing hard through a tube? For the former, perhaps a sensitive strain gauge would work better. For the latter, I suggest a turbine attached to a rotation sensor.

Boy, that was FAST!

dc42: Do you mean detecting a person breathing lightly, or a blowing hard through a tube?

Something in between. I am trying to build a MIDI breath controller that will respond to blowing in a tube open on two sides, more like a transverse flute than like a clarinet (which is a tube open on one side) and which is the model for commercially available breath controllers (the clarinet, that is).

If I can reliably detect the presence and velocity of the air blown I am half done. The sensor does not have to be linear, as long as the response can be manipulated via software I am fine.

Thanks again

Luca

A piezo reacts to changes in movement, so it would not be good for detecting a long steady breath. Here are some ideas for sensing breath:

• a sensitive strain gauge
• measuring the change in resistance of a fine heated wire
• having the breath deflect a conductive vane, and measuring the capacitance between that vane and a nearby conductive plate

What about one of those small & cheap barometric pressure sensors?

Can't the increase in pressure in the tube be measured by it? After all, the pressure in the tube has changed.

DC and Alx, Thanks again for the reply.

measuring the change in resistance of a fine heated wire This is the principle in an hot wire anemometer, right? I was looking at this option: http://shop.moderndevice.com/products/wind-sensor

having the breath deflect a conductive vane, and measuring the capacitance between that vane and a nearby conductive plate I am not sure I understand this.... :blush:

What about one of those small & cheap barometric pressure sensors? I thought about that, my impression was that a barometric sensor was not fast enough to get the pressure changes you have if you blow in a tube, but I may be wrong Something like this?: http://www.karlssonrobotics.com/shop/barometric-pressure-sensor-bmp085-breakout-retired/?gclid=CLrhvrigq7MCFQqe4AodzScAqA

I was also looking, following suggestions given in similar topics, at microphones, to detect the noise you make when blowing, though in an electronic wind instrument you are not suppose to produce sound directly, but to use your breath as a controller for the software to actually play sounds: Either this: https://www.sparkfun.com/products/9964 or this: http://robosavvy.com/store/product_info.php/products_id/626/currency/USD The latter seems to respond better to noise volume than the former, according to posted comments

Your thoughts are greatly appreciated, thanks.

Luca