# designing a universal 0-10v and 0-300k resistance input circuit

I'm trying to design a universal input circuit which can accept 0-10v as well as variable 0-300k resistance.

I'm using this ADC (mcp3008) which has a maximum input of 5 volts , couldn't find an equivalent product that isn't cheaper than 15 pounds

Therefore I design 2 circuits , one which can accept resistance as an input (R2)(where I provide it with 5 V and then convert the voltage to resistance in order to figure out what resistor is connected ):

The other has a potential divider which can accept 0-10 volts as input (V1) :

So my main question is how can I combine these two together so that I can have an input that would accept both a resistor between 0-300k or a voltage between 0-10 ?

• (1) What is your voltage source for the analog input? (2) Will it be able to sink current from your resistance measurement and keep its output voltage constant? (3) It's more readable if you follow convention and have your circuits read from left to right. The ADC input should be on the right since that's the way the signal is travelling. – Transistor Nov 10 '17 at 13:47
• the voltage source for the analogue input will be from a raspberry pi – bluetiger Nov 10 '17 at 13:49
• They don't have analog outputs as far as I know so that comment doesn't help. – Transistor Nov 10 '17 at 13:51
• I was referring to V1 in the 1st circuit, there is no voltage input for the 1st circuit its just a resistor (R2). – bluetiger Nov 10 '17 at 13:57
• (1) For resistance measurement there is going to be a current source of some type connected to the input pin. This will run a current through the resistor under test and generate a voltage that you can measure. (2) For voltage readings your analog 0 - 10 V voltage source will be fighting the current source. That's why we need to understand what the 0 - 10 V source can tolerate. – Transistor Nov 10 '17 at 14:01

The cleanest method to do what you want is to use a constant current source to the input. This will generate a voltage across the resistor under test (RUT) proportional to the resistance. To get 10 V at 330k we need a current of $I = \frac {V}{R} = \frac {10}{330k} = 30 \ \mathrm {µA}$.