O'Reilly logo

Mastering Arduino by Jon Hoffman

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

Circuit diagrams

The following diagram shows how to connect the servo motor with the Arduino:

In this project, we will use the potentiometer to control the position of the servo motor. Notice that the potentiometer uses the 5V power source from the Arduino while the servo motor uses 6V (4 × 1.5V) from the batteries; however, the two power sources share a common ground. Now let's look at the code to control the servo motor.

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