Thursday 9 April 2015

The value of Arduino (ATmega328P) internal pull-up resistors.

The inbuilt pull-up resistors on the Arduino/AVR outputs aren't well defined. When these are used the exact value rarely matters - the datasheet gives a pretty wide range: 20kOhm-50kOhm.

There is a discussion on the official Arduino forum here, with one pull-up measured as R=30.9K from an effective voltage of 4.58V (which is different to the supply voltage). In short I measured the value on one chip as 34k from 4.6V, it will vary from chip to chip and even with temperature.

Note: If you're trying to use the pull-ups on the Arduino Uno avoid digital pins 0,1 and 13, which have other connections.

The datasheet includes an I/V graph for the internal resistor which appears to show very linear operation (as a resistor). Measuring the pin I/V and plotting the results I get a good agreement with the datasheet.

The catch is that the I=0 crossing doesn't occur at the supply voltage of 5V. When using the pull-up resistor the pin has an effective source voltage of around 4.77V.

When the effective resistance is plotted against pin voltage it gives a different picture. The resistance is constant over most of the range, at about 34.4kOhms. But once the voltage on the pin rises above 3.5V it's no longer a good approximation. (The pull-up is likely implemented using a transistor, and probably isn't temperature stable).


With regards to pin-pin variation, the pull-up resistance is fairly consistent between pins (at least for pins 2-12 on the Arduino board), with a value within 1% for each of the digital pins.

No comments:

Post a Comment