Home > Projects > Metering – Instrument Projects > Arduino Capacitance Estimation: ADC-Threshold Timing and RC-Method Evaluation Reference

Arduino Capacitance Estimation: ADC-Threshold Timing and RC-Method Evaluation Reference

Quick answer: estimating capacitance on an Arduino is a timing exercise as much as an electrical one. Whether you watch an RC node cross an ADC threshold or derive a value from an RC time constant, the limits are the 10-bit ADC, the sampling rate, source resistance, leakage, and parasitics, not the label printed on a capacitor.

Where the numbers actually come from

On a classic UNO R3, analogRead() uses a 10-bit ADC with A0 through A5 as the usable analog inputs, and the reference notes roughly 100 microseconds per read on ATmega-based boards. That figure helps you reason about sampling, but it is not a bandwidth guarantee for a finished application. The ADC single-ended result is referenced to the selected VREF, so a threshold crossing is really a statement about which fraction of VREF was reached, not an absolute voltage.

Two educational methods, shared physics

One approach charges a capacitor through a resistor and measures how long the node takes to cross a chosen ADC count threshold. Another derives capacitance from the RC time constant. Both rest on the same physics, and both are bounded by how finely you can measure time and voltage. The ATmega328P datasheet ADC input discussion recommends source impedance of roughly 10 kilohms or less and explains sample-and-hold charging limits. That is directly relevant, because high resistance both slows the RC slope and makes it harder for the ADC to sample correctly.

Comparison: error sources and where they bite

Source What it affects Symptom you notice
10-bit quantisation Threshold position Coarse timing steps
~100 microsecond reads Time resolution Jittery, large-step results
Source resistance RC slope and ADC settling Error at high resistance
Capacitor leakage Apparent capacitance Reading drifts over time
Parasitic capacitance Small-value floor Non-zero reading on an ’empty’ input
VREF uncertainty Threshold voltage Scale error across the range

Ordered evaluation process

  1. Disconnect and safely discharge the capacitor before any measurement.
  2. Decide whether you need a rough comparative indication or a defensible value.
  3. Pick a threshold well inside the ADC range so crossing detection is not sitting on a rail.
  4. Keep source resistance near the datasheet ADC input guidance to protect sampling.
  5. Note your timing resolution: reads are coarse, so small capacitors sit near the noise floor.
  6. Re-measure the same part over time to expose leakage-driven drift.
  7. Check the empty-input reading to estimate parasitic capacitance in your wiring.
  8. State the range where your method is meaningful, rather than claiming a headline span.

Reader questions

Can this measure from picofarads to hundreds of microfarads?

Not with equal quality. Both methods degrade at different ends because of parasitics, leakage, and coarse timing resolution.

Why does the same capacitor read differently each run?

Leakage, thermal drift, and coarse timing resolution all move the result. Re-measurement is the diagnostic here, not a fixed correction factor.

Does source resistance only affect the RC slope?

No. The datasheet ADC input discussion ties source impedance to sample-and-hold charging, so it affects both how fast the measurement runs and how well the ADC can sample it.

Is it safe to test any capacitor?

Measure disconnected, safely discharged capacitors only. This reference makes no high-voltage or high-energy test recommendation and no precision-meter claim.

Documentation

Documentation-based reference only: the sources are the Arduino analogRead() reference and the Microchip ATmega328P automotive datasheet. No circuit was measured and no accuracy plot was produced, so the meaningful range of either method on your own hardware still needs to be established. For a resistance-measurement companion, see the auto-ranging ohmmeter reference; the STM32 FFT LCR meter reference covers component measurement more broadly.


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top