Go Down

### Topic: Help: Increasing sensitivity of a Piezo Sensor (Read 7420 times)previous topic - next topic

#### Thot

##### Oct 30, 2012, 05:14 am
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() {
Serial.print(val);
Serial.write(10);
Serial.write(13);
delay(50);  // we have to make a delay to avoid overloading the serial port
}
_____________________________________
There are three kind of people in the world: Those who can count, and those who can't

#### dc42

#1
##### Oct 30, 2012, 11:20 am
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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### Thot

#2
##### Oct 30, 2012, 11:16 pm
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

There are three kind of people in the world: Those who can count, and those who can't

#### dc42

#3
##### Oct 30, 2012, 11:28 pm

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.

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.

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### Thot

#4
##### Oct 31, 2012, 12:25 am
Boy, that was FAST!

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
There are three kind of people in the world: Those who can count, and those who can't

#### dc42

#5
##### Oct 31, 2012, 08:49 am
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
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### AlxDroidDev

#6
##### Oct 31, 2012, 12:24 pm
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.
Some of my projects:
Shield for DS1337+, DS1624 and AT24C1024B (RTC, temp & mem): http://forum.arduino.cc/index.php/topic,126197.0.html
CHDK Camera remote shutter (BT, IR, USB): http://forum.arduino.cc/index.php?topic=295377.0

#### Thot

#7
##### Oct 31, 2012, 01:54 pm
DC and Alx,

>>>- a sensitive strain gauge
Did not think about it, it does sound like a good option.
Something like this?:  http://www.digikey.com/product-detail/en/CEA-13-125UN-350/1033-1016-ND/2503707

>>> 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....

>>> 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

There are three kind of people in the world: Those who can count, and those who can't

Go Up