Pages: [1]   Go Down
Author Topic: analog pin resistance?  (Read 1831 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 4
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone know what the actual impedance of an analog pin is? Im wondering what the max practical voltage divider would be without being affected by the analog reading
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Atmel spec says to have source with 10k or lower impedance.
Higher works, just need to allow longer settling time of the signal.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet says it's 100Mohms typical. However, that's not the whole story, because when you switch the multiplexer to select the analog input you want, the sample capacitor has to charge up. The code for analogRead() allows no time for this (stupidly, IMO) which is why you often see advice to read from the port twice and discard the first reading. My own measurements indicate that a 10us delay between switching the mux and starting the ADC conversion gives reliable results with up to 100K source resistance. The conversion itself takes around 100us, so an extra 10us isn't very significant.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Edison Member
*
Karma: 4
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I usually discard once and read,
but if I do a 10M and a 2.2M resistor divider I can get an accurate reading without altering it
id try it but I don't want to buy the resistors if its not worth it
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10523
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To be strictly accurate the input _impedance_ is 14pF (the sample and hold capacitor)....  There are internal series resistances of 1k to 100k before that (yes, the datasheet has a value with 2 decades of uncertainty! fig 23-8 in datasheet).  So source impedances of around 100k or more will definitely start to increase the settling time (which is 10us worst case by my calculations).

The sample and hold freezes 1.5 ADC clocks after the multiplexer updates, and the default Arduino setting is an ADC clock period of 8us.  Thus there is 12us settling time available, fine for low impedance sources (25k or less - though if the internal series resistance is more like 1k than 100k a source of 120k would do OK).  For a source of 1M 100us is needed (so two successive calls to analogRead () will be enough.

For more than 1M you have to scale the settling times by 100us per 1M.

An ADC conversion takes 13 ADC clocks (104us in default setup)
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Edison Member
*
Karma: 4
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So if I had a 10M source it would take 20 throw away calls to analogRead()?
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10523
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or one call, a delay of 1.8ms, then a second read - the first read selects the correct pin to multiplex to the ADC sample/hold circuit and its capacitor, the second actually runs the ADC successive-approximation loop.

It you only read from one analog pin, life is easier.

Well thats the theory - be interesting to measure the real behaviour.
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: