Resistance to voltage

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
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.

Thank you for your time!
 

WBahn

Joined Mar 31, 2012
30,062
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.
 

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
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.
 

WBahn

Joined Mar 31, 2012
30,062
Is your circuit being powered by 5V?

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.
 

#12

Joined Nov 30, 2010
18,224
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.
 

WBahn

Joined Mar 31, 2012
30,062
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

Joined Nov 30, 2010
18,224
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.
 

WBahn

Joined Mar 31, 2012
30,062
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.
 

Ron H

Joined Apr 14, 2005
7,063
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.
 

MrChips

Joined Oct 2, 2009
30,813
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.
 

WBahn

Joined Mar 31, 2012
30,062
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.
 
Top