How does it work?
DC Motor 18 Click as its foundation uses the TB9051FTG, a motor driver which incorporates the output driver for the direct drive of a DC brushed motor intended for automotive use from Toshiba Semiconductor. While primarily targeting vehicle engine applications, such as electronic throttle and valve control, the TB9051FTG can also be suitable for controlling onboard systems operating at up to 5A, such as control of wing mirrors and trunk locks. Control functions include motor-related (forward, reverse, brake), PWM control, current limit control, H-side current monitor, diagnosis output, and built-in detection circuits for overcurrent, overheat, and low/high voltage.
DC Motor 18 Click communicates with MCU using several GPIO pins. The Enable pin, labeled as EN and routed to the CS pin of the mikroBUS™ socket, optimizes power consumption and is used for power ON/OFF purposes (driver operation permission). The Forward/Reverse/Brake mode can be selected according to PWM control signals routed to the PWN and RST pins of the mikroBUS™ socket.
The current, which flows to the high side in the H-bridge of motor-driven output, is monitored in real-time, where the user can select the way of the current monitoring. In the case of a 5V VCC power supply, the current can be monitored using an AN pin on the mikroBUS™ socket, and in the case of a lesser power supply (3.3V), monitoring is possible with the help of an added voltage divider between the OCM pin and GND. Selection can be performed by onboard SMD jumper labeled as ADC SEL.
This Click board™ also has an additional LED for anomaly indication. Suppose a state such as an overtemperature or overcurrent/under voltage is detected. In that case, such anomaly is indicated by a red LED marked as DIAG, which is also connected to the interrupt INT pin through which the user can also monitor the state of the diagnostic pin. In addition, there is the possibility of controlling the motor control output at the time of the overcurrent detection, which is realized through an onboard switch labeled as OCC. This switch is used for the judgment of whether the motor control output is ON(1) or OFF(0).
The DC Motor 18 Click supports an external power supply for the TB9051FTG, which can be connected to the input terminal labeled as VM and should be within the range of 4.5V to 28V, while the DC motor coils can be connected to the terminals labeled as OUT1 and OUT2.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use communication lines properly. However, the 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 various automotive applications such as throttle and valve control, various engine bulbs, storing of door mirrors, and seat positioning
On-board modules
TB9051FTG – motor driver which incorporates the output driver for the direct drive of a DC brushed motor intended for automotive use from Toshiba Semiconductor
Key Features
Key Features Low power consumption, ultra low on-resistance, anomaly detection features, selectable motor operation, PWM control, high-side current monitoring, diagnosis indicator, and more.
Interface
Analog,GPIO,PWM
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on DC Motor 18 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 |
LD2 | DIAG | – | Anomaly Detection LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | ADC SEL | Left | Current Monitoring Selection 3V3/5V: Left position 3V3, Right position 5V |
SW1 | OCC | Left | Overcurrent Motor Drive Output Control Switch |
DC Motor 18 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
External Power Supply VM | 4.5 | – | 28 | V |
Maximum Output Current | – | – | 5 | A |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the DC Motor 18 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for DC Motor 18 Click driver.
Key functions:
dcmotor18_cfg_setup
– Config Object Initialization function.dcmotor18_init
– Initialization function.dcmotor18_default_cfg
– Click Default Configuration function.
Examples description
This example application showcases ability of click board to control DC motors using PWM modulation in both direcations and different speeds.
void application_task ( void ) { static int8_t duty_cnt = 1; static int8_t duty_inc = 1; float speed = duty_cnt / 10.0; static uint8_t direction = 1; dcmotor18_set_direction( &dcmotor18, direction ); dcmotor18_set_speed_percentage ( &dcmotor18, speed ); if ( dcmotor18.direction ) { log_printf( &logger, "<<< " ); } else { log_printf( &logger, ">>> " ); } log_printf( &logger, "Speed: %d%%rn", ( uint16_t )( duty_cnt * 10 ) ); if ( 10 == duty_cnt ) { duty_inc = -1; } else if ( 0 == duty_cnt ) { duty_inc = 1; direction = !direction; } duty_cnt += duty_inc; Delay_ms( 1000 ); }
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.DCMotor18
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.