2 deleted 110 characters in body
source | link

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.

The 40ma figure is basically an approximation"Absolute Maximum" rating - a limit above which damage could be possible. At some current less than that, it is the current at whichlikely the voltage drop across the PMOS transistor is smallwill start to be great enough that the output voltage can stillonly marginally be considered a logic high"high" - but because there is a voltage drop, under high current conditions the output voltageit will be notably less than the supply. The more current the motor pulls, the lower the sourced voltage, and the lower the sourced voltage, the less current it pulls. 

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 sometimesometimes 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.

There really are no components on your typical Arduino board designed to directly control a motor.

Instead, for unidirectional control you should use a circuit with an NONNPN bipolar transistor, NMOS fetNMOS FET, magnetic relay, or solid state relay for unidirectional control. 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.

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.

The 40ma figure is basically an approximation - it is the current at which the voltage drop across the PMOS transistor is small enough that the output can still be considered a logic high - but because there is a voltage drop, under high current conditions the output voltage will be notably less than the supply. The more current the motor pulls, the lower the sourced voltage, and the lower the sourced voltage, the less current it pulls.

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 sometime 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.

There really are no components on your typical Arduino board designed to directly control a motor.

Instead, you should use a circuit with an NON bipolar transistor, NMOS fet, magnetic relay, or solid state relay for unidirectional control. 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.

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.

The 40ma figure is an "Absolute Maximum" rating - a limit above which damage could be possible. At some current less than that, it is likely the voltage drop across the PMOS transistor will start to be great enough that the output voltage can only marginally be considered a logic "high" - it will be notably less than the supply.  

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.

There really are no components on your typical Arduino board designed to directly control a motor.

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.

1
source | link

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.

The 40ma figure is basically an approximation - it is the current at which the voltage drop across the PMOS transistor is small enough that the output can still be considered a logic high - but because there is a voltage drop, under high current conditions the output voltage will be notably less than the supply. The more current the motor pulls, the lower the sourced voltage, and the lower the sourced voltage, the less current it pulls.

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 sometime 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.

There really are no components on your typical Arduino board designed to directly control a motor.

Instead, you should use a circuit with an NON bipolar transistor, NMOS fet, magnetic relay, or solid state relay for unidirectional control. 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.