How does it work?
H-Bridge 15 Click is based on the DRV8834, a dual-bridge stepper or DC motor driver from Texas Instruments. The output driver block of each H-Bridge consists of N-channel power MOSFETs configured as an H-Bridge to drive the motor windings. Each H-Bridge includes circuitry to regulate or limit the winding current. There are two general control modes. The indexer logic with simple step/direction control and up to 1/32-step micro-stepping is one. The other is a phase/enable control that can drive external references for more than 1/32-step micro-stepping.
The PCA9538, a low-voltage 8-bit I/O port from NXP, controls the logic states of the motor driver inputs. By setting the CONFIG input pin of the motor driver to a High state, you can select the indexer mode. Otherwise, you can select the phase/enable mode. Please note that you can drive DC motors only in phase/enable mode, while a stepper motor can be driven in any of these. The PCA9538 allows you to control the enable inputs of both bridges, micro-step modes, step inputs, direction, sleep mode, and more. It even takes the fault outputs of the motor driver.
The voltage reference for both bridges is provided by the motor driver voltage reference output and two onboard potentiometers labeled VREF A and VREF B. Over those potentiometers, you can set the winding current for both bridges. The decay modes for both bridges are left for you to set over unpopulated jumper resistors.
H-Bridge 15 Click uses a standard 2-wire I2C interface of the PCA9538 to allow the host MCU to control the motor driver inputs. It also notifies the host MCU if any fault condition occurs over the INT pin. The RST pin allows you to reset the PCA9538. The i2c address for this I/O port can be set over the I2C ADDR jumpers. There is also the ENA pin, which, in indexer mode, can turn all outputs on or off.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Specifications
Type
Brushed
Applications
Can be used for the development of battery-powered toys, POS printers, video security cameras, robotics, and more
On-board modules
DRV8834 – dual-bridge stepper or DC motor driver from Texas Instruments.
Key Features
A dual H-Bridge current-control motor driver, can drive two DC motors or one stepper motor, two control modes, a wide power supply voltage range, two potentiometers for controlling the winding current, and more
Interface
I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V,External
Pinout diagram
This table shows how the pinout on H-Bridge 15 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
– | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
ADDR0-ADDR1 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
P1 | VREF A | – | Bridge A Current Set Potentiometer |
P2 | VREF B | – | Bridge B Current Set Potentiometer |
H-Bridge 15 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
External Power Supply | 2.5 | – | 10.8 | V |
Continuous Output Current | – | 1.5 | – | A |
Software Support
We provide a library for the H-Bridge 15 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for H-Bridge 15 Click driver.
Key functions
-
hbridge15_set_pins
H-Bridge 15 set pins function. -
hbridge15_set_sleep
H-Bridge 15 set sleep function. -
hbridge15_set_out_state
H-Bridge 15 set output function.
Example Description
This example demonstrates the use of the H-Bridge 15 Click board™ by driving the motor in both directions with braking and freewheeling.
void application_task ( void )
{
log_printf( &logger, " Motor in forward mode. rn" );
hbridge15_set_out_state( &hbridge15, HBRIDGE15_DRIVE_MOTOR_FORWARD );
Delay_ms( 5000 );
log_printf( &logger, " Motor brake is on rn" );
hbridge15_set_out_state( &hbridge15, HBRIDGE15_DRIVE_MOTOR_BRAKE );
Delay_ms( 2000 );
log_printf( &logger, " Motor in reverse mode. rn" );
hbridge15_set_out_state( &hbridge15, HBRIDGE15_DRIVE_MOTOR_REVERSE );
Delay_ms( 5000 );
log_printf( &logger, " Motor is coasting rn" );
hbridge15_set_out_state( &hbridge15, HBRIDGE15_DRIVE_MOTOR_FREEWHEEL );
Delay_ms( 2000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.HBridge15
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.