# Moving a variable in a equation question

This topic is 1772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok this is probably a really dumb question but I have been trying to do this for a while but every time I do I keep on failing to get a - 1.

So here is how I got to where I am at now...

Vout = Voltage Output

Vref = Applied voltage

R = variable resistor

ADC = value generated by a Analog to Digital converter.

Vout = R / ( R + 10k ) * Vref   // Here the Voltage Output is the voltage after going through a voltage divider

ADC = ( Vout / Vref ) * 1023

so..

ADC = { [ R / ( R + 10k ) * Vref  ] / Vref } * 1023

gives us

ADC = [ R / ( R + 10k ) ] * 1023

After doing the math I am getting

R = 10k / (1023 / ADC)

The issue is with the equations I find online they are giving

R = 10k / (1023 / ADC - 1)

I can't for the life of me find where this - 1 is comming from.

Any thoughts?

##### Share on other sites
ADC = [ R / ( R + 10k ) ] * 1023

divide both sides by 1023 gives

ADC / 1023 = R / (R + 10k)

multiply both sides by (R + 10k) gives

(ADC / 1023) * (R + 10k) = R

distribute (R + 10k) gives

(ADC / 1023) * R + (ADC * 10k / 1023) = R

subtract (ADC / 1023) * R from both sides gives

ADC * 10k / 1023 = R - R * (ADC / 1023)

factor out the R

ADC * 10k / 1023 = R * (1 - (ADC / 1023))

get a lowest common denominator on the right side

ADC * 10k / 1023 = R * (1023 - ADC) / 1023

multiply both sides by 1023

divide both sides by (1023 - ADC)

divide numerator and denominator by ADC

R = 10k / ((1023 / ADC) - 1)

##### Share on other sites

Doh stupid mistake on my part thanks a bunch!