









| Pin/Connection | Description |
|---|---|
| Motor Terminal + | Positive terminal for motor power supply |
| Motor Terminal - | Negative terminal for motor power supply |
| Encoder A (optional) | Encoder signal A for speed/direction feedback |
| Encoder B (optional) | Encoder signal B for speed/direction feedback |
| Ground (optional) | Common ground for encoder signals |
Wiring the Motor:
Using with an Arduino UNO:
// Define motor driver pins
const int motorPin1 = 9; // Motor terminal 1 (connected to motor driver)
const int motorPin2 = 10; // Motor terminal 2 (connected to motor driver)
const int pwmPin = 11; // PWM pin for speed control
void setup() {
// Set motor pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(pwmPin, OUTPUT);
}
void loop() {
// Rotate motor forward
digitalWrite(motorPin1, HIGH); // Set motorPin1 HIGH
digitalWrite(motorPin2, LOW); // Set motorPin2 LOW
analogWrite(pwmPin, 128); // Set speed (0-255, 128 = 50% duty cycle)
delay(2000); // Run for 2 seconds
// Rotate motor backward
digitalWrite(motorPin1, LOW); // Set motorPin1 LOW
digitalWrite(motorPin2, HIGH); // Set motorPin2 HIGH
analogWrite(pwmPin, 128); // Set speed (0-255, 128 = 50% duty cycle)
delay(2000); // Run for 2 seconds
// Stop motor
digitalWrite(motorPin1, LOW); // Set motorPin1 LOW
digitalWrite(motorPin2, LOW); // Set motorPin2 LOW
delay(2000); // Stop for 2 seconds
}
Motor does not rotate:
Motor rotates in the wrong direction:
Motor overheats:
Encoder signals are inconsistent:
Can I use a planetary gearbox motor with an AC power supply?
What gear ratio should I choose?
Can I run the motor without a motor driver?
How do I calculate the output speed of the motor?