Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: noob question about analog input with high resistance

  1. #1

    noob question about analog input with high resistance


    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.

    NTC :

  2. #2
    Senior Member
    Join Date
    Apr 2013
    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.

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Quote Originally Posted by AlainD View Post

    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.

  4. #4
    *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.

  5. #5
    Junior Member
    Join Date
    May 2017
    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


  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts