

The Raspberry Pi Motor Driver Board by DFRobot (Manufacturer Part ID: Raspberry Pi) is a versatile interface board designed to enable motor control using a Raspberry Pi. It provides the necessary power and control signals to drive DC motors and stepper motors, making it an essential component for robotics and automation projects. The board features integrated H-bridge circuits, allowing for bidirectional motor control and speed regulation.








Below are the key technical details of the Raspberry Pi Motor Driver Board:
| Specification | Details |
|---|---|
| Operating Voltage | 6V to 12V |
| Logic Voltage | 3.3V (compatible with Raspberry Pi GPIO) |
| Maximum Motor Current | 1.5A per channel |
| Number of Channels | 2 (supports two DC motors or one stepper motor) |
| Motor Driver IC | L298N or equivalent H-bridge driver |
| Communication Interface | GPIO pins of Raspberry Pi |
| Dimensions | 65mm x 56mm x 20mm |
| Weight | ~40g |
The Raspberry Pi Motor Driver Board connects to the Raspberry Pi GPIO header and provides the following pin configuration:
| Pin Name | Pin Number | Description |
|---|---|---|
| IN1 | GPIO Pin 17 | Control signal for Motor 1 (Direction 1) |
| IN2 | GPIO Pin 18 | Control signal for Motor 1 (Direction 2) |
| IN3 | GPIO Pin 22 | Control signal for Motor 2 (Direction 1) |
| IN4 | GPIO Pin 23 | Control signal for Motor 2 (Direction 2) |
| ENA | GPIO Pin 27 | PWM signal for Motor 1 (Speed control) |
| ENB | GPIO Pin 24 | PWM signal for Motor 2 (Speed control) |
| VCC | External Input | Power supply for motors (6V to 12V) |
| GND | Ground | Common ground for Raspberry Pi and motors |
Connect the Motor Driver Board to the Raspberry Pi:
Connect Motors:
Write Control Code:
Power On:
Below is an example Python script to control a DC motor using the Raspberry Pi Motor Driver Board:
import RPi.GPIO as GPIO
import time
IN1 = 17 # Motor 1 Direction 1 IN2 = 18 # Motor 1 Direction 2 ENA = 27 # Motor 1 Speed (PWM)
GPIO.setmode(GPIO.BCM) GPIO.setup(IN1, GPIO.OUT) GPIO.setup(IN2, GPIO.OUT) GPIO.setup(ENA, GPIO.OUT)
pwm = GPIO.PWM(ENA, 100) # 100 Hz frequency pwm.start(0) # Start with 0% duty cycle (motor off)
try: # Set motor direction GPIO.output(IN1, GPIO.HIGH) # Direction 1 GPIO.output(IN2, GPIO.LOW) # Direction 2
# Gradually increase motor speed
for duty_cycle in range(0, 101, 10): # 0% to 100% in steps of 10%
pwm.ChangeDutyCycle(duty_cycle)
time.sleep(0.5) # Wait 0.5 seconds
# Stop the motor
pwm.ChangeDutyCycle(0) # Set speed to 0%
GPIO.output(IN1, GPIO.LOW)
GPIO.output(IN2, GPIO.LOW)
finally: # Cleanup GPIO settings pwm.stop() GPIO.cleanup()
Motors Not Running:
Motor Running in the Wrong Direction:
Raspberry Pi Reboots When Motors Start:
Overheating of Motor Driver IC:
Can I control stepper motors with this board? Yes, the board supports stepper motors. Use both channels (M1 and M2) to control the stepper motor phases.
What is the maximum motor voltage supported? The board supports motor voltages between 6V and 12V.
Can I use this board with other microcontrollers? Yes, the board can be used with other microcontrollers, provided they output 3.3V or 5V logic signals.
Is the board compatible with all Raspberry Pi models? The board is compatible with most Raspberry Pi models that have a 40-pin GPIO header.