Servo motor controlled by potentiometer with Arduino

From Knowledge Kitchen
Jump to navigation Jump to search


This example shows how to control a servo motor by turning a potentiometer. The Arduino detects the changes to the rotation of the potentiometer and then maps those changes to rotations of the servo. Other types of variable resistors can easily be used in place of the potentiometer, by using the variable resistor in a Voltage divider circuit.


The circuit

Servo and potentiometer with Arduino circuit

The code

Servo and potentiometer with Arduino code


What links here