Electronic – arduino – How to select the resistance value for an Arduino capacitance meter

arduinocapacitancecapacitor

I'm working through examples for an Arduino capacitance meter and the ones I've seen give the known resistance of the RC circuit as 10 kilohm. It's my understanding that we could use "any" known resistance. Is there a reason that 10 kilohm is commonly selected?

Two examples that both use 10 kilohm:
https://www.circuitbasics.com/how-to-make-an-arduino-capacitance-meter/

Here's a response to a Quora question about finding capacitance that also uses a 10 kilohm resistor with a 9 V battery:
How can I determine the capacitance of an unknown capacitor?

There are others.

Best Answer

It is usually desirable to maximize the resistance in order to be able measure relatively small capacitance values.

The ATmega328P datasheet says:

"The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less.

.. and then goes on to describe the effect on the sampling time. The leakage current is also a potential issue.

That does not mean that one could not use less or more resistance in some given situation, with careful analysis, but it's a reasonable starting point.

For example, to measure a 10,000 µF capacitor, 10 kΩ may be too large (\$\tau\$ = 100 seconds). However, if you go too low in resistance then the output resistance of the GPIO pins will start to affect the time constant.