Arduino Starter Kit - Video 6. Motorized PinwheelFollow article
In this tutorial Massimo Banzi, shows us how to use our Arduinos for real life situations. This project shows us how to use a DC motor to spin a color wheel at different speeds. Massimo also teaches us how to use a mosfet transistor in order to protect the circuit from potential current spikes from the DC motor.
A DC motor is a simple electro-mechanical device, normally powered by a 9V battery, whereas Arduino can only provide up to 5V from its pins. The other issue is when an electric motor is turned off it can generate a spike of voltage that can damage the circuit. In this tutorial, an arduino controlled mosfet transistor is used as a gate to open and close a separate circuit, where the electric motor is wired to a 9V battery. Since the motor and the Arduino are on two separate circuits, the Arduino is protected from dangerous spikes.
The mosfet is controlled by a simple push-button, that tells the transistor to close the circuit between the battery and the motor, causing the motor to start spinning. The code is actually simpler than in previous tutorials, as reading a signal from the button and applying it back to the mosfet transistor is all that needs to be done.