# digital pin's current limit, ohm's law and DC motor

A digital pin's output voltage on an UNO board is 5V, which is equal to the output from the VCC. I read that the DC current limits of those pins are 40mA and 200mA respectively, and that a higher current could damage the board. Now, since V=RI, I expect to get the same current whether I connect a DC motor to the VCC or to a digital pin. But, the motor spins slower when connected to the digital pin. Therefore, I'm not getting the same current, and the only thing I could think of in order to explain this apparent contradiction with ohm's law is that there must be some mechanism to keep the current flowing through a digital pin inferior to 40mA. But I also read somewhere (can't find/remember the source) that there are no such mechanisms (except for a fuse concerning the USB)... So as you see, I can't understand what's going on. It will be really nice if someone could explain that to me... thanks in advance!

• If you connect a motor to the Vcc pin, you are not connecting to an output! This is an input pin, for the processor's power... If your motor draw is OK for your power supply, then the motor will spin. If not, you will overload your power supply and (at best) the arduino will brown-out, probably rebooting repeatedly. You may as well just omit the arduino though. The point to watch with the 200mA limit, is 50mA x4 = 200mA so you can overload the chip with each output being individually fine.. Jan 13, 2015 at 12:43

The ATmega (or any other processor that could reasonably be used on an Arduino) output pins consist of a `Totem Pole` driver with a PMOS transistor which can drive the output towards Vdd and an NMOS transistor which can drive it towards ground. Each of these can be modeled as a switch which has a small resistance when "on", and due to device physics the PMOS transistor has a higher resistance than the NMOS.
Connecting your motor to an ATmega pin is an extreme, far out of spec. When you do that, the voltage drop across the PMOS transistor is much larger, making the output voltage quite low. Additionally, the current flowing through the resistance produces heat within the chip, which can (at least as a rule-of-thumb concern) lead to damage. Finally, your motor will produce `inductive kickback`, "spike" voltage possibly high enough to pierce the gate oxide of the MOS gates in the chip, destroying it. `Latchup` is another possibility - a sometimes temporary condition where the bulk of the die ends up biased to conduct in the wrong direction and the chip effectively shorts out its power supply, turning it into a miniature space heater.
Instead, for unidirectional control you should use a circuit with an `NPN` bipolar transistor, `NMOS FET`, magnetic relay, or solid state relay. The latter are commonly available pre-assembled on shields. With a transistor solution driving the motor in only one direction, it is generally advisable to pick an NPN transistor or NFET and place it in the negative lead of the motor, as the N devices work better due to the greater mobility of electrons than electron-holes.
For bidirectional control, look for a `motor shield` based on an `H bridge` IC such as the `TB6612FNG` or the less efficient bipolar `L298` or `L293`/`SN754410`. This basically puts a high current `Totem Pole` driver on each lead of the motor, allowing you to drive them high & low for one direction or low & high for the other.