OpAmp - gain clarification

I have piezo element as vibration sensor. I would like to amplify it's reading and i'm using Op Amp in non inverting setup.
I'm struggling to understand how the gain works. All information on the web say the formula is quite simple for gain = 1 + Rf/R2. I test it on the setup i show on the screenshot. According to the formula if i lower the R2 transistor i should increase the gain, but i'm getting only slight gain even if change setup from x10 to x20 gain. Do i make mistake in the wiring or am i missing something cruical in OpAmp behavior?

see my tutorial

Sorry, I dont read fritzys can you post a proper schematic?

Your wiring is wrong!

The left hand resistor is not connected to anything on its left hand pin!!

Yeah, you are right, my bad when drawing it, but it is grounded in my setup

I read your guide and I think i would like to do what you have explained in " Example 2. Amplifying a signal from a sensor when it has an offset voltage" with blue line. The problem is that I'm unable to amplify my signal that much.

Would this be a much proper schematic?:

Thanks in advance!

Hi, @davout
Welcome to the forum.

What OpAmp are you using?
How are you measuring the gain of the amplifier?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

And now you see why we don't like fritzing diagram/layout/drawings.

Better to draw a proper schematic, using an online/offline tool, mspaint, or even paper & pencil!

I don't think you need that zener diode there. If you want to protect the op-amp from voltage spikes from the piezo-sensor (for instance if somebody taps it), you would probably be better to replace the zener with two diodes in parallel, one anode up, the other cathode up.

That will limit the voltage from the piezo sensor to +/- 0.6V, which should be perfectly safe and should affect normal operation as piezo output voltages are usually less that this.

Other than that, the circuit looks OK, but normally op-amp circuits like this need positive and negative supply rails, and the output is centred around 0V. For an Arduino analogue input port, you really want it centred around 2.5V (or 1/2 Vcc if you are using a low voltage Arduino).

You can achieve both requirements by using low voltage, single-supply-rail op-amps, which are available. Check out via Google.


I tested on TL071CP and LM358P with similar results.

I measure it on Arduino IDE. This is example when i test different R2 resistor:

Reading on left is with 1,2k Ohm, then the moment i move cable to another resistor and on the right voltage with 4,7k Ohm resistor. As you can see the changes are minimal

Piezo elements are capacitors, they only produce an AC signal. The DC offset is more or less arbitrary depending on leakage resistances and stored charge.
You need to add a load resistor across the sensor, perhaps on the order of 1M or so to set the DC operating point.

But your circuit isn't going to handle negative going parts of the waveform anyway.

They don't look minimal to me! The spikes with the 1.2k resistor seem to be three or four divisions on the vertical scale, and the spikes with the 4.7k resistor seem to be 1 division. So you are getting significant extra gain. I have to say, though, that it looks like you need a lot more gain.

What exactly are you trying to measure.
A 1" piezo with a 1Megohm resistor across, with Aref set to 1.1volt (free 5x gain), is extremely sensitive (as a knock sensor). It will register a pin dropping on a desk that the piezo is lying on.
Don't forget to measure continuously for a certain time, otherwise you will miss events.

You have chosen to implement a non-inverting op amp circuit, TBH I had to go look to see if it was properly configured.

Inverting is far more common for reasons. There is nothing in the resulting inversion of the signal that can't be handled in your program.


The inverting configuration has low impedance, usually not suitable for high impedance sensors like piezos. There is no reason to prefer inverting over non-inverting for a input amplifier, quite the opposite usually.

Noted. I'll go back to what passes for "the books" these days.

I did make good use of opamps all over the place for a good while. Apparently without learning, or remembering at this point, enough.

The very high input impedance of the non-inverting configuration is something I have exploited.


What happens if you put a 4k7 in series with the non-inverting input?

What output do you get if you then short the piezo to ground?

Tom... :smiley: :+1: :coffee: :australia:

A minute amount of extra Johnson noise will be created? Series resistance is often used for protection from voltage excursions, but since the input is high-impedance an extra 4k7 on it is nothing from the circuit's operational point of view (other than the Johnson noise, but I suspect that's immaterial here)

The sort of circuit I'd be thinking of would be this:

The mid-rail voltage is used to bias the piezo and as the virtual ground for the feedback network, and there is a resistor load across the piezo to stabilize its DC offset.

[ What happened to image handling in the new website? Ah, I see: ]

Thanks guys for your broad feedback on my question :slight_smile:
The project i'm doing is inspired by this paper.
I dont have technical background but i found it challenging and i have some free time currently.
This is how the output looks now currently with my setup (output also goes through by 50hz twin notch filter at the end, but i does not influence gain whatsoever):

As you can see the heart beat is visible but its quite weak (20mW of amplitude?). I want to amplify it as much as possible before further processing.

Thanks for the idea, but i'm quite newbie on this. I need clarification.
Is the below correct or i missed the point completly?: