Introduction: Arduino : How to Control Servo Motor With Motor Shield

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

Step 1: Tutorial

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.

Step 2: Hardware Required

Hardware Reqiured:

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

Step 3: Connections

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

Step 4: Programming

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.

Step 5: If I Was Helpful

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

Comments

author
marciokoko (author)2017-03-11

So we cant reference the servos by any special name, just their pin numbers? I thought the shield and library might bring a name like SERVO_1 and SERVO_2 as printed on some boards.

author
TheStudio (author)marciokoko2017-08-15

you can name the servos before void(setup) in your code easily

author
Arduino12345 (author)2017-08-02

LOLOLOLOLOLOLOL MYSHIELD OISNT WORKING WAT DA HECK?!?

but some pins are solderred togeter mayby a shot cercit

author
ahmet_024102 (author)2016-10-26

teşekkürler mert hocam. güzel paylaşım.

About This Instructable

5,492views

59favorites

License:

Bio: For more projects and tutorial visit my YouTube channel Mert Arduino and Tech
More by MertArduino:Arduino - MPU6050 GY521 - 6 Axis Accelerometer + Gyro (3D Simulation With Processing)NodeMCU ESP8266 - WiFi Robot Car Controlled by Application (Wifi Bot / Android / IoT)Arduino - Programmable Robotic Arm (Record and Repeat of the Servo Positions)
Add instructable to: