Stufin
Home Quick Cart Profile

ULN2003 12V Stepper Motor Driver

Buy Now on Stufin

Pin Configuration

  • ULN2003 12V Stepper Motor Driver Documentation
  • Pin Description:
  • The ULN2003 12V Stepper Motor Driver is a popular driver IC used to control stepper motors. It has 16 pins, which are explained below:
  • Pin 1: VCC
  • Function: Power supply pin
  • Description: Connect to a 12V DC power source. This pin provides power to the internal circuitry of the ULN2003.
  • Pin 2: IN1
  • Function: Input pin for first phase of stepper motor
  • Description: Connect to the digital output of a microcontroller or other control device. This pin receives the control signal for the first phase of the stepper motor.
  • Pin 3: IN2
  • Function: Input pin for second phase of stepper motor
  • Description: Connect to the digital output of a microcontroller or other control device. This pin receives the control signal for the second phase of the stepper motor.
  • Pin 4: GND
  • Function: Ground pin
  • Description: Connect to the ground of the power supply and other components. This pin provides a common ground reference for the ULN2003.
  • Pin 5: OUT1
  • Function: Output pin for first phase of stepper motor
  • Description: Connect to the first phase winding of the stepper motor. This pin provides the high-current output for the first phase of the motor.
  • Pin 6: OUT2
  • Function: Output pin for second phase of stepper motor
  • Description: Connect to the second phase winding of the stepper motor. This pin provides the high-current output for the second phase of the motor.
  • Pin 7: COM
  • Function: Common output pin for stepper motor
  • Description: Connect to the common terminal of the stepper motor. This pin provides a common connection point for the motor windings.
  • Pin 8: OUT3
  • Function: Output pin for third phase of stepper motor
  • Description: Connect to the third phase winding of the stepper motor. This pin provides the high-current output for the third phase of the motor.
  • Pin 9: OUT4
  • Function: Output pin for fourth phase of stepper motor
  • Description: Connect to the fourth phase winding of the stepper motor. This pin provides the high-current output for the fourth phase of the motor.
  • Pin 10: IN3
  • Function: Input pin for third phase of stepper motor
  • Description: Connect to the digital output of a microcontroller or other control device. This pin receives the control signal for the third phase of the stepper motor.
  • Pin 11: IN4
  • Function: Input pin for fourth phase of stepper motor
  • Description: Connect to the digital output of a microcontroller or other control device. This pin receives the control signal for the fourth phase of the stepper motor.
  • Pin 12: VCC
  • Function: Power supply pin
  • Description: Connect to a 12V DC power source. This pin provides power to the internal circuitry of the ULN2003.
  • Pin 13: Enable
  • Function: Enable pin for the driver
  • Description: Connect to the digital output of a microcontroller or other control device. A high logic level on this pin enables the driver, while a low logic level disables it.
  • Pin 14-16: No connection
  • Function: No connection
  • Description: These pins are not used and should be left unconnected.
  • Connection Structure:
  • When connecting the ULN2003 12V Stepper Motor Driver, follow this structure:
  • Connect the 12V power supply to Pin 1 (VCC) and Pin 12 (VCC).
  • Connect the ground of the power supply to Pin 4 (GND).
  • Connect the control signals from the microcontroller or other control device to Pins 2 (IN1), 3 (IN2), 10 (IN3), and 11 (IN4).
  • Connect the stepper motor windings to Pins 5 (OUT1), 6 (OUT2), 7 (COM), 8 (OUT3), and 9 (OUT4).
  • Connect the enable signal from the microcontroller or other control device to Pin 13 (Enable).
  • Leave Pins 14-16 unconnected.
  • Important Note:
  • Make sure to use a suitable current-limiting resistor in series with the stepper motor windings to prevent overheating and damage to the motor.
  • Use a suitable power supply that can provide the required current for the stepper motor and the ULN2003 driver.
  • Ensure proper isolation and decoupling of the power supply and motor windings to prevent noise and interference.

Code Examples

ULN2003 12V Stepper Motor Driver Component Documentation
Overview
The ULN2003 12V Stepper Motor Driver is a high-voltage, high-current darlington transistor array designed for use in stepper motor applications. It provides a convenient and compact way to drive bipolar stepper motors with a microcontroller or other digital logic device. This component is suitable for use in a wide range of IoT projects, including robotics, automation, and industrial control systems.
Pinout and Connections
The ULN2003 component has a 16-pin DIP package with the following pinout:
| Pin | Function |
| --- | --- |
| 1-8 | Output pins (IN1-IN8) |
| 9-16 | Input pins (VCC, GND, IN1-IN4) |
To use the ULN2003, connect the input pins (IN1-IN4) to the output pins of a microcontroller or other digital logic device. The output pins (IN1-IN8) connect to the stepper motor windings.
Code Examples
### Example 1: Basic Stepper Motor Control using Arduino
This example demonstrates how to use the ULN2003 to control a bipolar stepper motor using an Arduino board.
```cpp
const int motorPins[] = {2, 3, 4, 5}; // ULN2003 input pins (IN1-IN4)
const int stepsPerRevolution = 200; // Number of steps per revolution
void setup() {
  for (int i = 0; i < 4; i++) {
    pinMode(motorPins[i], OUTPUT);
  }
}
void loop() {
  // Rotate the motor clockwise
  for (int i = 0; i < stepsPerRevolution; i++) {
    for (int j = 0; j < 4; j++) {
      digitalWrite(motorPins[j], (j == (i % 4)) ? HIGH : LOW);
    }
    delay(1);
  }
  
  // Rotate the motor counterclockwise
  for (int i = 0; i < stepsPerRevolution; i++) {
    for (int j = 0; j < 4; j++) {
      digitalWrite(motorPins[j], (j == (3 - (i % 4))) ? HIGH : LOW);
    }
    delay(1);
  }
}
```
### Example 2: Half-Step Stepper Motor Control using Raspberry Pi (Python)
This example demonstrates how to use the ULN2003 to control a bipolar stepper motor in half-step mode using a Raspberry Pi.
```python
import RPi.GPIO as GPIO
import time
# ULN2003 input pins (IN1-IN4)
motor_pins = [17, 23, 24, 25]
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Initialize motor pins as outputs
for pin in motor_pins:
    GPIO.setup(pin, GPIO.OUT)
# Half-step sequence
half_step_sequence = [
    [1, 0, 0, 0],
    [1, 1, 0, 0],
    [0, 1, 0, 0],
    [0, 1, 1, 0],
    [0, 0, 1, 0],
    [0, 0, 1, 1],
    [0, 0, 0, 1],
    [1, 0, 0, 1]
]
try:
    while True:
        for step in half_step_sequence:
            for i, pin in enumerate(motor_pins):
                GPIO.output(pin, step[i])
            time.sleep(0.01)
except KeyboardInterrupt:
    GPIO.cleanup()
```
These examples demonstrate the basic connections and code required to use the ULN2003 12V Stepper Motor Driver in various contexts.