A motor driver IC is an essential component used in controlling motors within autonomous robots. These integrated circuits work as an interface between microprocessors & the motors within robots, so these are frequently used to drive DC motors in robotics from microcontrollers. The main reason to use Motor Driver IC in different applications is; most microprocessors work at low voltages & use low current whereas the motors need a relatively high voltage as well as current thus, the current supply cannot be provided to the motor from the microprocessor. The motor driver IC is used to change the low current signal into a high current signal from the microcontroller to drive the motor. There are different motor driver ICs available in the market in L293 series like L293NE, L293D, etc, and also ULN series like ULN2001, 2002, 2003 & 2004. This article discusses one of the types of ULN series motor driver IC like the ULN2003 motor driver IC. But before going into ULN2003 let’s see
Which MOTORS That require a Motor Driver IC ?
- DC Motors: DC motors, both brushed and brushless, often require motor driver ICs to control their speed and direction. These motors can draw significant currents, and motor driver ICs provide the necessary power amplification and current regulation for smooth and controlled operation.
- Stepper Motors: Stepper motors are commonly used in applications that require precise positioning and control. Motor driver ICs specifically designed for stepper motors are used to generate the required stepping sequences and control the motor’s movement accurately.
- Servo Motors: Servo motors are widely used in robotics, automation, and remote control applications. While servo motors can be controlled using PWM signals, some servo motor configurations may require motor driver ICs to provide the necessary power and control signals for accurate positioning and speed control.
- Brushed Motors: Brushed motors, commonly used in applications like robotics, drones, and automotive systems, may require motor driver ICs to handle the higher currents and voltage levels needed for their operation.
- High-Performance Motors: High-performance motors, such as those used in industrial automation or electric vehicles, often require motor driver ICs to provide precise control, high current capability, and protection features. These motors may include three-phase AC induction motors, BLDC (Brushless DC) motors, or PMSM (Permanent Magnet Synchronous Motors).
What is ULN2003 Motor Driver IC?
The ULN2003A is a motor driver IC invented by Texas Instruments. This IC mainly includes a set of 7-NPN Darlington transistors which provides 50Volts & 500 mA output. Each pair of transistors in this IC is protected through a suppression diode and this IC has the capacity to handle a 7 loads maximum.
These ICs are available in different packages like SOIC, PDIP, and TSSOP/SOP. The same family ICs like ULN2002A, 2004A, ULQ2003A & 2004A are also designed for different i/p logic levels. This is one of the most frequently used motor driver IC whenever we need to drive high current loads with digital logic circuits such as Timers, Op-maps, Logic Gates, Arduino, ARM, PIC, etc.
Pin Configuration:
The pinout of the ULN2003 motor driver IC is shown below. This IC includes 16 pins and each pin and its functionality are discussed below.
Pin-1 to Pin-7 (Input Pins): These pins are known as input pins which help in controlling the output pins. If i/p logic is 5V or High then the output will be there otherwise not. So i/p-1 affects the o/p-1 and similarly, i/p- to i/p-7 will affect up to o/p-7.
Pin-8 (GND): This is a GND pin that is used as a common GND with both the GND of the i/p power source & o/p power source.
Pin-9 (COM): This is a common pin mainly used for various functions. This pin is mostly identified as a test pin to switch on all the o/ps. Sometimes, this pin can also be used as an inductive load.
Pin-10 to Pin-16 (Output Pins): These pins are output pins which are the common GND in the ULN2003 IC. Connect any load in 50V & 500mA to the o/p from the outside to make the connected load functional.
Features & Specifications:
The features and specifications of ULN2003 motor driver IC mainly include the following.
- This IC includes 7 high current & high-voltage Darlington pair transistors.
- Every Darlington pair is rated for 50V & 500mA
- Input pins can be activated through +5V.
- Available packages are; 16-pin TSSOP, DIP & SOIC.
- This IC can be controlled directly through logic devices such as Arduino, Digital Gates, PIC, etc
- This IC has high-voltage and high-current capacity.
- This IC is mainly used to interface with a stepper motor, wherever this motor needs maximum ratings which cannot be offered through other types of interfacing devices.
- It includes o/p flyback diodes.
- Inputs are compatible through TTL & 5V CMOS logic.
- The rated collector current is 500 mA.
- The output is 50V.
- The type of mounting is Through-Hole.
- Operating temperature ranges from -40°C to 85°C.
- MSL (moisture sensitivity level) is 1 (Unlimited)
- It is logic-level compatible
- Its power dissipation maximum is 2.25W
- Its current rating is 500mA
- It includes 16–pins.
- It has a complex configuration.
- The type of transistor is NPN Darlington.
- The collector current maximum is 500mA
- The breakdown voltage from collector to emitter is 50V.
- The saturation voltage from collector to emitter is 1.1V.
- The application of the transistor is switching.
- The output voltage is 50V
- The material used for the transistor element is Silicon.
- The equivalent ULN2003 ICs are; ULN2001, 2002, 2004, TPIC2701, L293D, etc.
Stepper Motor Controlling with Arduino using ULN2003 Driver IC
The stepper motor controlling with Arduino using ULN2003 driver IC is shown below. Here stepper motor cannot be directly controlled through Arduino because it consumes more current. Thus, it requires an additional driver IC to control it like ULN2003 driver IC.
Stepper motor is mainly used in different applications where high torque as well as determining to position are required precisely like CNC machines, 3D printers, DVD players, etc. Here we are going to learn how to interface the stepper motor with an Arduino board using ULN2003 Motor Driver IC. Here stepper motor is used in 28BYJ-48 because it is a low-cost and small stepper motor that is used in various Arduino projects & small-scale robotics.
The 28BYJ-48 stepper motor includes 5 wires coil1 to coil 4 and 5V wire. Here, the 4 coils are mainly used for controlling the logical series.
The 5V pin provides a supply to the stepper motor with 5V.
The ULN2003 motor driver IC includes seven pairs of high-current and high-voltage Darlington transistors and every pair of these transistors drives a load up to 500mA & 50V. This motor driver IC includes four input pins used for different controllers & also a Molex connector for connecting the motor very easily. In addition, this IC includes 4 LEDs to specify the stepping condition & also an ON/OFF jumper to separate the power to the stepper motor.
The required components for this interfacing mainly include an Arduino Uno board, ULN2003 motor driver IC, 5V power supply, 28BYJ-48 stepper motor, and Hook-up wires. The connections of this interfacing follow as;
- First, the digital output pins of Arduino like pin7 to pin10 are connected to IN1 to IN4 pins of the ULN2003 motor driver IC
- Connect Arduino’s 5V power supply pin to the VCC pin of the ULN2003 motor driver IC.
- Connect the GND pin of the Arduino to the power supply, and motor driver IC together and the 5V pin of IC is connected to the power supply.
- Connect the stepper motor’s five wires to the output pins of the motor driver IC.
Code
/ /Stepper Motor Control with ULN2003 Motor Driver
// Define the motor control pins
const int motorPin1 = 7;
const int motorPin2 = 9;
const int motorPin3 = 8;
const int motorPin4 = 10;
// Define the number of steps per revolution of the stepper motor
const int stepsPerRevolution = 200;
// Define the speed of the motor (in RPM)
const int motorSpeed = 60;
void setup() {
// Set the motor control pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
}
void loop() {
// Rotate the stepper motor clockwise
rotateClockwise(360);
delay(1000); // Delay for 1 second
// Rotate the stepper motor counterclockwise
rotateCounterClockwise(360);
delay(1000); // Delay for 1 second
}
// Function to rotate the stepper motor clockwise by a specified angle (in degrees)
void rotateClockwise(float angle) {
int stepsToMove = angle * stepsPerRevolution / 360; // Calculate the number of steps to move
// Step the motor for the specified number of steps in the clockwise direction
for (int i = 0; i < stepsToMove; i++) {
stepMotor(1); // Step the motor one step in the clockwise direction
delay(1000 / motorSpeed); // Delay to control the motor speed
}
}
// Function to rotate the stepper motor counterclockwise by a specified angle (in degrees)
void rotateCounterClockwise(float angle) {
int stepsToMove = angle * stepsPerRevolution / 360; // Calculate the number of steps to move
// Step the motor for the specified number of steps in the counterclockwise direction
for (int i = 0; i < stepsToMove; i++) {
stepMotor(-1); // Step the motor one step in the counterclockwise direction
delay(1000 / motorSpeed); // Delay to control the motor speed
}
}
// Function to step the motor in a specified direction (1 = clockwise, -1 = counterclockwise)
void stepMotor(int direction) {
// Define the sequence of control signals to drive the stepper motor
int sequence[][4] = {{HIGH, LOW, LOW, LOW},
{LOW, HIGH, LOW, LOW},
{LOW, LOW, HIGH, LOW},
{LOW, LOW, LOW, HIGH}};
// Determine the next step in the sequence based on the direction
static int step = 0;
step += direction;
// Wrap around the step index within the range of 0 to 3
if (step < 0) {
step = 3;
} else if (step > 3) {
step = 0;
}
// Set the motor control pins according to the current step in the sequence
digitalWrite(motorPin1, sequence[step][0]);
digitalWrite(motorPin2, sequence[step][1]);
digitalWrite(motorPin3, sequence[step][2]);
digitalWrite(motorPin4, sequence[step][3]);
}
The above code is without using the Arduino library. The code to interface stepper motor with Arduino Uno with Arduino library is listed below:
// Stepper Motor Control with ULN2003 Motor Driver
// Include the required libraries
#include <Stepper.h>
// Define the motor control pins
const int motorPin1 = 8;
const int motorPin2 = 9;
const int motorPin3 = 10;
const int motorPin4 = 11;
// Create a new instance of the Stepper class
Stepper stepper(stepsPerRevolution, motorPin1, motorPin3, motorPin2, motorPin4);
// Define the number of steps per revolution of the stepper motor
const int stepsPerRevolution = 200;
void setup() {
// Set the speed of the motor (in RPM)
stepper.setSpeed(motorSpeed);
}
void loop() {
// Rotate the stepper motor clockwise
stepper.step(stepsPerRevolution);
delay(1000); // Delay for 1 second
// Rotate the stepper motor counterclockwise
stepper.step(-stepsPerRevolution);
delay(1000); // Delay for 1 second
}
By using the above code, we can easily control the stepper motor to turn continually at different speeds in clockwise & counter-clockwise directions. Here, you don’t require to download any library because you can utilize the Library which comes with Arduino IDE.
Applications
The applications of ULN2003 motor driver IC include the following.
- A single ULN2003 motor driver IC can control seven relays.
- This IC is used to control Inductive loads easily.
- This motor driver IC is very useful in controlling high-load LED Bulbs.
- It is very efficient to utilize Logic Buffer in digital electronics mostly.
- It can be used as a touch sensor widely through microcontrollers.
- It is used in digital circuits to drive high-current loads.
- It is useful in driving stepper motors.
- It is used to drive high current-based LEDs.
- It is used in digital electronics as a logic buffer.
Motors driven by ULN2003 Motor driver IC:
The ULN2003 motor driver IC is commonly used to drive small and low-power motors, particularly in applications where precise control or high current/voltage requirements are not necessary. The ULN2003 is a popular choice for driving small DC motors and stepper motors. Here are some specific motor types that can be controlled using the ULN2003 motor driver IC:
- Small DC Motors: The ULN2003 motor driver IC can be used to drive small DC motors commonly found in small robotics projects, toys, and simple automation systems. These motors typically operate at low voltages and draw relatively low current.
- Hobbyist Motors: Hobbyist motors, including small brushed DC motors and toy motors, can be easily controlled using the ULN2003 motor driver IC. These motors are commonly used in hobby projects, mini robots, and small-scale automation applications.
- Small Stepper Motors: The ULN2003 motor driver IC can also drive small stepper motors that have low current requirements. It can be used for applications where basic stepper motor control is needed, such as simple robotic arms, motorized toys, and small-scale positioning systems.
Please refer to this link for L293D Motor Driver IC.
Please refer to this link for ULN2003 Motor Driver IC Datasheet.
Thus, this is an overview of the ULN2003 motor driver IC–pin configuration, features, specifications, interfacing, and applications. This IC is used to drive different loads like motors, relay modules, high-current LEDs, and also stepper motors. This IC is the right choice if you want to drive any load above 5V and 80mA. Here is a question for you, what is L293D?