Theoretically you could attach a motor to one of the digital pins on your Arduino and control it just like you control LEDs. However, if you try this it won’t actually work. Motors require more power than the digital pins on your Arduino can supply. When we talk about power this is more than just voltage. It is also important to consider current. Some motors only require 3V, which is similar to an LED. However they require more than the 40 mA that a digital pin on an Arduino can supply.
Work through:
- Driving High current Loads with an Arduino – This is a tutorial from the ITP program at NYU. You can use this to control DC motors spinning in a single direction.
- Servo Tutorial – This is one of the Arduino Tutorials at Adafruit. Servos will not turn all the way around. They will only turn through 180 degrees. The big difference from DC motors is that you can turn them to point is a specific direction.
Time to Play
- Get a dermal resistor and a small fan from Mr. Dickie. Build and program a device that will turn the fan on if something is too hot.
- Mount two photoresistors to a servo and program the Arduino to turn the servo to aim at a light