O'Reilly logo

Arduino Development Cookbook by Cornel Amariei

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling small motors

Controlling a small motor can be very simple. If the motor is small enough, it can be directly connected to the Arduino pin, and simply turning the pin to HIGH or LOW will control the motor.

This recipe will teach you the basic logic of how to control a motor; however, this is not a typical way of connecting a motor to the Arduino. It is recommended that you first understand this recipe and then apply the following one, Controlling motors with transistors.

Getting ready

Following are the ingredients required to execute this recipe:

  • An Arduino board connected to a computer via USB
  • A 220-ohm resistor
  • A very small DC motor—usually a vibration motor will work—that can be found in old (and new) mobile phones or can typically be brought ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required