# How to measure multiple resistances with Arduino Uno, without one measurement influencing the other?

I'm working on a project where I aim to measure resistances using an Arduino Uno. I started with two separate voltage dividers, each using a 1 MOhm reference resistor, connected to a common Arduino GND and 5V, and interfaced with Arduino analog inputs 0 and 1.

Problem: With a single voltage divider connected, the readings are as expected (approximately 1 MOhm). When two dividers are connected, I still get correct readings for both.

However, if I disconnect one control resistor R2 (expecting an open circuit, i.e., infinite resistance), the readings are unexpectedly low:

R1: 1.4 MOhm (expected: 1 MOhm)
R2: 4 MOhm (expected: Infinity)


I suspect this issue might be related to using a common GND and 5V. Could the shared power lines be causing interference or leakage currents affecting the readings?

My future aim:

I want to create an array of metal pin pairs to push onto a damp textile, measure resistances, and produce a moisture map of the textile surface. The array looks like this, where each x is a metal pin pair and hence a separate voltage divider:

xxxxx

xxxxx

xxxxx

xxxxx

One solution that comes to mind is to use MOSFETs for each voltage divider and only supply voltage to one voltage divider at a time. This way, if I solve the issue of measuring two resistances at a time (or slightly time-shifted), I can then use a multiplexer to handle multiple analog inputs effectively.

• How fast do you need it to respond? What accuracy are you expecting? What range do you expect it to measure? Commented Jun 24 at 12:05
• @winny not that accurate. I need to distinguish between 500 kOhm, 1 MOhm and 5, 10, 50 MOhm. Range is 500 kOhm - 50 MOhm. Response time probably 1 second maximum for one voltage divider unit Commented Jun 24 at 12:36
• That seems very reasonable. Multimeters use successive approximation to have a very wide range. You have a limited range, but quite a high one. Can you afford to have a constant current source to dive your unknown load, and from there measure the resistance? Commented Jun 24 at 12:58
• That sounds good. If a constant current source is more or less easy to add to an Arduino, then yes I can afford it. But I assume, I would need a separate const. current source for every measurement point. And I need to assure that there is no textile damage. But if it's only 2 mA, then it should be safe for short term use Commented Jun 24 at 13:14
• 5 V over 50 Mohm is 100 nA. Possible, but a bit too low for comfort/accurate readings. Commented Jun 24 at 13:57

Saying you have an Arduino means nothing, like saying you have a car and ask why it performs poorly when driving on F1 track or sand dunes, but not revealing the car type or model.

Fortunately most MCUs have approximately similar ADCs.

And if your Arduino means there is an ATMega328 MCU, the ADC it has needs the source impedance to be less than 10 kohms.

And since your voltage divider has one 1 Mohm as the other resistance, it means that the source impedance is way too high for the ADC to function properly, the other resistance needs to be max 10.1 kohms.

What you need to do is to use op-amps for sensing the high impedance divider output and driving the ADC input with low enough impedance.

You can also try to reduce the AC impedace by putting a say 33 to 100 nF capacitor, but there are two problems, first is it's an RC filter and limits the bandwidth you have available if you need high bandwidth and it also means you need to let the capacitor to charge back up to the nominal value before taking a sample with the ADC as it will consume some charge and changes the capacitor voltage, so you can't take samples very often, a reasonable assumption is that the cap needs to charge to within 1 ADC LSB count accuracy so much longer than five RC time constants.

• Thank you for your comment. I am sorry, I forgot to mention which Arduino. Currently I am using an Arduino Uno. If eveything works, I will switch to an Arduino Nano. I am going to try both of your suggestions. 1. Capacitor 2. op-amp. Since I want to map a damp surface, one measurement needs to take max 1 second. With 16 measurement points, this would take 16 sec. This is the most maximum. Even that is too high. Commented Jun 25 at 6:55
• @EsatBecco I don't know which Arduino has which MCU, but it does not matter. Forgot to mention, the resistances are quite high so just select the capacitor or op-amp carefully so that leakage or bias currents don't affect the result much. Some cap types leak more than others. Commented Jun 25 at 20:06

Generally it’s better to keep the impedances at analog input pins no higher than a few thousand ohms. Otherwise there will be undesirable effects from leakage and from the relatively low input impedance of the analog inputs when they are switched rapidly- that can cause one input to affect the next.

You may be able to mitigate this by adding a substantial external capacitance (which will slow response), sampling slower, and living with some interaction.

However, I think it might be better to buffer each divider with a CMOS op-amp.

• THX for your response! I am forced to use high reference resistances because the moist textile resistance I want to measure is also in the range of 250 kOhm and with proceeding drying it increases up to 100 MOhm, which is measurable with dedicated and expensive desktop Ohmmeters. When I plug out one test resistance, the res. value doesn't change even after several minutes so I guess a capacitor wouldn't change much. But I am going to test it. I suppose, you suggest to add a relatively big and small capacitor between common GND and 5V rail? Would a CMOS op-amp only amplify weak signals? Commented Jun 24 at 11:58

Use the comparator peripheral and a big cap. Time how long it take a step to charge or discharge with the timer module.

I solved my problem after reading the anser of @Justme by adding 10.000 pF capacitors for each voltage divider between Analog pin and GND. That way the ADC of Arduino (Sample and Hold Capacitor of the ADC) has more time for buffering. With a bigger Capacitor it didn't work.

I also found somewhere else that reading the same analog value 2 times consequerntly also works: analogRead(x); analogRead(x);

What also might work, but haven't tried it yet, is using a constant current source. Probleme here is, I want to measure high resistances, so const. current source needs to apply high voltages. Also might work is using OpAmps to amplify the signal.