Install Software | Adafruit Motor Shield V2
Maybe your like
- Overview
- FAQ
- Install Headers & Terminals
- Install Software
- Library Reference
- Arduino Library Docs
- Powering Motors
- Using RC Servos
- Using DC Motors
- Using Stepper Motors
- Python & CircuitPython
- Python Docs
- Stacking Shields
- Resources
- Single page
- Feedback? Corrections?
- Text View
-
Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit $19.95 Add to Cart -
Motor party add-on pack for Arduino $39.95 Add to Cart -
Stepper motor - NEMA-17 size - 200 steps/rev, 12V 350mA $14.00 Add to Cart -
Small Reduction Stepper Motor - 5VDC 32-Step 1/16 Gearing $4.95 Add to Cart -
Small Reduction Stepper Motor - 12VDC 32-Step 1/16 Gearing $4.95 Add to Cart -
DC Toy / Hobby Motor - 130 Size $1.95 Add to Cart -
Continuous Rotation Servo $11.95 Add to Cart -
Standard servo - TowerPro SG-5010 $12.00 Add to Cart
Install Software
Install Adafruit Motor Shield V2 libraryTo use the shield on an Arduino, you'll need to install the Adafruit Motorshield v2 library. This library is not compatible with the older AF_Motor library used for v1 shields. However, if you have code for the older shield, adapting the code to use the new shield isn't difficult. We had to change the interface a little to support shield stacking, & we think its worth it!
To begin controlling motors, you will need to install the Adafruit_Motor_Shield_V2_Library library (code on our github repository). It is available from the Arduino library manager so we recommend using that.
From the IDE open up the library manager...
And type in adafruit motor to locate the library. Click Install
If you plan to use AccelStepper for acceleration control or for simultaneous control of multiple stepper motors, you will also need to download and install the AccelStepper library:
AccelStepper LibraryFor more details on how to install Arduino libraries, check out our detailed tutorial!
Running the Example CodeDC Motor
The library comes with a few examples to get you started up fast. We suggest getting started with the DC motor example. You can use any DC motor that can be powered by 6V-12VDCFirst, restart the IDE to make sure the new library is loaded. Plug the shield into the Arduino and connect a DC motor to motor port 1 - it does not matter which wire goes into which terminal block as motors are bi-directional. Connect to the top two terminal ports, do not connect to the middle pin (GND) See the photo below for the red and blue wire example. Be sure to screw down the terminal blocks to make a good connection!
You must also supply 5-12VDC to power the motor. There are two ways to do this
- You can power the Arduino via the DC Barrel Jack and insert the VIN Jumper shown as the tall black handle right next to the green Power LED below
- You can power the Arduino via the DC Barrel jack or USB port. Then Power the shield via the 5-12VDC motor power terminal port, the double terminal block next to the green Power LED and remove the VIN jumper
Once you have verified the motor is connected properly and you have the power LED lit up brightly, we can upload our code.In the IDE, load File->Examples->Adafruit_MotorShield->DCMotorTestYou should see and hear the DC motor turn on and move back and forth, attaching a slip of paper or tape as a 'flag' can help you visualize the movement if you have trouble seeing the movement Stepper Motor Test You can also test a stepper motor connection with the shield. The shield can run unipolar (5-wire and 6-wire) and bipolar (4-wire) steppers. It cannot run steppers with any other # of wires! The code is the same for unipolar or bipolar motors, the wiring is just slightly different.Plug the shield into the Arduino and connect a stepper motor to motor port 2 - unlike DC motors, the wire order does 'matter'. Connect to the top two terminal ports (coil #1) and the bottom two terminal ports (coil #2). - If you have a bipolar motor, do not connect to the middle pin (GND).
- If you are using a unipolar motor with 5 wires, connect the common wire to GND.
- If you are using a unipolar motor with 6 wires, you can connect the two 'center coil wires' together to GND
You must also supply 5-12VDC to power the motor. There are two ways to do this
- You can power the Arduino via the DC Barrel Jack and insert the VIN Jumper shown as the tall black handle right next to the green Power LED below
- You can power the Arduino via the DC Barrel jack or USB port. Then Power the shield via the 5-12VDC motor power terminal port, the double terminal block next to the green Power LED and remove the VIN jumper
If the Green LED isn't lit up brightly do not continue - you must power it via the VIN jumper or the terminal block
Once you have verified the motor is connected properly and you have the power LED lit up brightly, we can upload our code.In the IDE, load File->Examples->Adafruit_MotorShield->StepperTestYou should see and hear the stepper motor turn on and move back and forth, attaching a slip of paper or tape as a 'flag' can help you visualize the movement if you have trouble seeing the movement. There are four ways to move a stepper, with varying speed, torque and smoothness tradeoffs. This example code will demonstrate all four. Page last edited March 08, 2024
Text editor powered by tinymce.
Install Headers & Terminals Library Reference Related Guides Improve Brushed DC Motor Performance By Jan Goolsbey intermediate All About Stepper Motors By Bill Earl beginner 3D Printed Animatronic Robot Head By Rick Winscot beginner Improve the Low Speed of Brushed DC Motors By Jan Goolsbey intermediate CircuitPython Hardware: PCA9685 DC Motor & Stepper... By Tony DiCola intermediate Bluetooth Controlled Motorized Camera Slider By Ruiz Brothers beginner Motorized Camera Slider MK3 By Ruiz Brothers intermediate Adafruit Motor Selection Guide By Bill Earl beginner Your browser does not support the video tag. This links to the guide CurieBot: Arduino 101 Mini Robot Rover. CurieBot: Arduino 101 Mini Robot Rover By John Park beginner WiFi Controlled Mobile Robot By M. Schwartz beginner Adafruit LPS25 and LPS22 Barometric Pressure and... By Bryan Siepert beginner Adafruit PiCowBell HSTX DVI Output By Tim C beginner Adafruit TPL5110 Power Timer Breakout By lady ada beginner Adafruit AD5693R 16-Bit DAC Breakout Board By Liz Clark beginner Adafruit CAP1188 Breakout By lady ada intermediateCreate Wishlist
× Title Description Close Search SearchCategories
Tag » Arduino Adafruit Motor Shield V2 Library
-
Library Reference | Adafruit Motor Shield V2
-
Adafruit Motor Shield V2 Library - Arduino Reference
-
Adafruit/Adafruit_Motor_Shield_V2_Library: V2! - GitHub
-
Adafruit Motor Shield V2 Library
-
Adafruit Motor Shield V2 Arduino Library: Class Members - Functions
-
Adafruit Motor Shield V2 Arduino Library: Adafruit_MotorShield ...
-
Control Motors Using Adafruit Motor Shield V2 - MathWorks
-
Motor Shield V2.0 - Seeed Wiki
-
Adafruit/Adafruit Motor Shield V2 Library - PlatformIO Registry
-
Adafruit Motor Shield V2.3 - BC Robotics
-
Library Example: Adafruit_MotorShield : StepperTest - Codebender
-
Downloading The Adafruit Motor Shield V2 Library - O'Reilly
-
Adafruit Motor Shield V2
-
Adafruit Motor Stepper Servo Shield For Arduino V2 Kit
Improve Brushed DC Motor Performance By
All About Stepper Motors By
Improve the Low Speed of Brushed DC Motors By
CircuitPython Hardware: PCA9685 DC Motor & Stepper... By
Bluetooth Controlled Motorized Camera Slider By
Adafruit Motor Selection Guide By
WiFi Controlled Mobile Robot By
Adafruit LPS25 and LPS22 Barometric Pressure and... By
Adafruit PiCowBell HSTX DVI Output By
Adafruit TPL5110 Power Timer Breakout By
Adafruit AD5693R 16-Bit DAC Breakout Board By
Adafruit CAP1188 Breakout By