I am building a little car project, and I have come across an issue that has made me go mental. I have a single motor (3V-5V), that on direct 3.3V & 5V output works fine. However, when I connect this to a digital port, it for some reason doesn't power. Of course, I first thought it was not supplying correct power, so I got myself a voltage meter and tried that. 3.3V outputs, well 3.3V, all fine. The digital port outputs 4-5V (when it is coded to). So here is my question: Why aren't my motors powering/turning?
1 Answer
Power is made up of two values, not one. Besides the voltage there is the current (P=VI), and it's the current you are lacking.
A motor needs a large amount of current to start turning (called the stall current) and a digital I/O pin can only supply a relatively small amount (absolute maximum 40mA, recommended maximum 25mA). The power pins though can supply many hundreds of mA.
You should never try and power a motor directly from an I/O pin since you risk damaging the I/O pin. Instead you should use the I/O pin to control an NPN transistor or N-channel FET, which is then used to switch the power (actually the ground connection) to the motor from one of the power pins.
Here is a good tutorial: http://www.circuitstoday.com/pwm-generation-and-control-using-arduino