Learn how to troubleshoot servos that are not moving or moving erratically.
Quick checks
-
Check connections: Make sure the connection between the servo and the board is correct. Check the Basic servo control tutorial for a circuit diagram example.
-
Verify pin configuration: Confirm that you’ve connected the servo to the same pin referenced in the code. For example, if you are using the servo library, the code might inlcude a line such as
myservo.attach(9)
to link the servo to a specific pin on the board. In this case, the signal input on the servo should be connected to the pin 9 on the board. -
Power considerations: Servo motors draw significant power, and the board might not supply enough energy. If you need to drive more than one or two servos, you may need to power them from a separate supply (i.e. not the 5V pin on your Arduino). Make sure the grounds of the Arduino and the external power supply are connected. Check the diagram below for an example circuit: