Reading dynamic resistance values over a wide range
In an Arduino, pins are high impedance when set to 'Input', and a good low output impedance when set to 'Output', capable of sinking >20mA. This enables you to split up the range, and measure each optimally. This applies to both digital AND analog pins.

For instance, let's the split the 500ohm to 100k range, which is a resistance ratio of 200 end to end, into 3 sub-ranges, by taking the cube root of the ratio. Then we can handle it in 500-3k, 3k to 17k, 17k to 100k ranges, each with a ratio of 6 end to end. We get the best centring of the range when we measure it against the geometric mean of its end points, so use 1200ohms, 7k and 41k as the 'other leg'.

Connect up the Arduino as follows. I've rounded the resistors to preferred values, as the actual values are not important, just that they're known.

Measure the voltage on pin A0, using the ADC with VCC as the reference.







simulate this circuit &ndash; Schematic created using CircuitLab

With all pins set to Input, the effective resistor to ground is about 40k, for the range 7k to 100k.

Setting pin A2 to output low, and making sure A1 is high impedance, by

pinMode(A1, INPUT);
pinMode(A2, OUTPUT);
digitalWrite(A2, LOW);


pulls R3 down to ground. Now the resistance to ground is about 7k, for the range 3k to 17k.

Set it back to high impedance like this

pinMode(A2, INPUT);


When you set A1 low in the same way, the resistance to ground is 1200, for the lowest range. Note the maximum current that A1 has to sink is about 2mA in this case, well within the capability of those pins.

You can of course split the range into more and finer ranges, by doing the appropriate sums and using more pins and resistors.

You may be able to substitute digital pins for A1 and A2. While they too are high impedance on input, I've not yet waded through the documentation to check whether intermediate voltages are OK on a digital input. They aren't on usual CMOS logic families, the inputs can oscillate and draw excess power, but Arduino may be different. Analog inputs are (of course) happy with any intermediate voltage on the pin.