Pages: [1]   Go Down
Author Topic: Help: Increasing sensitivity of a Piezo Sensor  (Read 1965 times)
0 Members and 1 Guest are viewing this topic.
Maryland, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
}
_____________________________________
Logged

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Maryland, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Maryland, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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.

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

Maryland, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

DC and Alx,
  Thanks again for the reply.

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

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


Logged

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

Pages: [1]   Go Up
Jump to: