How does it work?
Stepper 3 Click is based on the ULN2003A, a high-voltage, high-current Darlington transistor array from Texas Instruments. Motor step progression is performed by alternating the active driver, which sinks the current through the coil connected to the respective driver. The MCU performs the alteration cycle, which controls the driver inputs: a HIGH logic level on the input pin will set the corresponding driver to a LOW logic level, allowing it to sink current. Besides driving a unipolar stepper motor as the primary function, this Click board™ can also be used for driving relays and brushed DC motors or as the logic buffer for various applications. Combining more than one driver makes it possible to sink more than 500mA.
Stepper 3 Click uses four GPIOs to allow the host MCU to control the stepper motor or other mentioned device. Those pins are labeled as INA, INB, INC, and IND. Four output channels from the ULN2203A and a motor power supply are routed to the unpopulated 5-pin header. The motor can be powered over the 5V rail of the mikroBUSTM socket or the external power supply terminal with voltages of 5 – 30V. The selection can be made over the MOTOR PWR jumper. In addition, the ULN2003As output channels are also routed to the four output LEDs (outA, outB, outC, and outD) for a visual presentation.
This Click board™ can be operated only with a 5V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
Stepper
Applications
Can be used for the development of unipolar stepper motor control applications. Besides, it can also be used for driving relays, brushed DC motors, etc
On-board modules
ULN2003A – high-voltage high-current Darlington transistor array from Texas Instruments
Key Features
High-power Darlington sink drivers with up to 500mA per channel, clamping diode for the kickback voltage protection, can be used for other applications such as driving relay coils or brushed DC motors, selectable power source, and more
Interface
GPIO
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
5V
Pinout diagram
This table shows how the pinout on Stepper 3 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 | outA | – | Channel A LED Indicator |
LD3 | outB | – | Channel B LED Indicator |
LD4 | outC | – | Channel C LED Indicator |
LD5 | outD | – | Channel D LED Indicator |
J1B | MOTOR PWR | – | Motor Power Supply Source Selection 5V/EXT: Down position 35V, Up position EXT |
Stepper 3 click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 5 | – | V |
External Power Supply Voltage | 5 | – | 30 | V |
Current Limit per Channel | – | – | 500 | mA |
Software Support
We provide a library for the Stepper 3 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 Stepper 3 Click driver.
Key functions
-
stepper3_set_step_mode
This function sets the step mode resolution settings in ctx->step_mode. -
stepper3_set_direction
This function sets the motor direction to clockwise or counter-clockwise in ctx->direction. -
stepper3_drive_motor
This function drives the motor for the specific number of steps at the selected speed.
Example Description
This example demonstrates the use of the Stepper 3 click board by driving the motor in both directions for a desired number of steps.
void application_task ( void )
{
log_printf ( &logger, " Move 64 full steps clockwise rnn" );
stepper3_set_step_mode ( &stepper3, STEPPER3_MODE_FULL_STEP );
stepper3_set_direction ( &stepper3, STEPPER3_DIR_CW );
stepper3_drive_motor ( &stepper3, 64, STEPPER3_SPEED_FAST );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf ( &logger, " Move 128 half steps counter-clockwise rnn" );
stepper3_set_step_mode ( &stepper3, STEPPER3_MODE_HALF_STEP );
stepper3_set_direction ( &stepper3, STEPPER3_DIR_CCW );
stepper3_drive_motor ( &stepper3, 128, STEPPER3_SPEED_VERY_FAST );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
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.Stepper3
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.