

A motor controller is an electronic device that manages the operation of an electric motor by controlling its speed, direction, and torque. It acts as an interface between the motor and the control system, enabling precise and efficient motor operation. Motor controllers are widely used in applications such as robotics, industrial automation, electric vehicles, and home appliances.
Common applications and use cases:








Below are the general technical specifications for a typical motor controller. Note that specific models may vary, so always refer to the datasheet of your motor controller for exact details.
The pin configuration for a typical dual-channel motor controller is shown below:
| Pin Name | Description |
|---|---|
| VCC | Power supply input for the motor controller (e.g., 6V to 36V). |
| GND | Ground connection. |
| IN1 | Control input for Motor 1 (e.g., PWM signal for speed control). |
| IN2 | Control input for Motor 1 (e.g., direction control). |
| IN3 | Control input for Motor 2 (e.g., PWM signal for speed control). |
| IN4 | Control input for Motor 2 (e.g., direction control). |
| OUT1 | Output terminal for Motor 1 (connect to one terminal of the motor). |
| OUT2 | Output terminal for Motor 1 (connect to the other terminal of the motor). |
| OUT3 | Output terminal for Motor 2 (connect to one terminal of the motor). |
| OUT4 | Output terminal for Motor 2 (connect to the other terminal of the motor). |
| ENA | Enable pin for Motor 1 (can be connected to a PWM signal for speed control). |
| ENB | Enable pin for Motor 2 (can be connected to a PWM signal for speed control). |
Below is an example of controlling a DC motor using an Arduino UNO and a motor controller.
// Define motor control pins
const int IN1 = 9; // Motor direction control pin 1
const int IN2 = 8; // Motor direction control pin 2
const int ENA = 10; // Motor speed control (PWM) pin
void setup() {
// Set motor control pins as outputs
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENA, OUTPUT);
}
void loop() {
// Rotate motor forward at 50% speed
digitalWrite(IN1, HIGH); // Set IN1 high
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 128); // Set ENA to 50% duty cycle (128/255)
delay(2000); // Run motor for 2 seconds
// Rotate motor backward at 75% speed
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, HIGH); // Set IN2 high
analogWrite(ENA, 192); // Set ENA to 75% duty cycle (192/255)
delay(2000); // Run motor for 2 seconds
// Stop the motor
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 0); // Set ENA to 0% duty cycle (stop motor)
delay(2000); // Wait for 2 seconds before repeating
}
Motor Not Running:
Motor Running in the Wrong Direction:
Overheating:
PWM Signal Not Working:
Can I use this motor controller with a stepper motor?
What happens if I exceed the current rating?
Can I control multiple motors with one controller?
Do I need external diodes for protection?