Reading analog in from rheostat, not potentiometer


I am trying to read input values through a rheostat, which only has 2 leads but the values do not seem to be linear.

I connected it using the diagram at:

Depending on the fixed resistor I use, the values change. I would like for it to read more linearly as if using a potentiometer with its three leads and was wondering if this is possible.

The rheostat is 20k ohm.

Thank you in advance for your help and input!

It's not going to be linear. The voltage at the analog pin will be 5*10k/(10k+rheostat) and as you can see, that is not a linear equation.

If you want linearity use a potentiometer, or linearize the results in software (basically use a lookup table).

Thanks for pointing me in the right direction. I see now that I won't get a linear response by trying to use only a rheostat.

Did you just arbitrarily choose 10k as the fixed resistor or is it a good rule of thumb to use 1/2 the value of the rheostat?

Is there any other way to use only 2 terminals of a pot or other element to get a linear response? I will look into using a lookup table as well but if you have a good resource, that would be helpful as well. It seems, though, that there would be less resolution using a lookup table...

Thank you so much!

10k was pretty arbitrary, but using the value of the rheostat is where you’ll get the most resolution.

You could get a linear response by using a constant current source, pumping it through the rheostat, then measuring the voltage across the rheostat. Something like this – gives you about 0V-4V with a 20k rheostat at room temperature.