How Arduino Power supply works

This Arduino power supply is designed to "do the right thing" no matter which source of power is plugged in.

the right thing

"The right thing" is:

  • When a person plugs in only the USB cable, the CPU and everything else powered by the +5V line is powered from the +5V USB power.
  • When a person correctly plugs in only a 12 V wall-wart, the CPU and everything else powered by the +5V line is powered from a +5V voltage regulator powered by the wall-wart.
  • When a person correctly plugs in both the USB cable and the wall-wart are plugged in at the same time, all the power comes from the wall-wart, and no power "back-flows" to the USB host.
  • When a person keeps plugging and unplugging the cables, the power smoothly transitions from one to the other, so that as long as at least one is plugged in correctly at all times, the CPU continues to run uninterrupted.
  • When (not "If" !) a person plugs in a 12 V wall-wart incorrectly -- reverse polarity -- no current flows to or from the wall-wart, no damage is done, and the system acts exactly the same as if that wall-wart isn't plugged in at all.

wall-wart power

Many systems use 1 diode for each source of power to power the system from whichever input voltage is higher, which automatically handles the "smoothly transitions" requirement.

The diode works fine on the wall-wart power side.

USB power

Alas, a diode on the USB-power side wouldn't work for the Arduino. When running off USB power alone, a diode drop (typically about 0.6 V) would cause everything to run a diode drop lower than USB power -- so it would have been typically 4.4 V, which is apparently (?) inadequate.

mystery parts

Later versions of the Arduino schematic clearly label the 3-pin box "powersupply DC 21mm", indicating a 21 mm barrel plug.

The mysterious "4" and "8" pins in the top-left of the Arduino schematic are the power pins of an 8-pin dual op-amp. That op-amp is used here as a comparator.

thoughts

I don't know why the designer didn't use a comparator IC, or why the designer used both op-amps in the package when just one op-amp is adequate -- but since it clearly works, I'm not going to say it is "wrong".

The op-amp and the pFET implement something very close to an "ideal diode": when only the USB cord is plugged in, the op-amp drives the pFET hard ON, giving a voltage drop across the pFET less than 0.1 V (so everything runs on something close enough to 5.0 V).

When a person plugs in a USB cord to an Arduino that previously had nothing plugged in, the body diode of the pFET "T1" lets power from the USB cable leak in enough to bootstrap the op-amp power supply voltage up to about 4.6 V, more than enough to power up the op-amp, which then turns that pFET hard ON, pulling the voltage the rest of the way up to more than 4.9 V.

When a person plugs the wall-wart into the Arduino power jack, the op-amps turn the pFET hard OFF. The pFET body diode prevents power from the voltage regulator back-washing to the USB host. In principle USB power could continue flowing through the pFET body diode into the Arduino, but that's going to be pretty insignificant since the USB power is close to the same voltage as the regulated voltage generated from the wall wart.

p.s.: When a tiny company sells 250 000 boards, I personally use the word "successful" rather than "dummies".


I am not impressed with the quality of this schematic. Someone was too lazy to export this thing in Eagle without colors, which don't mean anything to people outside of Eagle. Then there are the two mystery blocks at left. The top one shows 5V and GND with a cap accross it, but without any hint what the thing being connected to power is. The bottom one is connected to PWRIN and GND, but again no hint of what it actually is. I wouldn't trust much from this person or organization since they can't even get the little obvious things right and clearly lack the pride in their work that should have made it too embarassing to show this mess in public. I guess this is one more confirmation that Arduinos are not just microcontrollers for dummies, but also microcontrollers by dummies.

Anyway, back to your question. It looks like the point is to switch actively between USB power and the PWRIN power line. When PWRIN is present, it will always be used whether USB power is available or not. For VIN to be useful, it has to be above VCC30 after being divided by two by R10 and R11. From the names, we can guess that would be 6V, which could be the minimum IC4 requires to make reliable 5V out (I don't recognize the IC4 part number and didn't check). You are right, there is no purpose to IC5B. It is a unity gain buffer, but the output of IC5A should have the same impedance and drive capability.

Note that the way T1 is oriented, the FET body diode always lets the USB power voltage onto the 5V net. This lets the system bootstrap up and eventually turn on the FET fully if the board is only powered by USB. If external power is used, the FET will be off and the diode drop will prevent any substantial current to be drawn from the USB power.