Arduino digital pin out voltage

Hi guys,

This is probably a stupid question but it is driving me a little crazy trying to work it out.

I'm running a simple LED driving circuit from an Arduino (Freetronics Eleven), just a basic LED and resistor in series, switching on and off every five seconds.

Unconnected, I get, as expected very close to 5V when it goes high. However, when it is connected up, the voltage drop over the circuit is 4.5V, not 5V. I'm using a 120 ohm resistor. Why isn't it 5V? The current is only ~20mA, so not over the spec for these pins (40mA).

Thanks in advance...

The Arduino pins have some internal resistance (like all CMOS chips), so they drop a little voltage when you demand significant current from them. According to the atmega328p datasheet, if you draw 20mA from an output pin and the supply is 5v, then the output voltage is guaranteed to be at least 4.2v.