

A motor is a device that converts electrical energy into mechanical energy. It is a fundamental component in countless applications, ranging from industrial machinery to household appliances, robotics, and automotive systems. Motors are available in various types, such as DC motors, AC motors, and stepper motors, each suited for specific tasks and performance requirements.
Common applications of motors include:








The specifications of a motor can vary depending on its type and intended use. Below are general technical details for a typical DC motor:
| Parameter | Value |
|---|---|
| Operating Voltage | 3V to 24V |
| Rated Current | 100mA to 2A (depending on size) |
| Stall Current | Up to 10A |
| Speed | 1000 to 10,000 RPM |
| Torque | 0.1 to 10 Nm |
| Power Output | 0.1W to 100W |
| Pin Name | Description |
|---|---|
| Positive (+) | Connect to the positive terminal of the power supply |
| Negative (-) | Connect to the negative terminal of the power supply |
For motors with additional features (e.g., encoders or stepper motors), refer to the specific datasheet for pin details.
Below is an example of how to control a DC motor using an Arduino UNO and an L298N motor driver.
// Arduino code to control a DC motor using PWM and an L298N motor driver
// Define motor control pins
const int motorPin1 = 9; // IN1 on L298N
const int motorPin2 = 10; // IN2 on L298N
const int enablePin = 11; // ENA on L298N
void setup() {
// Set motor control pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(enablePin, OUTPUT);
// Initialize motor in stopped state
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
analogWrite(enablePin, 0); // Set speed to 0
}
void loop() {
// Rotate motor forward at 50% speed
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
analogWrite(enablePin, 128); // 50% duty cycle (0-255)
delay(2000); // Run for 2 seconds
// Rotate motor backward at 75% speed
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
analogWrite(enablePin, 192); // 75% duty cycle
delay(2000); // Run for 2 seconds
// Stop the motor
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
analogWrite(enablePin, 0); // Set speed to 0
delay(2000); // Wait for 2 seconds
}
Motor Does Not Spin:
Motor Spins in the Wrong Direction:
Motor Overheats:
Noisy Operation:
Q: Can I connect a motor directly to an Arduino?
A: No, motors typically require more current than an Arduino can supply. Always use a motor driver or relay module.
Q: How do I control the speed of a motor?
A: Use PWM signals to adjust the motor's speed. Most motor drivers support PWM input.
Q: What is stall current, and why is it important?
A: Stall current is the maximum current a motor draws when it is not rotating. Ensure your motor driver and power supply can handle this current to avoid damage.
Q: Can I use the same power supply for the motor and microcontroller?
A: It is possible, but not recommended. Motors can cause voltage fluctuations that may interfere with the microcontroller's operation. Use separate power supplies or proper decoupling techniques.
By following this documentation, you can effectively integrate and troubleshoot motors in your projects.