Electronic – Simple measurment of resistance with microcontroller

measurementmicrocontrollerresistance

What is a simple way to measure resistance (in this case 0-100 kOhm) using micro-controller (I'm using STM32, it has 12-bit ADC, timer, but no comparator). I want it simple (not too many components) and cheap.

The first idea I had was to use ADC with voltage divider. However it brings down the problem to measuring voltage across known resistor what is hyperbolically dependent on the measured resistance, so actual precision varies greatly over the range of values of unknown resistor. It also requires the known resistor to be much smaller value than known one, but this should be fine if big precision is not required.

Requirements:

  • Range: 0-100 kOhm
  • Precision: at least 1 kOhm, preferred <100 Ohm, but actually I am curious (thinking about – other possible applications which might require better precision) how high (with precision) we can get without making too complicated circuits.

Best Answer

Use a voltage controlled precision current source to feed a known current into the resistor. If the measured reading is either too low or too high, adjust the current source to be more appropriate. Take several readings and average.... Maybe 50 readings to counter the lack of bits in your ADC .

For high valus of resistance you will need to buffer the signal to the ADC with a unity gain opamp circuit because the ADC's input is quite low impedance.

The current source can be built using a DAC to set the demand. It'll need two transistors and two opamps for maximum flexibility.

You may think this is too complex but if you change your mind let me know. It is a decent method I might add.