Arduino : How to Control Servo Motor With Motor Shield

by MertArduino in Circuits > Arduino

45282 Views, 70 Favorites, 0 Comments

Arduino : How to Control Servo Motor With Motor Shield

motor_shield_servo.jpg

This instructable is the written version of my "Arduino : How To Control Servo Motor with Motor Shield" YouTube video that I've uploaded recently. I strongly recommend you to check it out.

Visit YouTube Channel

Tutorial

Arduino : How To Control Servo Motor with Motor Shield

Hobby servos are the easiest way to get going with motor control. They have a 3-pin 0.1" female header connection with +5V, ground and signal inputs. The motor shield simply brings out the PWM output lines from Arduino pins 9 and 10 to two 3-pin headers so that its easy to plug in and go. They can take a lot of power so a 9V battery wont last more than a few minutes!

The nice thing about using the onboard PWM is that its very precise and goes about its business in the background. You can use the built in Servo library.

Hardware Required

vlcsnap-2016-10-17-00h13m21s501.png

Hardware Reqiured:

  • Arduino
  • Motor Shield (Used like Adafruit)
  • Servo Motor
  • Battery & Power Jack

Connections

vlcsnap-2016-10-17-00h13m37s978.png
vlcsnap-2016-10-17-00h13m51s908.png
vlcsnap-2016-10-17-00h13m58s574.png
vlcsnap-2016-10-17-00h14m06s824.png
vlcsnap-2016-10-17-00h14m29s953.png
circuit.jpg
vlcsnap-2016-10-17-00h14m45s217.png

Servo have a 3-pin 0.1" female header connection with +5V, ground and signal inputs. The motor shield simply brings out the PWM output lines from Arduino pins 9 and 10 to two 3-pin headers so that its easy to plug in and go

Programming

vlcsnap-2016-10-17-00h15m10s761.png
vlcsnap-2016-10-17-00h15m24s472.png

AFMotor Library Description :

To install, click on Downloads in the middle of the page, select Download as zip and uncompress the folder.

Rename the folder to AFmotor (check that the renamed folder contains the .cpp and .h files) and install into the Arduinosketches/libraries folder.

If I Was Helpful

vlcsnap-2016-10-16-17h03m22s221.png

First of all, I would like to thank you for reading this guide ! I hope it helps you.

If you want to support me, you can subscribe my channel and watch my videos.

Visit My YouTube Channel