Skip to content

MotorShield Motor Driver – Extension Board

This circuit board is a motor driver expansion solution developed by Qiguopai. It can drive 4 DC motors or 2 stepper motors, and additionally provides 8 full-speed PWM controls for 8 servos.

1. Overview

This circuit board is a motor driver expansion solution developed by Qiguopai. It can drive 4 DC motors or 2 stepper motors, and additionally provides 8 full-speed PWM controls for 8 servos.

Option 1: Raspberry Pi Driver Board

For Raspberry Pi driver board documentation, see: Raspberry Pi HAT Motor Driver Board

Option 2: Arduino Motor Driver Extension Board, which works with the driver board to expand control of multiple motors and servos. This article details this option.

For driver board documentation, see: Arduino MotorShield Motor Driver

2. Interface Description

MotorShield Motor Driver - Extension Board

Specifications:

  • 2.5A (3.6A peak) output per channel, supporting 4.5-13.5V DC motors;
  • Can drive 4 DC motors or 2 stepper motors;
  • Additional 8 PWM outputs for controlling 8 servos;
  • Built-in voltage regulator providing stable 3V or 5V power;
  • Customizable I2C address, supporting multiple driver stacking;

Power Supply:

  • Power 1: DC power interface, input voltage range 6-12V;
  • Power 2: Power cable connected to driver board, powered from driver board;

3. Case Studies

MotorShield Motor Driver - Extension Board

MotorShield Motor Driver - Extension Board

Note: The driver board and extension board communicate via I2C. You can use 4 jumper wires to connect the I2C interfaces of both boards.

4. Code Examples

Mixly Plugin and Examples Download: Graphical Programming Plugin V5.6

We have packaged Arduino and ESP32 plugins for Mixly graphical programming, ready to use directly. Code screenshots below:

MotorShield Motor Driver - Extension Board

Extension Board Example Code Download: Arduino Extension Board Example Code

/**This example demonstrates basic motor and servo control with driver and extension boards*/
#include <Wire.h>
#include "PS2X_lib.h"
#include "Adafruit_MS_PWMServoDriver.h"
#include "QGPMaker_MotorShield.h"

PS2X ps2x;
QGPMaker_MotorShield AFMS = QGPMaker_MotorShield(); // Driver board

// Extension board default I2C address is 50
QGPMaker_MotorShield AFMS50 = QGPMaker_MotorShield(0x50);
QGPMaker_MotorShield AFMS51 = QGPMaker_MotorShield(0x51);   // Second cascaded extension board
QGPMaker_MotorShield AFMS52 = QGPMaker_MotorShield(0x52);
QGPMaker_MotorShield AFMS53 = QGPMaker_MotorShield(0x53);

// Four driver board motors
QGPMaker_DCMotor *DCMotor_1 = AFMS.getMotor(1);
QGPMaker_DCMotor *DCMotor_2 = AFMS.getMotor(2);
QGPMaker_DCMotor *DCMotor_3 = AFMS.getMotor(3);
QGPMaker_DCMotor *DCMotor_4 = AFMS.getMotor(4);

// 4 extension board motors
QGPMaker_DCMotor *DCMotor50_1 = AFMS50.getMotor(1);
QGPMaker_DCMotor *DCMotor50_2 = AFMS50.getMotor(2);
QGPMaker_DCMotor *DCMotor50_3 = AFMS50.getMotor(3);
QGPMaker_DCMotor *DCMotor50_4 = AFMS50.getMotor(4);

QGPMaker_Servo *Servo0 = AFMS.getServo(0);      // Driver board servo #0
QGPMaker_Servo *Servo50_0 = AFMS.getServo(0);   // Extension board servo #0

5. Cascading

When 8 motors from driver + extension board are still not enough, you can cascade up to 4 extension boards, controlling up to 20 motors and 40 servos total.

MotorShield Motor Driver - Extension Board

Multiple drivers cascading requires setting a unique I2C address for each driver. Default address is 0x50. Address range is 0x50~0x53 (4 addresses total).

As shown above, solder different jumpers to set different addresses. Rules:

Board Address Offset
Board 0 0x50 binary 0000 (default all empty)
Board 1 0x51 binary 0001 (A0 only)
Board 2 0x52 binary 0010 (A1 only)
Board 3 0x53 binary 0011 (A0 & A1)

Adjust I2C addresses in code accordingly:

QGPMaker_MotorShield AFMS50 = QGPMaker_MotorShield(0x50); // (default all empty)
QGPMaker_MotorShield AFMS51 = QGPMaker_MotorShield(0x51); // (A0 only)
QGPMaker_MotorShield AFMS52 = QGPMaker_MotorShield(0x52); // (A1 only)
QGPMaker_MotorShield AFMS53 = QGPMaker_MotorShield(0x53); // (A0 & A1)

6. Schematic

MotorShield Motor Driver - Extension Board

Raspberry Pi Driver V5.0 Schematic