Difference Amplifier with Op Amp

Hi there,

I'm trying to create a variable potentiometer out of some resistive wire.
My problem, apart from not having a solid electronics background, is that the overall resistance of the wire that I am using is only about 2-3 Ohm.
I basically want a simple ribbon controller where the wire is stretched, suspended over a conductive surface. When you press it down, you should get a variable reading depending on how far up the wire you pressed.

My first naive attempts at wiring this up as a voltage divider (of sorts) resulted in dangerously hot, small value resistors. Not good. But at least I got some readings on the arduino analog input in the range of about 320-390.

After some research I figured I could do with an operational amplifier, and copied a design [1] for a Difference Amplifier. It seemed like just the ticket.
My Op Amp is a TI NE5532P - DUAL LOW NOISE OPERATIONAL AMPLIFIER.

I then spent a number of hours trying different wiring schemes and resistor values. The best I could come up with was:
Resistive wire has ends A and B. Circuit as per [1].
A goes to V1. B goes to V2 and GND.
Resistor R0 goes from +5 to A.
Conductive surface C goes to GND.
Vout to Arduino A0. V+ and V- to +5 and GND respectively.

With R0=100Ohm, R1=261Ohm, R3=1K, I get readings on the diecimila in the range 380-440 depending on where I press down the wire. Which is good, but far from perfect.
The ratio R3/R1, which should determine the amplification, is 3.83.
Now the problem is, if I increase the ratio I get a smaller range of values.
E.g with R1=180R R3=2K7, the ratio is 15 but I get readings from around 866-872, so a much smaller range.

I'm wondering if the op amp is maxing out somewhere, or what else might be going on?

And is there a way to calculate the optimal resistor values to get the full 5v range from my 3Ohm wire? Now what kind of black magic maths is required for that... I shudder at the thought.

Do I need an Instrumentation amplifier? Or have I simply goofed up the connections around my wire?

questions, questions - thank you for your patience.

cheers,

/m

[1] Op-amp Varieties

/m

Hold on, here's a schematic - I hope it's okay, I've only just started learning Eagle.
R1=R2, R3=R4

Hmm, now how do I attach an image?

OK you are not using the differential capabilities of the amplifier and you are probably saturating the output close to the rail.

Relabel the GND to PIN 4 of the op amp 0V.
Now connect the GND to the junction of two 1K resistors going to +5 and 0V. This becomes a signal ground.

Remove the GND connection from the junction of R2 and the pot and connect it to 0V through a resistor (R5) the same size as R0.

In that way you have a differential signal to amplify and you should be able to increase the R2/R3 ratio.
Finally make R0 and R5 as small as you can commensurate with the current you want flowing. I would try 200R to start off with, the smaller this is the bigger the range will be.
The amplifier gain will then be only limited by the DC offset voltage at the input, a property of the type of amplifier.

That sounds so sensible. Thank you!

So something like this:

I will try it out as soon as I get a chance, in the next couple of hours.

/m

Yep, I'd also put a 0.1uF cap across R6. :slight_smile:

My updated schematic doesn't make sense, I would be connecting a 1k resistor across ground and +5V.
I will try it by swapping GND and 0V in the above circuit.

My updated schematic doesn't make sense, I would be connecting a 1k resistor across ground and +5V.
I will try it by swapping GND and 0V in the above circuit.

Yes it does make sense. What resistor are you worried about?

EDIT
Don't connect the GND in this to the arduino GND. The Arduino GND should be connected to the 0V of your circuit.

R5 goes from +5 to GND, is that right?
My problem is really that I don't quite understand the circuit. I clearly need to read up!

I've now tried it and with R1=260R, R3=1K, R0=R7=100R I get readings around 840 for both high and low values.
With R1 and R3 both at 1K I get 490-510.
R1=510R yields 700-730. Maybe there's a sweet spot somewhere in between but it is still far from ideal.

I'm getting a bit tired of swapping out resistors. I guess I should learn Spice next...!

thank you for your help, it is much appreciated.

/m

Just saw your comment -

I know I'm being a bit daft here but I'm just not getting it.
I'm using a USB-powered Diecimila.
If I don't connect GND to Arduino ground, what do I connect it to?

/m

If I don't connect GND to Arduino ground, what do I connect it to?

Nothing, it's just a signal reference for the amplifier.

What specifically is the value in using the opamp as a difference amplifier here? It seems to make things much more complicated. Why not just use it as a simple amplifier like this ? With this, just set your ratio by 1 + (R2/R1).

Either way, I would use a much larger resistor for your voltage divider reference resistor. You do not want very much current flowing through your reference resistor or your wire. If not, the heat generated will change the resistance and you will probably have a hard time keeping your readings consistent (and waste more energy, which may or may not be important for you application). If you are going to be amplifying the result anyway, who cares if your signal varies very little. With an opamp I would be surprised if you can't get a clean accurate x100 gain, that would allow you to probably pick a reference resistor close to 100 times your 30 ohm wire, perhaps a 3K resistor. With a 3k ref, at 30 ohm you should get close to .05V. Multiply by 100, there's your 5v max. At 3K and 5V you will draw at most 5/3000=1.7ma, very little current/energy usage.

What specifically is the value in using the opamp as a difference amplifier here?

The problem with your circuit idea is that for a real op-amp it is operating very close to the supply rails and while you can get rail to rail operation from some amplifiers these are expensive, and even these don't work too well at the rail voltage. You also double the effective signal as this is a sort of Wheatstone bridge topology.

The problem here is that we have a very small variable signal sitting on top of a standing DC voltage. With a normal amplifier you amplify that DC signal as well as the change you want. With a differential amplifier you only amply the difference between the two inputs, thus taking out the standing common DC voltage on each.

Either way, I would use a much larger resistor for your voltage divider reference resistor.

The larger this resistor the smaller is the signal from the sensor. The problem with using more gain is that of the DC offset of the op-amp. This places a practical limit on the gain you can use and the swing you will achieve. Again amplifiers with a smaller DC offset voltage tend to be more expensive.

So with a DC gain of 100 and a DC offset voltage of 20mV there is a permanent output of 2V so any swing you can get is going to be only 3V (from 2V to 5V)