0
\$\begingroup\$

I am trying to measure resistances in the range 20 kohm to 1 Mohm. Initially, I was using a constant voltage source, but the power consumption when the R = 1 Mohm is very large.

I want to use as little current as possible. I need to measure the resistance value using a microcontroller (that has an A/D input).

Should I be using a constant current source and then sense the voltage across the resistor to be measured? That would mean that I need to tune the circuit for the max resistance I want - otherwise, the output voltage would exceed the A/D pin spec of my microcontroller, right?

\$\endgroup\$
  • 4
    \$\begingroup\$ I was using a constant voltage source, but the power consumption when the R = 1 MOhm is very large. That does not make sense to me. The 1 Mohm resistor will cause only a small current to flow (I = V/R) so power will be small unless you're doing this in a strange way. So show a schematic to make everything clear. You should investigate how resistance meters do this. Fixing either voltage or current will (depending on the resistor you're measuring) results in too high/ low voltage/current. Do some calculations to see what the voltages and currents will be. \$\endgroup\$ – Bimpelrekkie Sep 4 '18 at 7:55
2
\$\begingroup\$

The constant-current approach for measuring that high resistances may not be a good idea. Because the reference current should be extremely low (i.e. in uA range). For example, 2uA current leads to a voltage drop of 2V across a 1M resistor. A voltage level of 2V is a nice value for measuring via ADC. But unfortunately, it's quite hard to make a precisely adjusted 2uA current source (If there's an easy way to make one then I'll be happy to know). If you increase the reference current to 50uA which is relatively easier to regulate then the voltage drop will be 50V! Please don't say "I can use voltage divider" because the divider resistors should be quite low since they shouldn't load the resistor-to-be-measured. And also using that low resistors will lead to a relatively higher dissipation.

You can use a voltage divider with precisely adjusted resistor. This can be an easy way to measure a resistor.

I would measure that high resistances with an oscillator. From T=RC, if an oscillator outputs a signal with a pulse-width of 2ms with a 20k resistor then the same oscillator's output pulse-width will be 100ms with a 1M resistor. Please note that these periods can be easily measured with a MCU. And also the oscillator will not draw too much current.

\$\endgroup\$
2
\$\begingroup\$

I will tell you how I would do it if I would do this for myself.

I would look up a typical amplifier that fits my needs. The differential amplifier suits my needs if I just ground \$V_1\$ and connect \$V_2\$ to \$V_{DD}\$. See below for a schematic of a differential amplifier.

enter image description here
The source of this image is from the link to wikipedia above.

And the relevant equation for this particular schematic is this one:

\$V_{out}=\frac{(R_f+R_1)Rg}{(R_g+R_2)R_1}V_2-\frac{R_f}{R_1}V_1\$

With \$V_1\$ grounded the second term disappears.

So the idea here is that \$R_g\$ is selectable and can become 1, 10, 100, 1 k, 10 kΩ. And \$R_1\$ and \$R_2\$ are fixed at 1 kΩ. I choose 1 kΩ because it is not too small so large currents will flow and not too large so it will be susceptible to noise and the parasites of the op-amp. It is a lagom value.

So let's rewrite the equation above and find \$R_f\$, this is where you will place the resistance to be measured.

$$ \begin{align} V_{out}&=\frac{(R_f+R_1)Rg}{(R_g+R_2)R_1}V_{DD}\\[2mm] (R_g+R_2)R_1V_{out}&=(R_f+R_1)RgV_{DD}\\[2mm] \frac{(R_g+R_2)R_1V_{out}}{RgV_{DD}}&=R_f+R_1\\[2mm] R_f&=\frac{(R_g+R_2)R_1V_{out}}{RgV_{DD}}-R_1 \end{align} $$

And then all you need to do is to cycle \$R_g\$ through known resistances and measure \$V_{out}\$ with your ADC and you'll be able to calculate your value.


Here's an example of a schematic I'd go with. Just use a couple of NMOS as a multiplexer, generate the gate signals from your µC.

enter image description here

Link to simulation.

So let's plug in the values and see if it is correct.

$$ \begin{align} R_f&=\frac{(R_g+R_2)R_1V_{out}}{RgV_{DD}}-R_1\\[2mm] R_f&=\frac{(100+1000)×1000×.9207}{100×5}-1000\\[2mm] R_f&=1025.54 \end{align} $$

It should be 1000 Ω as we can see is shown in the schematic, but instead it's 2.5% off, this is due to the 100 Ω not being 100 Ω, it's more like 100.5Ω due to the NMOS. So you might want to calibrate your values. I also believe you might want to make \$R_2\$ higher, like about 10 kΩ or 100 kΩ. This way the resistance of the wire and NMOS will play a less role in your measurements. But if you are going to calibrate then it won't matter what value \$R_2\$ is.

I tried the equation for other values and it is "close enough". So the job for you is to acquire a good op-amp, a couple of NMOS to act as a multiplexer. I do not recommend you getting an actual analog multiplexer because they usually have several Ω if not hundreds of Ω compared to NMOS with some mΩ. And also get some 0.1% resistors.

Regarding your software, when you measure you will probably get a 10bit value, so most of the times you will measure 1023 1023 300 20 1. Or maybe 1023 850 400 10 6, then it's up to you to understand that you should take the value that is to the right of the 1023 value and the resistance used to generate that value. Write some good code.


This should get you in the right direction for a simplistic solution.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.