Skip to the content
PCBKitNew board
4 layers65.9 × 52.7 mmMotor shield, the printed circuit board in 3D

Open Source hardware projects developed by the DCC-EX Team

Size
65.9 × 52.7 mm
Copper layers
4
Thickness
1.6 mm
Parts
123
Nets
93
Pads
475
Tracks, vias
828, 273
Pours
240
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
27 Apr 2023
Updated
5 Apr 2024

Overview

Motor shield is an open-source printed circuit board by DCC-EX, from the DCC-EX/EX-Hardware repository on GitHub, published under the CERN-OHL-W-2.0 licence. It is a 4-layer board of 65.9 × 52.7 mm with 123 parts on 93 nets, routed with 828 tracks and 273 vias.

It is built around the ARDUINO UNO R3, LMV321 and MP9942GJ-Z, with the 74HC04D, 74HC08D and 74HC32D among its other parts. Its parts include 40 capacitors, 22 resistors, 10 connectors, 7 ICs and 6 diodes. It belongs with the robots and motor control boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

10

README

EX-Motorshield8874/README.md

EX-Motorshield8874

Overview

Produktfoto_3_1

The EX-Motorshield8874 is a pin compatible with the original Arduino Motor Shield Rev3 but provides significantly improved electrical performance for driving higher loads, with lower power dissipation, and improved usability.

The EX-Motorshield8874 is based on two DRV8874 H-bridge motor drivers with integrated current sensing from Texas Instruments (TI). It is used to drive inductive loads like relays, solenoids, DC and stepping motors.

Powering of Arduino motherboard is possible due to the onboard DC/DC buck converter, supporting a wide input supply range from 9 to 30V. The reverse polarity protection prevents damage to the circuit and its components in case the power supply is accidentally connected with reversed polarity.

This Shield features a green status LED which provides a visual indication of the power supply status.

Compatibility with Arduino Motor Shield Rev3

The EX-MotorShield8874 is pin compatible with the original Arduino Motor Shield but provides significantly improved electrical performance for driving higher loads. Input voltage range is 9-30VDC and the maximum peak output is 5A per channel, in contrast to 5-12VDC and 2A peak for the original Arduino Motor Shield.

There is also almost no voltage drop incurred from the input voltage due to the MOSFET based design, unlike the bipolar L298 used in the Arduino Motor Shield. For DCC and DC PWM model railway use, a range of 10-24VDC is recommended depending on scale.

Motor Driver Configuration for DCC-EX EX-CommandStation

The EX-MotorShield8874 will work with the STANDARD_MOTOR_SHIELD definitions in MotorDrivers.h, but that is not ideal for several reasons. It will both unnecessarily limit current output, ignore the fault pin, and not read current correctly.

The following motor definitions are required, and appear in later versions of EX-CommandStation, with the tag EX8874_SHIELD, which will differ according to whether the Command Station is an UNO or Mega with 5V 10-bit ADC, or a 3.3V capable system with 12-bit ADC:

c++
// EX 8874 based shield connected to a 5V system (like Arduino UNO/Mega) and 10bit (1024) ADC
#define EX8874_SHIELD F("EX8874"), \
 new MotorDriver( 3, 12, UNUSED_PIN, 9, A0, 5.08, 5000, -A4), \
 new MotorDriver(11, 13, UNUSED_PIN, 8, A1, 5.08, 5000, -A5)

// EX 8874 based shield connected to a 3V3 system with 12-bit (4096) ADC
#define EX8874_SHIELD F("EX8874"), \
 new MotorDriver( 3, 12, UNUSED_PIN, 9, A0, 1.27, 5000, -A4), \
 new MotorDriver(11, 13, UNUSED_PIN, 8, A1, 1.27, 5000, -A5)

Control Pin Assignments

Default Pin Assignment for DCC-EX/Arduino motor control

The EX-MotorShield8874 has the following default pin assignment for control pins on the Arduino header, and is used for full Arduino Motor Shield R3 compatibility when used for DCC-EX EX-CommandStation.

FunctionChannel A PinChannel B Pin
PWM      D3  D11
DirectionD12D13
Brake    D9  D8
Current sensingA0A1
Fault_N  A4  A5

Default pin assignment is used for DCC-EX command stations, and has the DRV8874 mode select pin PMODE = high.

Alternative Pin Assignment for DCC-EX/Arduino motor control 

All motor control signals can be connected to two different Adruino header pins. Selecting between the default pin out and the alternative pin out is done via solder jumpers on the PCB which must be first cut to disable the default position, then solder applied to select the alternate position.

