noob question about analog input with high resistance

Not open for further replies.


Well-known member

Being somebody new with hardware I have a question with a high resistance input.

I would read a fast (well... 0.7 second) NTC with a voltage divider, max. 10 times a second. The 3.3V would be driven by a digital out at least 100ms before measuring. The NTC has a resistance between 160kOhm and 10kOhm in the range that I would need it. Probably use a fixed 22kOhm as the second half of the divider.

If I read the info here correct I also need a capacitor of about 10nF between input and GND.

Is this a reasonable setup?
Would the cap also filter out power supply variation?
First tests will be with USB power afterwards with battery power.

The cap will help with power supply changes, but what it is actually there for is to stabilise the voltage during the ADC read process. The read process starts with charging a sample and hold circuit inside the chip, and a high value resistive divider will sag slightly and mis read if there isn't a stabilising cap there.

If uneven power is a problem you want to connect Aref to the high side of your sense circuit, and set for external Aref.
This will also impact other ADC functions if you are using a digital pin set high for this, but if there is only the one read going on should be fine.

For measuring temperature external ref is probable overkill unless you are also doing a lot of work the calibrate your actual thermistor and wiring but is worth being aware of.

Being somebody new with hardware I have a question with a high resistance input.

Note that ADC have typically a low input impedance, so better to convert high impedance voltage sources (here NTC) using a instrumentation amplifier. They are made specifically for such measurements.
*Should* work.

When a conversion is started the hold capacitor inside the chip should be charged. To charge this capacitor fast it must be feed by a low impedance source. This 10nF capacitor should provide this low impedance source. It will charge to the divider voltage but it takes some time.

If my math is correct the time constant is at most (160E3 Ohm * 10E-9 Farad) = 1.6 ms and you need about 5 RC time to fully charge the capacitor. 100 ms is plenty. The charge transfered from the 10 nF capacitor to the 10 pF hold capacitor will cause a 0.1% drop on the voltage. So expect no more than 10 bits of resolution.

The numbers above are pessimistic.
Another way to mitigate issues with large input impedance is to read the same pin multiple times to a dummy variable, while keeping only the last value. This allows the s&h cap to charge up properly.
How many times depends largely on the ratio between the actual and optimal input impedance; for instance, if the sensor has an impedance of 100k, generally I would try between 5-10 dummy reads before acquiring the value. You can then reduce the number of dummy reads until the signal is stable enough for your use.

Disclaimer: if you want to use the full resolution of the adc, do yourself a favour and use a proper op-amp

All a big thanks for the info.

If I understand it correctly I can use even a 20 nF capacitor and then the complete charge time would be a bit less than 20 msec. I then also can average 4 readings (or throw away the 2 extremes and average the 2 middle values), which -in my understanding- will reduce noise. (After initial charge the charge change will be "slow" as the temperature will change "slow" and the NTC reacts slower because of it's mass.) Any disadvantages, except for slower response times?

I "only" need about 9bits, but repeatability should be high.

I follow with another type of NTC a rather standard 10K 3950. As this one will "only" have a max resistance of 56k (at -10°C), I would like to use a 47nF ceramic capacitor. Is there a noise or other advantage to use 2 capacitors in parallel, for example 47nF and 0.1nF? If yes, how can the best values be found?

I ask, because I find a dual capacitor setup often in voltage regulators.

As some of you probably know:

The ntc with voltage divider has a rather linear part for the ADC values. I found a ntc 10K 3950 with a 10k resistor to be quite linear between 0°C and more than 40°C. It allows for easier calibration and interpolation.
Not open for further replies.