Block negative voltages

Hi everybody!

I am currently designing a project in order to record respiratory data throught a piezoeletric sensor.
I have projected the circuit in order to have positive voltages (summed a DC component), but it doesn't quite protect my arduino since it can still reach negative voltages.
The circuit I have designed is

and the output I get, testing with a sin is

What can I add to my circuit in order to unsure that I NEVER have negative voltage?

Thanks! :slight_smile:

A diode?

...R

Yeah, but how can I set that?

diogotec:
I am currently designing a project in order to record respiratory data throught a piezoeletric sensor.

That circuit "loads" the (unknown) piezo with 10k (the other side of the 10k resistor is virtual ground).
The piezo/10k is a high-pass filter with a high corner frequency.
Low frequencies, like breathing, are removed.

Connecting the piezo directly to a (high impedance) analogue pin might be better.
Arduino has internal protection for negative voltages (if the current is kept low).
Tell us more about your project and piezo. There might be other solutions.
Leo..

Hey Wawa, thanks for your reply!

My project consists of a cough detector belt (consisting of a piezoeletric sensor taken out from a greeting card) and also as a respiratory belt.

As the signal is small (~500mV) I wanted to amplify it (that is the reason why I'm not connecting it directly into the arduino). However if I press the sensor with my finger (withoug amplification), it can reach like 2,5V (so that, with amplification, it can be higher than 5V and lower than 0V).

I didn't understand what you said about the circuit working as high-pass filter since I am not an expert in instrumentation and eletronics

500mV could be more than enough.

I think a 1" piezo hasn't got the power to damage a pin, unless you hit it with a hammer.
The internal pin protection diodes will clamp any over-voltage to VCC+0.5volt and GND-0.5volt.

For "event" detection (coughing), try the attached knock sensor sketch.

For "sine wave detection", like breathing, you might need a different approach.
Try to connect ground of the piezo to a 2.5volt virtual ground, made with two 10k resistors and connected to 5volt.
Attached sketch won't work with that without modification.
Leo..

// knock sensor/alarm
// Piezo, with 1Megohm load resistor across, connected to A0 and ground
// optional 5volt buzzer on pin 13

int threshold = 100; // alarm threshold from 1 (very sensitive) to 1022 <<<<<<<<
int alarmDuration = 100; // alarm duration in milliseconds <<<<<<<<

const byte piezoPin = A0;
int rawValue; // raw A/D readings
int piezoValue; // peak value
const byte onboardLED = 13; // onboard LED and/or buzzer

void setup() {
  analogReference(INTERNAL); // remove this line if too sensitive
  Serial.begin(115200); // serial monitor for raw piezo output
  pinMode (onboardLED, OUTPUT);
}

void loop() {
  // reset
  piezoValue = 0;
  // read
  for (int x = 0; x < 250; x++) { // multiple A/D readings
    rawValue = analogRead(piezoPin);
    if (rawValue > piezoValue) {
      piezoValue = rawValue; // store peaks
    }
  }
  // print
  if (piezoValue > 0) {
    Serial.print(F("Piezo value is "));
    Serial.println(piezoValue);
  }
  // action
  if (piezoValue > threshold) {
    Serial.print(F("Knock was over the threshold of "));
    Serial.println(threshold);
    digitalWrite (onboardLED, HIGH);
    delay(alarmDuration);
    digitalWrite (onboardLED, LOW);
  }
}

Thank you very much! I will give it a try!

Just for learning purposes can you explain the 10k and the high-pass filter question? I don't understand why it does work as a fitler!

A piezo is basically a voltage source through a series capacitor.
That capacitor (could be ~3nF for a 1" disk) plus the external load forms a high-pass filter (low cut).
A load of 1Megohm (or higher) is needed to have some low frequency response.
Some info here.

Because of this high impedance, wires must be short or shielded.
Leo..

Oh, got it! Thanks :slight_smile: Either way if in-between the piezoeletric sensor and the resistor I had a buffer, there would be no problem, right?

Hi there,

So I have constructed, out of a greeting beeping card, a respiratory belt with the piezoeletric sensor in it.
The signal is too low so that I need to amplify it, and offset it, in order to avoid negative voltages so that I can integrate it in arduino.

The circuit I have designed is the following:

where the +-4.5V where obtained from the following circuit:

When connecting the piezoeletric sensor to the breadboard, I have connected the ground of the piezoeletric, to the virtual ground of the +-4,5V circuit.

However, this circuit fails... even at the buffer (1st stage of the circuit, previous to amplification), the piezoeletric sensor signal just vanishes (I sometimes get like 5V (or maybe 4,5V), and it sometimes goes to 0 and reacts with the pressure, but nothing like the normal sensor signal..).

Any clues of what I am missing?
Thanks!

47aa60c598fb41a3b3a515cb22678483.png

Your website is blocked here at work, so I can't see what you are trying to do, but Piezo's require high impedance amplifiers. If you are using a typical op-amp circuit with 10K resistors it may be loading it down too much.

Most of the usual IC suppliers will have application notes for amplifying Piezo sensors. Here is the App Note from TI

A respiratory belt means a very slow changing signal. Piezo sensors are not the best choice for this and will require an insanely high impedance amplifier.

The piezo sensor acts like a voltage source with a small capacitance in series with it. This and the amplifier's input impedance act like a high pass filter.

However, this circuit fails... even at the buffer (1st stage of the circuit, previous to amplification), the piezoeletric sensor signal just vanishes (I sometimes get like 5V (or maybe 4,5V), and it sometimes goes to 0

Your buffer input is floating and needs a DC reference. Connect a ~10M resistor between the op-amp's +input and virtual ground.

I basically used an OP292 with a 10k and 55k.
What op-amp do you recommend me to use?

Common threads merged.

Hi,
One of the members asked you why the use of the piezo electric for the input of the sound? why not use a microphone that you can adjust the output sound? Like the attached link.? It will make it easy for you to
interface since it is made for Arduino.

http://www.ebay.com/itm/10pcs-Lot-3-3V-5V-Microphone-Sound-Module-for-Arduino/161705019747?_trksid=p2045573.c100033.m2042&_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D41376%26meid%3D5a733d3c35744d0781b88ffd5d101843%26pid%3D100033%26rk%3D2%26rkt%3D2%26sd%3D201496655971

I understand what you are trying to do but you haven't stated how you intend to sense the breathing.

Are you trying to measure the air movement or are you trying to measure the chest movement?

If you are trying to measure the air flow, I would use a "Hot Wire Anemometer".

If you are trying to measure the chest movement, I would use a strain gauge system. Either way you could easily make either system.

You could go to "Digikey" and look up strain gauge sensors and pick out one or two that would soot your needs. You would then incorporate the sensors into a strap wrapped around the chest

With respect to a Hot wire anemometer, I would make one using small gauge nichrome wire(26 or 28 ga). You would have to make four sensors with the same resistance and put them into a "Wheatstone Bridge". Two of the sensors would be in the air flow and two in the body of the sensor. The two elements in the air flow would be affected by the moving air and the two in the body of the sensor would account for ambient temperature changes. By the way, you don't have to heat the wires such that they are hot, just warm (100 degrees F or so).

As many commenters have mentioned, a piezo sensor is no really the best option. As far as using a microphone, most microphones are piezo-electric devises. Carbon mics vent out of favor many years ago.

With respect to voltage limiting, use a 5.1 volt zerner diode, tied to the Arduino's analog input. Hook the diodes cathode to the input and the anode to ground.

The zener diode will clamp the positive voltage to 5.1 volts and -0.6 volts in the negative direction.

I am trying to use the chest movement. I am using a piezoeletric sensor as it is the common practice in the biomedical instrumentation area (for example biopac and plux).

Can please someone recommend me an high impedance op-amp?
The TLV2771 is perfect but... it is in the 8-SOIC package and I want to implement this in a breadboard..

KenK:
With respect to voltage limiting, use a 5.1 volt zerner diode, tied to the Arduino's analog input. Hook the diodes cathode to the input and the anode to ground.

Generally bad advice.
A zener leaks, and doesn't protect when the Arduino is off.
(max pin voltage is NOT 5volt, it's VCC +/-0.5volt)
Schottky clamping diodes to VCC and ground would be better.
If... there would be a need for them.

A piezo can generate high voltages with small movements. I doubt amplifying is needed.
High impedance is needed if low frequencies have to be detected.
It was suggested a month ago to connect piezo ground to a mid-voltage point made by two 10k resistors.
Leo..