FunctionChannel A PinChannel B Pin
PWM      D2  D5
DirectionD10D4
Brake    D7  D6
Current sensingA2A3
Fault_N  D0  D1

NB: For DCC-EX control, these are not ideal pin assignments and are intended for future support of stacking of two shields. Further documentation updates will be available once testing of this mode is complete.

Fault indicator

The H-Bridges are protected against supply undervoltage, charge pump undervoltage, output overcurrent and device overtemperature. Fault conditions are indicated on the pin nFAULT of the H-Bridge driver. The open drain output of the fault indicator is pulled low during a fault condition and pulled to high with the on board pull-up resistor. There is one fault indicator per channel.

NOTE for UNO users: the nFAULT pins are routed to the same pins used for I2C on the ATMEGA329P used on the Arduino UNO R3, namely A4 and A5. As such, if you are to use an EX-MotorShield8874 on an Arduino UNO, please cut the default track on the relevant jumpers to disable them. If you want to use the nFault pins you will need to manually jumper them to any available alternate digital input pins, then configure the Motor Driver entry in EX-CommandStation to suit the pins used.

Alternative pin assignment for other motor control applications

The alternative pin assignment for motor control (PH/EN mode) allows to control the motor in a speed and direction type interface. This mode is selected via Jumper J101 (DRV8874 mode select pin PMODE = low) and is NOT required for use with DCC-EX. It is documented for completeness.

FunctionChannel A PinChannel B Pin
PH      D3  D11
END12D13
Brake    D9  D8
Current sensingA0A1
Fault_N  A4  A5

Electrical Parameters

The DCC-EX Motor Shield provides the following electrical parameters.

ParameterValue
Operating voltage range9-30VDC, polarity protected
Maximum H-bridge current  5A peak per channel
Arduino supply voltage output (VIN)7.2V@2A max
IO voltage              3.3 and 5V, using IOREF by default
I2C connectivity        Dupont, 2.54mm dual row pin, and STEMMA QT/Qwiic Headers
Current sensing        Yes, adjusts range to IOREF voltage
Control modes possiblePWM, by default, PH/EN via jumper

Current Sensing

Current sensing is independently available for each channel. The Arduino IOREF supply voltage is sensed automatically, and adjusts the gain factor for the current sensing to take advantage of the full ADC input voltage range for 5V or 3.3V microcontrollers. The sense factors are calculated as follows for DCC-EX motor driver definitions:

IOREF Voltage:5V3V3
10-bit ADC, 1024 count5.084.94
12-bit ADC, 4096 count1.271.24

These values have been incorporated into EX-CommandStation Motor Driver definitions, so selecting EX8874_SHIELD as the MOTOR_SHIELD_TYPE in config.h will configure it correctly.

Track LEDs

LEDs are provided for each channel, indicating the corresponding H-Bridge is supplying power to output connectors.

Header Pin Assignments

The following pin assignments have been used for the various connectors.

I2C Headers

Three I2C expansion headers (Dupont, dual-row 8-pin, and STEMMA QT/Qwiic) allow connecting either an OLED display or other additional I2C based devices.

Arduino Header

On the Arduino header, the default upper right I2C pins are used for I2C:

FunctionUNO R3 PinMega Pin
SCLD18/A5D21
SDAD19/A4D20
DIP Header

The dual-row 8-pin header has the following pin assignments:

FunctionOdd PinEven Pin
IOREF12
SDA34
GND56
SCL78
OLED Header

The single-row 4-pin OLED header has the following pin assignments, which are standard for many I2C capable OLED displays:

FunctionPin
GND1
IOREF2
SCL3
SDA4
STEMMA QT/Qwiic Connector

STEMMA QT/Qwiic connector pin assignments are per the standard, but included for completeness:

FunctionPinColour Code
GND1Black
3v32Red
SDA3Blue
SCL4Yellow

NOTE STEMMA QT power is tied to 3v3 as that is required for the standard. When using the EX-MotorShield8874 with 5V motherboards such as UNO and Mega, any I2C peripherals connected to the STEMMA QT connector must be 5V-tolerant only!

Pull-up resistors for the I2C communication are not populated by default. If required, pull-up resistors (R101, R102) can be populated on the board, though this is typically not necessary.

Reset button

A reset button is provided to reset the Arduino board.

PCB Jumpers

Various PCB jumpers are provided to alter functionality of the board to suit user needs. These include jumpers to alter pin assignments for driving the motor shield, to disable the onboard 7.2V regulator or disconnect it from the VIN, and jumpers to override the IOREF pin for ADC range selection.

Aternate Pin Assignment PCB Jumpers

Alternate_Pin_Assignments

