

A DC motor is an electromechanical device that converts direct current (DC) electrical energy into mechanical energy. It operates on the principle of electromagnetic induction, where a magnetic field interacts with a current-carrying conductor to produce rotational motion. DC motors are widely used due to their simplicity, reliability, and ability to provide precise speed and torque control.








Below are the general technical specifications for a typical DC motor. Note that actual values may vary depending on the specific model.
For a basic brushed DC motor, there are typically two terminals:
| Pin/Terminal | Description |
|---|---|
| Positive (+) | Connects to the positive terminal of the power supply. |
| Negative (-) | Connects to the negative terminal of the power supply. |
For brushless DC motors, additional control pins may be present, such as Hall sensor outputs or PWM inputs. Refer to the motor's datasheet for specific details.
Below is an example of controlling a DC motor using an Arduino UNO and an L298N motor driver.
// Arduino code to control a DC motor using PWM and L298N motor driver
// Define motor control pins
const int ENA = 9; // PWM pin for speed control
const int IN1 = 8; // Direction control pin 1
const int IN2 = 7; // Direction control pin 2
void setup() {
// Set motor control pins as outputs
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
}
void loop() {
// Rotate motor in forward direction
digitalWrite(IN1, HIGH); // Set IN1 high
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 150); // Set speed (0-255)
delay(2000); // Run motor for 2 seconds
// Rotate motor in reverse direction
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, HIGH); // Set IN2 high
analogWrite(ENA, 150); // Set speed (0-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 speed to 0
delay(2000); // Wait for 2 seconds before repeating
}
Motor Not Spinning:
Overheating:
Erratic Speed or Direction:
Noisy Operation:
By following this documentation, users can effectively integrate and operate a DC motor in their projects while avoiding common pitfalls.