basic h bridge board

Basic H-bridge board

Prototype revision v01. The schematic and routed layout passed native KiCad checks. Electrical, thermal and mechanical operating limits still need physical qualification. Contact Arthur at wolf.arthur@gmail.com if you need this board for a project.

The basic H-bridge drives one small brushed DC motor in either direction from a separate motor supply. Use the advanced H-bridge encoder board if your application requires an encoder interface.

Component side of the basic H-bridge with its two control sockets, motor supply and motor output connectors.

12 V DCnominal motor supply
0.5 Acontinuous motor current design target
50 × 50 mmboard outline with four M3 mounting holes

Electrical targets

Function Design target
Motor supply Nominal 12 V DC
Motor load 0.5 A continuous design target
Current regulation Approximately 1 A nominal trip threshold
Control 3.3 V logic on Gadgeteer pins 3 and 4
Mounting Four M3 corner holes on a 40 × 40 mm grid

Supply compatibility depends on the motor and load. During deceleration the motor can return energy to the drive. The 12 V target is provisional until the supply and board have been checked together for voltage rise when stopping under load.

Board tour

  1. Gadgeteer input (J1) Connect the host logic, PWM and direction.
  2. Gadgeteer chain (J2) Carries onward host signals and logic power.
  3. Motor supply (J3) Connect 12 V and ground.
  4. Motor output (J4) Connect the two brushed motor leads.
  5. H-bridge (U1) DRV8876 with phase and enable controls.
  6. 5 V indicator (D1) Shows host 5 V with its rear link closed.
  7. Motor supply indicator (D2) Shows protected motor supply with its rear link closed.
  8. Command indicators (D3 and D4) Show the speed and direction input levels.
  9. Fault indicator (D5) Shows the driver fault signal with its rear link closed.
LightMeaning when lit
5V, redHost 5 V is present.
VM, yellowThe protected motor supply is present.
PWM, blueThe speed request is high. Brightness can vary with duty cycle.
DIR, blueThe direction request is high.
FAULT, redThe driver is asserting its fault output.

Controller connection

The example direct connection uses Smoothieboard v2 Prime header G_F (J37) with corresponding physical contacts on the extension board. Check pin 1 and the connector orientation before applying power.

Contact Prime signal Motor board function
1 3.3 V Logic reference and driver wake
2 5 V Indicators and downstream supply
3 PB1 Speed request or enable
4 PJ4 Direction
5–9 Remaining host signals Routed to chain output contacts 3–7 in order
10 Ground Common logic and motor supply return

The chain output keeps the rails on contacts 1, 2 and 10 and leaves contacts 8 and 9 open. Verify the actual host signals and peripheral requirements before attaching a downstream board.

Two basic h-bridge boards on Smoothieboard V2 Prime connector G_F.

What you need

Use a Smoothieboard v2 Prime, a keyed 10-contact Gadgeteer cable, a current-limited 12 V supply and a small brushed DC motor. Check that the motor’s continuous current fits the 0.5 A design target, and use a meter or scope for the first setup.

Firmware control

You want Module Example
Variable speed SmoothieV2 Switch with GPIO sigma-delta M700 S64
Select direction with the motor stopped SmoothieV2 Switch with a digital output M702 or M703

The SmoothieV2 Switch module supports digital and sigma-delta outputs on GPIO. G_F can use digital enable or GPIO sigma-delta on PB1 and digital direction on PJ4. The published hardware PWM channel names refer to different controller pins. Variable-speed operation on this board still needs bench validation.

Set speed to zero and wait for the shaft to stop before changing direction. A zero speed request brakes the motor while the driver is awake. The motor outputs float when host logic power is removed and the driver goes to sleep. Disconnect the motor supply before rewiring.

Bench speed and direction controls

This configuration is for one unloaded motor. With motor power disconnected, reserve PB1 and PJ4, check that M700 through M703 are free in your installation, and merge these entries into the existing [switch] section. Check both signals with a meter or scope before connecting the motor supply.

[switch]
bridge_speed.enable            = true
bridge_speed.output_pin        = PB1
bridge_speed.output_type       = sigmadeltapwm
bridge_speed.input_on_command  = M700
bridge_speed.input_off_command = M701
bridge_speed.startup_state     = false
bridge_speed.startup_value     = 0
bridge_speed.halt_set_to       = false

bridge_direction.enable            = true
bridge_direction.output_pin        = PJ4
bridge_direction.output_type       = digital
bridge_direction.input_on_command  = M702
bridge_direction.input_off_command = M703
bridge_direction.startup_state     = false
bridge_direction.halt_set_to       = false

M700 S64 requests about one-quarter duty on the 0–255 scale. M701 stops the drive. With the motor stopped, M702 sets direction high and M703 sets it low. Rotation depends on the motor lead order. Repeat the startup and halt checks before motor commissioning. A halt leaves the motor supply energized.

Texas Instruments DRV8876 datasheet

Motor and supply wiring

With both supplies disconnected, connect the 12 V supply to J3 with positive on pin 1 and return on pin 2. Connect the brushed motor to J4, with motor lead A on pin 1 and B on pin 2. Swapping motor leads reverses the rotation for the same direction setting. J3H and J4H are the alternate 2.54 mm positions. J5 and J6 are the respective horizontal XT30 alternatives. Fit one connector per position. The motor supply shares ground with the controller.

For a bench setup, connect Prime G_F to J1, reserve both pins in the controller configuration above, and keep any chain board disconnected during initial commissioning. After verifying supply polarity, logic output and direction, check the motor unloaded before trying the intended load. Use the two pairs of cable-tie holes for strain relief.

Troubleshooting

If the motor stays still, check the 12 V input, the host 3.3 V reference and the PWM command at J1. If the fault light turns on, stop the motor and disconnect its supply. Check the load and motor wiring before cycling driver wake or host power to clear a latched overcurrent fault.

Mounting

The outline is 50 × 50 mm. Coordinates are hole centres from the upper-left corner, component side up.

Hole X (mm) Y (mm)
M3, upper left 5 5
M3, upper right 45 5
M3, lower left 5 45
M3, lower right 45 45
Left cable tie, upper 10.5 23.2
Left cable tie, lower 12 41.5
Right cable tie, upper 38 23.5
Right cable tie, lower 38 41.5

Electrical specifications

ParameterValueBasis
Motor supply12 V DC nominalDesign target. Check the supply under motor braking.
Motor current0.5 A continuousDesign target pending thermal validation.
Current regulationApproximately 1 A nominalSchematic setting for the driver current reference.
Control logic3.3 VGadgeteer host logic for speed and direction.

Downloads

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.