There are 5 sets of PCB jumpers for each motor driver IC, some or all of which can be used to reassign Arduino pins to the various logic functions. The table below lists them in order as they appear on the PCB:

FunctionDriver A DefaultDriver A AlternateDriver B DefaultDriver B Alternate
PWM      D3  D2D11D5
FaultA4  D0A5D1
BrakeD9  D7D8D6
DirectionD12D10D13D4
Current senseA0A2A1A3

Power Configuration PCB Jumpers

There are 4 sets of PCB jumpers to change the way power is handled on the board. One on the top of the board, and 3 on the bottom, shown here:

Bottom_Power_Config_Jumpers Top_Power_Config_Jumper

JumperFunction
Regulator EnableDefaults to ENABLED, cut between pads to DISABLE onboard 7.2V regulator
IOREF OverrideDefaults to IOREF used as power source, cut and then solder to either 5V or 3V3 to power logic and current sense
VINDefaults to NOT connected. CAUTION: soldering these pads CONNECTS motor power to VIN and should not be needed
Regulator to VIN (unlabelled)Defaults to ON, cut to stop providing regulated 7.2V power to VIN to power the Arduino

Manufacturing Notes

Bill of Materials (BOM)

The bill of materials spreadsheet above is optimised for manufacture at JLCPCB (https://jlcpcb.com/) at present, and will allow assembly of all components except the DC barrel jack, motor output connectors and Arduino shield stackable headers.

PCB Material Specifications

For best performance, 1oz copper for both outer and inner layers of this 4-layer PCB are safest. Of course 2oz copper can be specified, but this is not deemed necessary from testing so far and cost may be prohibitive. Also, using FR-4 TG155 will give additional safety margin. The design can be made lead-free, provided all components are also lead-free types. JLCPCB currently does not have lead-free connectors for DCC track or DC input power, so those components are not in the default Bill of Materials (BOM).

Stacking Multiple Shields

It is possibile to stack two EX-MotorShield8874s, though for use in in DCC-EX EX-CommandStation this is not fully tested or yet supported by software configuration.

Produktfoto_3_4

There are two different proposed operating modes possible:

  1. Independent district mode: The DCC-EX Motor Shields are controlled independently using different control signals. This allows a total 4 independent H-Bridges to be driven completely independently for separate DCC or DC PWM districts.
  2. Parallel booster mode: Both EX-MotorShield8874s are controlled with the same control signals so both pairs of H-bridges are running in parallel. This mode is used to increase the current capabilities of the 2 DCC or DC PWM districts.

This information is provided for reference. Documentation will be updated when both of these modes are fully tested and configured in DCC-EX EX-CommandStation.

CAUTIONARY NOTE: Only one EX-MotorShield8874 should provide power to the underlying motherboard from the DCC power feed! The jumper connecting the top VIN feed pin from the onboard 7.2V regulator to the Arduino sheild connectors must be cut on one of the stacked shields. It is also advisable to cut the ENABLE pin for the onboard regulator as that will turn it off completely as well. (See documentation of Power Configuration PCB Jumpers, above!)

Reference

 

Parts

123
QtyValueFootprintReferences
15Jumper_3Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mmJP101, JP102, JP103, JP105, JP106, JP108, JP109, JP110, JP111, JP112, JP113, JP114, JP115, JP116, JP117
11100n_my:C_1005_(0402)C101, C104, C107, C108, C114, C115, C201, C207, C223, C224, C225
1147k_my:R_1005_(0402)R101, R102, R105, R106, R107, R108, R113, R204, R205, R207, R208
822uCapacitor_SMD:C_0805_2012MetricC111, C204, C205, C206, C219, C220, C221, C222
6-Capacitor_SMD:C_1210_3225Metric_Pad1.33x2.70mm_HandSolderC213, C214, C215, C216, C217, C218
510u VMCapacitor_SMD:C_1206_3216MetricC102, C105, C210, C211, C212
40603_LED_RedLED_SMD:LED_0603_1608MetricD101, D102, D103, D104
3-_my:PinHeader_01x03_P2.5mm_Vertical_minJ102, J104, J202
3100n VM_my:C_1005_(0402)C103, C106, C203
3470k_my:R_1005_(0402)R114, R201, R203
3FiducialFiducial:Fiducial_1mm_Mask2mmFID104, FID105, FID106
3Jumper_4_my:SolderJumper-4JP104, JP107, JP205
3Toolinghole_jlc_my:toolinghole_jlcFID101, FID102, FID103
2100u VMCapacitor_SMD:CP_Elec_6.3x7.7C208, C209
210kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR103, R104
21k43_my:R_1005_(0402)R109, R110
222n_my:C_1005_(0402)C112, C113
222n VM_my:C_1005_(0402)C109, C110
2732R_my:R_1005_(0402)R111, R112
2AO3400APackage_TO_SOT_SMD:SOT-23Q101, Q102
2DRV8874PWPR_my:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46_HiAmpU104, U105
2Jumper_2Jumper:SolderJumper-2_P1.3mm_Bridged2Bar_RoundedPad1.0x1.5mmJP202, JP203
2Jumper_2_oJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP201, JP204
2MC 1,5/ 2-G-3,5_my:PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_Horizontal_editedJ101, J103
1-_my:PinHeader_1x02_P2.54mm_Vertical_minJ201
10603_LED_GreenLED_SMD:LED_0603_1608MetricD202
110VDiode_SMD:D_SOD-323D201
110u VM 0805Capacitor_SMD:C_0805_2012MetricC202
120R_my:R_1005_(0402)R202
156uH_my:L_PSPMAA0805L201
15k76_my:R_1005_(0402)R206
174HC04Package_SO:SO-14_3.9x8.65mm_P1.27mmU101
174HC08Package_SO:SO-14_3.9x8.65mm_P1.27mmU102
174HC32Package_SO:SO-14_3.9x8.65mm_P1.27mmU103
1AOD4185Package_TO_SOT_SMD:TO-252-2Q201
1Arduino_UNO_R3Module:Arduino_UNO_R3A101
1Barrel_Jack_MountingPin_my:BarrelJack_2.1mmJ203
1Conn_01x04_fConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ107
1Conn_02x04_smdConnector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_Vertical_SMDJ106
1LMV321Package_TO_SOT_SMD:SOT-23-5U106
1LOGO_my:DCC-EX-30mmG***
1LOGO_my:DCC-EX-15mmG***
1LOGO_my:semify_bigG***
1MP9942GJ_my:TSOT23-8U201
1STEMMA QTConnector_JST:JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_HorizontalJ105
1Switch_my:SW_SPST_TS-1088-AR02016SW101

The 122 most common of 123 parts.

Questions

How big is the Motor shield PCB?

It measures 65.9 × 52.7 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Motor shield use?

123 parts, built around the ARDUINO UNO R3, LMV321, MP9942GJ-Z and 74HC04D. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Motor shield KiCad files?

From the DCC-EX/EX-Hardware repository on GitHub, at the commit this page was made from: the board is EX-Motorshield8874/motor-shield.kicad_pcb and its schematic EX-Motorshield8874/motor-shield.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Motor shield design in my own project?

Its repository publishes it under the CERN-OHL-W-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 4 layers65.9 × 52.9 mmMotor shield, the printed circuit board in 3D

    Motor shield

    DCC-EX/EX-MotorShield8874

    Design files for the open source 5A Motor Shield

    114 parts12
  • 2 layers84 × 133 mmRadio kiosk fixed, the printed circuit board in 3D

    Radio kiosk fixed

    Filip-Kin/frc-radio-kiosk

    Bench box that powers and configures FRC radios: dual-mode PoE (802.3at via LTC4279, passive 12 V via TPS26600), USB-C PD or DC in, 15.6 V out for the Toughbook, 4x CR123A backup, STM32F072 firmware.

    192 parts
  • 2 layers191.8 × 121.3 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-UART-Computer-1-2

    Legacy: Version 1 and 2 of my TTL-only CPU featuring UART I/O, an expansion port, 512KB SSD at up to 10MHz clock speed

    109 parts184
  • 2 layers306.1 × 130.2 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-64-Home-Computer

    Legacy: Full TTL-only home computer with VGA and PS/2 and twice the processing power of a Commodore 64

    132 parts94
  • 2 layers216 × 150 mmMotherboard-101, the printed circuit board in 3D

    Motherboard-101

    artemisamsx/artemisa

    Schematics, PCB designs and HDL simulations to build a 8-bits MSX computer

    124 parts67
  • 2 layers178 × 711 mmMSAP-2 rev.A SMD, the printed circuit board in 3D

    MSAP-2 rev.A SMD

    mehrantsi/MSAP-2

    An 8-bit computer. Successor to MSAP-1

    658 parts13MIT
  • 4 layers170 × 130 mmZ80Atmega128, the printed circuit board in 3D

    Z80Atmega128

    46nori/Z80Atmega128

    Real Z80A system with I/O emulated by AVR(ATmega128)

    109 parts9GPL-3.0
  • 4 layers220 × 170 mmArpeggiator, the printed circuit board in 3D

    Arpeggiator

    EwoudVV/arpeggiator

    12-note analog arpeggiator with a 1/2/3 octave range, custom pcb and printed case

    360 parts3