# Resistance to voltage

Discussion in 'General Electronics Chat' started by Razor Concepts, Apr 24, 2012.

1. ### Razor Concepts Thread Starter Senior Member

Oct 7, 2008
212
1
Say I have something that changes resistance, from 500 ohms to 1000 ohms. I would like to translate this to a voltage - if its at 500 ohms, the voltage output would be 0. If its at 1000 ohms, the voltage output would be the maximum, say 5 volts. (vice-verse works as well).

How would I accomplish this? I feel as if this is very simple but I can't get my head around it.

2. ### WBahn Moderator

Mar 31, 2012
24,229
7,548
Depends on what kind of relationship between the resistance and the voltage you need. The simplest way would be to just put the resistance in a voltage divider. The relationship will be nonlinear.

A better way would be to put a constant current through it, which would result in a linear voltage-to-current relationship, albeit with an offset since the resistance only goes down to 500ohm. But, if needed, that can be taken care of a number of different ways, depending on what resources are available for your circuit.

3. ### Razor Concepts Thread Starter Senior Member

Oct 7, 2008
212
1
Could I arrange a voltage divider in a way to properly scale the output range to be close to 0 to 5 volts? The simplest voltage divider with one resistor being the thing that changes would work, but the range of the voltage output wouldn't be very large, resulting in lower accuracy for a microcontroller reading the voltage.

4. ### WBahn Moderator

Mar 31, 2012
24,229
7,548

Do you have a negative supply voltage available?

Is there anything preventing you from using an opamp or two?

This is what I mean when I say that it depends on what resources you can use in your circuit. Without some understanding of that, we are likely to go off on a tangent that would work in principle, but isn't practical for your specific application.

5. ### #12 Expert

Nov 30, 2010
18,076
9,684
The old fashioned way to do this is to make a constant current at 10 ma and send it through the victim so the result is 5 to 10 volts. Then send that through an op-amp with a 5 volt offset reference.

If you're stuck with only 5 volts, the fearful "lower accuracy" is going to happen. No way around it that I can see.

6. ### WBahn Moderator

Mar 31, 2012
24,229
7,548
If stuck with 5V, you can send 5mA through it to get 2.5V to 5V. Then sum it with -2.5V to get 0V to 2.5V, then gain it up with a 2x amplifier to get 0V to 5V. The last two steps can be done with a single op amp. Maybe all three can be combined into one; I don't know for sure one way or the other on that one.

#12 likes this.
7. ### #12 Expert

Nov 30, 2010
18,076
9,684
That's the "lower accuracy" I was talking about. Starting with half range and amplifying introduces errors. Even with 5 volt "rail-to-rail" op amps, it's nearly impossible to get a 0.0 to 5.0 volt signal without any compromises.

All that's left is to choose your poison. Provide a wider voltage supply or calculate how much accuracy you are going to lose and decide if you can live with that.

8. ### WBahn Moderator

Mar 31, 2012
24,229
7,548
Agreed. I should have been more clear. I wasn't offering that as a way to have more accuracy, just to nominally use the full range so as to minimize the quantization errors. In practice, of course, you want to be careful to operate all portions of the circuit within the linear limits, those "limits" being somewhat soft and dependent on what is "linear enough" for the application.

9. ### Ron H AAC Fanatic!

Apr 14, 2005
7,012
681
IMHO, the simplest scheme conceptually is to connect one end of the resistor to -5V, and the other end to a 10mA current source. Of course, this requires two power supplies, -5V and >+5V. Of course, you get no impedance buffering, which may or may not be a problem.

10. ### MrChips Moderator

Oct 2, 2009
18,689
5,936
The simplest way is to use an op-amp in the inverting amplifier configuration.

This is in fact a constant current source. If Vin and R1 are both constant the current in R1 is a constant I = Vin/R1. If R2 is the variable resistor, Vout is proportional to R2.

You can re-invert the voltage and subtract the offset by using a second op-amp configured as a summing amplifier.

11. ### WBahn Moderator

Mar 31, 2012
24,229
7,548
I wish the OP would answer my question regarding whether or not he can have a negative supply. If not, and he is limited to 0V to 5V (or some range slightly within that), then he can use the same basic configuration but connect the non-inverting input to something like 4V and set the current so that 1kohm takes him to the bottom of the linear range. But, if he has a negative supply, this suggestion amounts to a tangent that muddies the water. If he doesn't, then the other suggestions do the same thing.