{
  "metadata": {
    "id": "adafruit-motor-shield-v2",
    "name": "Adafruit Motor/Stepper/Servo Shield v2",
    "type": "motor_driver",
    "description": "Arduino shield for driving up to 4 DC motors or 2 stepper motors and 2 servos. Features two TB6612 MOSFET H-bridge drivers (1.2A continuous, 3A peak per channel) and a PCA9685 16-channel PWM driver (12-bit, I2C interface) for motor speed control and servo control. Operates from 4.5–13.5 V motor supply, logic level configurable via Arduino IOREF (5V by default). Includes polarity-protected external power terminal, reset button breakout, and stacking headers for address selection (up to 32 shields stackable for 64 steppers/128 DC motors total). Ideal for robotics projects requiring multiple motors and servos.",
    "manufacturer": "Adafruit",
    "part_number": "1438",
    "datasheet_url": "https://cdn-learn.adafruit.com/downloads/pdf/adafruit-motor-shield-v2-for-arduino.pdf",
    "tags": [
      "motor driver",
      "shield",
      "Arduino",
      "TB6612",
      "PCA9685",
      "I2C",
      "DC motor",
      "stepper",
      "servo"
    ],
    "schema_version": "1.4.0",
    "version": "0.2.0",
    "taxonomy": [
      "actuator.motor_controller",
      "expansion.arduino_shield"
    ]
  },
  "node_geometry": {
    "width_px": 320,
    "height_px": 80,
    "shape": "rounded_rectangle"
  },
  "domains": [
    {
      "domain": "electrical",
      "power_domains": [
        {
          "id": "motor_v",
          "name": "Motor Supply",
          "nominal_voltage_V": 6,
          "voltage_range_V": [
            4.5,
            13.5
          ],
          "voltage_tolerance_percent": 10,
          "max_current_mA": 2400,
          "regulation_type": "unregulated",
          "ground_reference": "common",
          "description": "External motor power supply domain for shield (voltage to drive DC motors/steppers)"
        },
        {
          "id": "servo_v",
          "name": "Servo Supply",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            4.5,
            6
          ],
          "voltage_tolerance_percent": 10,
          "max_current_mA": "Dependent on chosen Arduino or external power supply",
          "regulation_type": "unregulated",
          "ground_reference": "common",
          "description": "External servo motor power supply domain for shield (voltage to drive servo motors), typically 4.5-6V"
        },
        {
          "id": "shield_logic",
          "name": "Shield Logic Level",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            3,
            5.5
          ],
          "voltage_tolerance_percent": 0,
          "regulation_type": "regulated",
          "ground_reference": "common",
          "compatible_domains": [
            "arduino.io_logic"
          ],
          "description": "Logic supply for shield electronics (powered via Arduino 5V or IOREF; supports 3.3V or 5V logic per IOREF pin setting)"
        }
      ],
      "resources": [
        {
          "id": "ext_power_term_pos",
          "functions": [
            {
              "name": "power_input"
            }
          ],
          "connector_type": "terminal_block",
          "power_domain_id": "motor_v",
          "description": "External motor power input terminal (2-pin block for motor voltage supply + and −)"
        },
        {
          "id": "ext_power_term_neg",
          "functions": [
            {
              "name": "ground"
            }
          ],
          "connector_type": "arduino_header",
          "power_domain_id": "motor_v",
          "description": "Common ground input for motor power, shared with Arduino GND and motor supply negative"
        },
        {
          "id": "5v_in",
          "functions": [
            {
              "name": "power_input"
            }
          ],
          "connector_type": "header_pins",
          "power_domain_id": "servo_v",
          "description": "5V input power for shield pwm and servo power. This should come from the Arduino 5V pin or the IOREF pin."
        },
        {
          "id": "gnd_in",
          "functions": [
            {
              "name": "ground"
            }
          ],
          "connector_type": "header_pins",
          "power_domain_id": "servo_v",
          "description": "Ground input power for shield pwm and servo power. This should come from the Arduino GND pin."
        },
        {
          "id": "motor_out_1",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor A output 1 (one lead of DC motor 1 or one coil of stepper 1)"
        },
        {
          "id": "motor_out_2",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor A output 2 (other lead of DC motor 1 / coil of stepper 1)"
        },
        {
          "id": "motor_out_3",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor B output 1 (one lead of DC motor 2 or second coil of stepper 1)"
        },
        {
          "id": "motor_out_4",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor B output 2 (other lead of DC motor 2 / coil of stepper 1)"
        },
        {
          "id": "motor_out_5",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor C output 1 (one lead of DC motor 3 or one coil of stepper 2)"
        },
        {
          "id": "motor_out_6",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor C output 2 (other lead of DC motor 3 / coil of stepper 2)"
        },
        {
          "id": "motor_out_7",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor D output 1 (one lead of DC motor 4 or second coil of stepper 2)"
        },
        {
          "id": "motor_out_8",
          "functions": [
            {
              "name": "Motor_output"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "motor_v",
          "max_continuous_current_mA": 1200,
          "description": "Motor D output 2 (other lead of DC motor 4 / coil of stepper 2)"
        },
        {
          "id": "servo1_ground",
          "functions": [
            {
              "name": "ground"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "servo_v",
          "description": "Servo ground connector"
        },
        {
          "id": "servo1_pwm",
          "functions": [
            {
              "name": "pwm_output"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "servo_v",
          "description": "Servo pwm connector"
        },
        {
          "id": "servo1_5V",
          "functions": [
            {
              "name": "power_output"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "servo_v",
          "description": "Servo 5V Connector"
        },
        {
          "id": "servo2_ground",
          "functions": [
            {
              "name": "ground"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "servo_v",
          "description": "Servo ground connector"
        },
        {
          "id": "servo2_pwm",
          "functions": [
            {
              "name": "pwm_output"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "servo_v",
          "description": "Servo pwm connector"
        },
        {
          "id": "servo2_5V",
          "functions": [
            {
              "name": "power_output"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "servo_v",
          "description": "Servo 5V Connector"
        },
        {
          "id": "i2c_sda",
          "functions": [
            {
              "name": "i2c_sda"
            }
          ],
          "connector_type": "arduino_header",
          "power_domain_id": "shield_logic",
          "description": "PCA9685 I2C SDA (uses Arduino A4/A5 or dedicated I2C pins)"
        },
        {
          "id": "i2c_scl",
          "functions": [
            {
              "name": "i2c_scl"
            }
          ],
          "connector_type": "arduino_header",
          "power_domain_id": "shield_logic",
          "description": "PCA9685 I2C SCL (uses Arduino A4/A5 or dedicated I2C pins)"
        },
        {
          "id": "pca9685_addr_sel",
          "functions": [
            {
              "name": "digital_io"
            }
          ],
          "connector_type": "solder_jumper",
          "description": "5 address-selection jumpers (A0-A4 on PCA9685) for setting I2C address between 0x60-0x7F"
        }
      ],
      "interfaces": [
        {
          "id": "motor_power_in",
          "protocol": {
            "type": "power",
            "role": "input"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "max_instances": 1,
          "description": "External motor power input (connect battery or DC supply to shield's terminal block for motors)",
          "name": "Motor Power Input"
        },
        {
          "id": "5v_in",
          "protocol": {
            "type": "power",
            "role": "input"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "constraints": {
            "max_connections": 1,
            "requires_matching_voltage_domain": true
          },
          "max_instances": 1,
          "description": "Input power for servo motors. Typically 5V from Arduino 5V or external up to 6V",
          "name": "Servo Power Input"
        },
        {
          "id": "dc_motor_output",
          "protocol": {
            "type": "brushed_motor_power",
            "role": "output"
          },
          "requires": [
            {
              "function": "Motor_output",
              "count": 2
            }
          ],
          "constraints": {
            "max_connections": 4
          },
          "description": "Brushed DC motor driver outputs (supports up to 4 motors, each uses a pair of outputs). Each interface instance provides two outputs for one DC motor.",
          "name": "DC Motor Output"
        },
        {
          "id": "stepper_output",
          "protocol": {
            "type": "stepper_motor",
            "role": "output"
          },
          "requires": [
            {
              "function": "Motor_output",
              "count": 4
            }
          ],
          "constraints": {
            "max_connections": 2
          },
          "description": "Stepper motor driver outputs (uses 4 outputs per stepper). Supports up to 2 bipolar stepper motors (or unipolar with 4-coil control).",
          "name": "Stepper Output"
        },
        {
          "id": "servo_pwm",
          "protocol": {
            "type": "pwm",
            "role": "output"
          },
          "requires": [
            {
              "function": "pwm_output",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            },
            {
              "function": "power_output",
              "count": 1
            }
          ],
          "constraints": {
            "max_connections": 2
          },
          "description": "Servo control PWM output interface (16-channel PCA9685; typically 2 3-pin servo headers populated by default on this shield):contentReference[oaicite:52]{index=52}. Provides 5-6V power (from motor supply or Arduino 5V) and control signal for hobby servos.",
          "name": "Servo Output"
        },
        {
          "id": "i2c_slave",
          "protocol": {
            "type": "i2c",
            "role": "slave"
          },
          "requires": [
            {
              "function": "i2c_sda",
              "count": 1
            },
            {
              "function": "i2c_scl",
              "count": 1
            }
          ],
          "protocol_address": "0x60",
          "exclusive": false,
          "constraints": {
            "max_connections": 1
          },
          "description": "I2C interface to on-board PWM driver (PCA9685) for motor speed/servo control. Default address 0x60 (configurable via jumpers A0-A4 up to 0x7F).",
          "name": "I2C Slave"
        }
      ],
      "supply_voltage_V": [
        5,
        12
      ],
      "power_consumption_mW": 50,
      "pin_count": 28
    },
    {
      "domain": "mechanical",
      "resources": [
        {
          "id": "header_pins",
          "functions": [
            {
              "name": "structural"
            },
            {
              "name": "mounted"
            }
          ],
          "connector_type": "arduino_shield",
          "description": "Arduino R3 shield headers (connect to Uno form factor headers for structural and electrical support)"
        },
        {
          "id": "term_block",
          "functions": [
            {
              "name": "structural"
            }
          ],
          "connector_type": "terminal_block",
          "description": "2-pin terminal block for motor power (provides strain relief and mounting for power leads)"
        },
        {
          "id": "servo_header_block",
          "functions": [
            {
              "name": "structural"
            }
          ],
          "connector_type": "pin_header",
          "description": "3x4 right-angle male headers for servo connections (extends off board edge)"
        },
        {
          "id": "mount_holes_shield",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ],
          "connector_type": "none",
          "description": "Uses Arduino Uno mounting holes (shield is secured when Arduino is mounted; no separate mounting holes on shield PCB besides Arduino pattern)"
        }
      ],
      "interfaces": [
        {
          "id": "arduino_uno_shield_mount",
          "protocol": {
            "type": "arduino_uno_shield",
            "role": "shield"
          },
          "requires": [
            {
              "function": "mounted",
              "count": 1
            }
          ],
          "description": "Standard Arduino shield mounting (plugs into Arduino Uno R3 headers; mechanically supported by header friction and Arduino mounting posts)",
          "name": "Arduino Shield Mount"
        }
      ],
      "dimensions_mm": {
        "length": 70,
        "width": 55,
        "height": 15
      },
      "weight_g": 28
    },
    {
      "domain": "thermal",
      "interfaces": [],
      "operating_temperature_C": [
        -20,
        85
      ],
      "metadata": {
        "requires_thermal_management": false,
        "thermal_design_power_W": 2,
        "cooling_method": "passive"
      }
    }
  ],
  "design_rules": [
    "Use a **separate power supply** for motors via the shield’s terminal block. Do not power motors from the Arduino’s 5V supply – high current draw can brown out the board. The shield supports 4.5 V up to ~13.5 V motor voltage; choose a voltage appropriate for your motors (e.g., 6-12V).",
    "If motors stall or draw >1.2 A each, consider heat dissipation. The TB6612 drivers have thermal shutdown at ~1.2A continuous; short 3A peaks are OK (20ms) but sustained over-current will activate thermal limit. Use proper heat sinking or reduce load if chips run hot.",
    "For stacking multiple shields, ensure each has a unique I2C address. There are 6 solder jumpers (A0–A5) to configure addresses from 0x60 to 0x7F. Also note that when stacking, some motor outputs may be inaccessible physically (only 12 outputs accessible out of 16 when stacking due to header alignment).",
    "Motor polarity can be reversed in code by swapping output directions; do not reverse supply polarity on the terminal input (the shield includes polarity protection FETs, but it's good practice to connect correctly).",
    "The shield’s logic can operate at 3.3V if using a 3.3V microcontroller: the IOREF pin on Arduino will supply 3.3V to the shield’s logic translator if present. Verify that the default IOREF jumper is correctly set (on newer revisions, it defaults to IOREF instead of fixed 5V).",
    "Each servo connector on the shield is fed from the same supply as motors by default (VIN jumper). If using servos, it’s often better to power them from a 5-6V supply separate from the high-voltage motor supply. The shield has a **VIN vs. 5V jumper**: remove it to separate motor voltage from shield 5V. Provide 5V to the servo power rail if needed.",
    "To use the shield with Arduino Mega or other boards that have SDA/SCL on different pins, note: This v2 shield uses the dedicated SDA/SCL pins (on R3 headers) so it’s plug-and-play on Mega/Due. For older Arduinos without those pins, jumpers from A4/A5 to SDA/SCL are needed."
  ],
  "validation_requirements": [
    "Verify that the motor supply voltage connected to the terminal block is within 4.5–13.5V range and capable of supplying the combined stall current of all motors (including a safety margin).",
    "Ensure the Arduino’s 5V (or 3.3V IOREF) is **not** back-powered by the motor supply: if the VIN jumper is in place, the Arduino’s VIN feeds the shield’s motor supply (or vice versa). Check the jumper configuration and do not apply power to VIN and the terminal block simultaneously to avoid conflicts.",
    "Confirm I2C communications: on power-up, the PCA9685 PWM driver should ACK at its I2C address (0x60 by default). If the shield isn’t responding, check that the address jumpers match the code (and not accidentally bridged or mis-set). Also, ensure SDA/SCL lines aren’t used by another shield or device with conflicting address.",
    "If using stepper motors, validate that you have paired the correct outputs for each coil (A outputs for one coil, B outputs for the other coil of stepper 1, etc.). The library assumes the outputs in pairs as labeled on the board (M1/M2 for stepper1, M3/M4 for stepper2). Incorrect wiring will result in erratic stepper motion.",
    "Check that the screw terminal connections and motor wires are secure and not shorting. The terminal block should be tightened on stripped wire leads; a loose connection can cause voltage drop or arcing under high current.",
    "If stacking multiple shields, verify that you have only one set of stacking headers providing connections to the Arduino. Additional shields should have proper header spacing and the address pins configured uniquely. Test each shield separately before stacking to isolate any I2C or output issues."
  ],
  "usage_notes": "The Adafruit Motor Shield v2 greatly simplifies driving motors with an Arduino. Only two Arduino pins (SDA & SCL for I2C) are required for control – no more using up a bunch of PWM and control pins as the older v1 shield did. This shield offloads all motor PWM to the PCA9685 chip, so you can control motor speeds and even dim LEDs or drive servos without taxing the Arduino’s timers. **Driving DC Motors**: The shield provides four H-bridge channels (M1, M2, M3, M4 outputs). Each TB6612 driver handles two channels with up to 1.2A each. Connect your motor leads to the screw terminals labeled M1, M2, etc., and use the Adafruit MotorShield library to set speeds (0-255) and direction. The library will automatically use the PCA9685 to generate PWM for speed and toggle the direction pins through I2C commands. **Driving Steppers**: You can combine M1+M2 for one bipolar stepper and M3+M4 for a second stepper. The library supports single, double, interleaved, and microstep sequences easily. Make sure to supply a voltage that matches your stepper’s requirement at the VIN terminal. **Servos**: On the top of the shield, there are 2 sets of 3-pin headers for servos (labeled ‘Servo 1’ and ‘Servo 2’). These are directly connected to the Arduino’s pins ~9 and ~10 high-resolution timer outputs (not through the PCA9685). This design allows jitter-free servo control using the Arduino’s internal timer (as servo signals on Uno pins 9,10 are not blocked by the shield’s ICs). Simply plug in up to two hobby servos; they will be powered by the Arduino 5V (or VIN if jumper set), so be cautious with current draw. For more servos, you could repurpose other PCA9685 channels on the breakout pads or stack Adafruit 16-channel PWM boards. **Stacking Shields**: If you need more motors, you can stack shields – up to 32 on one Arduino (!). Each requires unique I2C addresses (0x60-0x7F). Stacking also linearly adds to the current draw and PCB heat, so consider spreading motor loads across multiple power supplies if needed. **Powering Servos vs Motors**: Often it’s convenient to run small DC motors at, say, 9V and servos at 5-6V. Because the shield by default ties servo power to the motor VIN, you might remove the VIN jumper and separately feed 5-6V into the servo power pins if your motor supply is higher. This flexibility is there for advanced users. In summary, this shield makes it **plug-and-play** to build a robot: attach motors, code with the provided library, and you’re off to the races (or the battle bots).",
  "application_examples": [
    "**4WD Rover**: Use 4 DC gear motors (one on each output M1-M4) to build a four-wheel drive robotic rover. The shield can independently set each motor’s speed for steering. Add an RC battery ~7.2V to VIN and you have a simple drivetrain for a robot car.",
    "**Bipedal or Hexapod Robot**: Control two small stepper motors (for a two-legged robot’s hip joints) or up to four DC motors. Additionally, connect servos for leg joints using the servo headers. The shield’s ability to drive steppers with microstepping via I2C simplifies coordinated leg movement.",
    "**Conveyor Belt with Stepper**: Drive a stepper motor (using M1-M2) for precise conveyor belt movement in a project or an automated feeder mechanism. The PCA9685’s PWM ensures smooth microstepping for precise control of the belt’s position.",
    "**Home Automation**: Control two curtain motors (DC motors on outputs M1 and M2) and perhaps a small water pump (DC motor on M3) for a indoor garden, while also controlling servo-actuated vents or valves. The shield can handle all these actuators simultaneously via I2C commands from the Arduino.",
    "**Classroom Robotics Lab**: Students can quickly prototype driving different motors by stacking shields on a single Arduino Mega. One shield could control a small robotic arm’s stepper motors, another shield drives a rover’s wheels, all from one controller by assigning different I2C addresses."
  ],
  "compatibility_notes": "This v2 motor shield is designed for Arduino Uno R3 and later, but it is broadly compatible with any Arduino that has the **R3 shield headers** (including Leonardo, Mega, Zero, etc.). On the Arduino Mega, the Wire library uses different hardware I2C pins, but since the shield routes to the dedicated SDA/SCL header, it works cleanly. For Arduino boards that run at 3.3V logic (like Due or some Feathers with a wing adapter), the shield can adapt because it uses the IOREF pin to know the logic level. The TB6612 driver chips are fine at 3.3V logic, and the PCA9685 works from 3V-5V logic as well. Just be sure to supply a proper motor voltage on VIN – the Arduino Due, for example, cannot supply VIN from 5V, so you’d need an external motor power. Also, note that this shield uses I2C address 0x60 by default; if you have other I2C devices, ensure no address conflict (commonly, 0x60-0x70 are used by some sensors or LED drivers). If a conflict exists, you can change the shield’s address using the jumpers. Finally, the shield doesn't use the Arduino’s PWM pins or other GPIO (aside from SDA/SCL), which means it's **stackable** with many other shields as long as they don’t also use the same I2C address. You could, for instance, stack an Adafruit LCD shield on top – it uses I2C address 0x20, so no conflict, and both will work. Keep in mind stacking many shields can mechanically stress the header connections and you might need to provide extra support spacers. Overall, the motor shield v2 plays nicely in an Arduino ecosystem, making heavy use of I2C to leave your microcontroller free for sensing and logic tasks.",
  "warnings": [
    "💡 **Motor Noise**: Brushed DC motors can generate a lot of electrical noise. The shield includes flyback diodes and filtering, but **always twist motor leads and optionally add external 0.1µF capacitors** across motor terminals to reduce EMI. This prevents resets or I2C glitches caused by motor inductive spikes.",
    "💡 **Current Limits**: The TB6612 drivers are rated 1.2A continuous. If your motor stalls (e.g., robot hits an obstacle), the stall current could be several times the running current. This may trigger the driver’s thermal shutdown. If you find a motor channel cutting out, it’s likely overcurrent. Consider using lower stall current motors, reducing motor voltage, or using parallel drivers (though you cannot parallel TB6612 outputs safely on this shield).",
    "💡 **Power Jumper**: The shield’s power jumper near the terminal block connects the Arduino VIN to the motor power. **If you have VIN and an external motor supply connected at the same time with the jumper in place, you risk feeding power back into the Arduino.** In general, remove that jumper when you have a separate motor PSU. Only leave it if you intend to power the motors from the Arduino’s VIN (not recommended for high current draw).",
    "💡 **Servo Power**: By default, the servo headers are fed from the Arduino’s 5V line (through a voltage regulator if VIN is used on Arduino). Two servos are usually fine drawing from Arduino 5V, but high-torque servos can draw >1A each. For many/large servos, power them separately. You can cut the trace or remove the servo power jumper on the shield and inject an appropriate servo voltage. Always connect grounds together when doing this.",
    "💡 **Stacking Orientation**: If stacking multiple shields, ensure the headers are aligned properly – it’s possible to off-by-one the connection and that can short Arduino pins. When stacking, check that the metal header pins or components on one shield don’t short against the underside of the next shield. Use standoffs if necessary to maintain a gap. And remember, stacking 62 of these for 992 PWM outputs may sound fun, but powering that many motors is a whole other challenge!"
  ]
}