The Arduino will allow you to attach low power devices directly to its pins but items such as motors requiring more power require a transistor. A Transistor allows you to switch big volts using little volts. In circuit 03 we wil be switching a motor.
It uses a 1N4001 diode to act as a flyback diode which eliminates or suppresses voltage spikes seen across an inductive load when a voltage supply is suddenly reduced or removed.
The transistor here is a NPN (P2N2222AG) type which means that:
Simples this one….
This one uses analog values to set the speed of the motor. I’ve added a little loop at the top which stops the motor from going on and on in respond to nothing forthcoming when I was looking up how to stop the Arduino loop. It was also interesting to see that the motor doesn’t really respond under ~50.
This was the final one I tried and it works ok.