Go Down

Topic: Block negative voltages (Read 2111 times) previous topic - next topic

diogotec

Apr 05, 2017, 09:57 pm Last Edit: May 10, 2017, 02:18 am by Coding Badly
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! :)

Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

diogotec

Yeah, but how can I set that?

Wawa

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

diogotec

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

Wawa

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..
Code: [Select]
// 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);
  }
}

 

diogotec

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!

Wawa

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.
https://en.wikipedia.org/wiki/Piezoelectric_sensor

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

diogotec

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

diogotec

#9
May 09, 2017, 07:55 pm Last Edit: May 10, 2017, 02:15 am by Coding Badly
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!

sdturner

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

polymorph

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.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - tinyurl.com/q7uqnvn
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

DVDdoug

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

diogotec

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

Coding Badly


Go Up