Ways to measure the resistance with uC.

Discussion in 'Analog & Mixed-Signal Design' started by LauraB, Jul 3, 2016.

Dec 15, 2011
43
0
Hi there,
What is the best way to measure low resistance let's say up to 20R? I originally used current source and ADC. Unfortunatelly, I want to have a few channels and don't want to use more than one current source. I tried switching by using transistors, but there is always a small current flowing that causes problems. And, when a resistance is higher than the max value - uC receives max voltage(thats good). Although, when this particular channel is off - still uC receives max V. Therefore, it cant tell me if the channels are shorted together.

I'm trying to measure the time needed for the capacitor to charge. What do you thing about it?
Or maybe I should just use a simple circuit with known resistor value?
Thank you,
N.L. B

Sep 13, 2015
2,196
421

3. DickCappels Moderator

Aug 21, 2008
3,929
1,094
As a general approach, I think I would (assuming a 5 volt power supply) use a 510 ohm resistor in series with the resistance under test and then just use an inexpensive low offset opamp with gain that can accept an input near ground and that can swing its output to ground as a noninverting amplifier to drive the ADC.

4. atferrari AAC Fanatic!

Jan 6, 2004
2,839
944
There is an old AN in the Microchip's site explaining how to measure resistance with a micro.

5. dannyf Well-Known Member

Sep 13, 2015
2,196
421
If you want to measure low resistance, here is one approach, with digital readout:

https://dannyelectronics.wordpress.com/2015/11/08/a-mcu-based-milliohm-meter-version-2/

It requires just two resistors, and can generate digital output or analog output (to drive a coil meter).

Basically the two resistors form a constant current to drive your dut. The voltage over the dut is measured by the avr, at 1x gain or 20x gain. The adc reading is proportional to the dut.

For the particular avr, it has a resolution into milliohm, depending on the two resistors used.

A fully analog version is also possible, using the same approach.

Dec 15, 2011
43
0
Thank you for all the information. Im going to try it tomorrow.

Do you have it? I've been reading something from Microchip, but I'm not sure if this is the one youre talking about.

dannyf - something like this. If i could only make it x4 and have an offset or something that would tell me if there is a short(higher resistance than 20R) or the channel is off and there are no shorts. I will look at it soon.

DickCappels - Swing its output to ground? I think LM358N should work.

Thank you!

7. dannyf Well-Known Member

Sep 13, 2015
2,196
421
An avr has a 1mv/lsb resolution. If you run the dut at 10ma, a 20R dut will generate a 200mv voltage drop or 200 count adc reading. That's far more enough to reliably detect 20R resistance.

Dec 15, 2011
43
0
ok, so how does the uC know if its very low resistance or if there is no power connected to it.

9. GopherT AAC Fanatic!

Nov 23, 2012
7,285
6,007
Ohms law.

Put a 220 ohm resistor in series with your device under test. Connect the 220 ohm resistor to the power supply voltage (regulated) and then the 20 ohm resistor connected to ground. The. On ode between the two resistors will have a non-zero voltage. You can add a Vreference and use the ADC on the Microcontroller to measure the voltage.

Now, calculate what voltage you expect from the voltage divider. And what value that would be on your ADC. Calculate an acceptable for your application. Program as needed.