10-24V
10-24V
Up to 2A per channel
20-100 kHz
3.3-5V
-20C to 80C
43.5 x 29.5 mm (1.71 x 1.16 in)
Pinout
| The module features a 10-pin interface with the following pinout |
Input voltage (10-24V)
Ground
Enable signal for Channel 1
| DIR1 | Direction signal for Channel 1 |
| PWM1 | PWM signal for Channel 1 |
| ENA2 | Enable signal for Channel 2 |
| DIR2 | Direction signal for Channel 2 |
| PWM2 | PWM signal for Channel 2 |
3.3-5V logic level voltage output
Applications
Robotics and robotic arms
CNC machines and milling machines
3D printers and laser engravers
Automation systems and industrial control systems
Smart home and IoT projects
Important Notes
The module requires an external power supply and a microcontroller for operation.
proper heat dissipation and current limiting measures should be taken to prevent overheating and damage to the module.
The module is not suitable for high-torque or high-power motor applications.
DC Motor Drive Module 2 Channel Reversing PWM Speed Dual H Bridge Stepper Controller DocumentationComponent OverviewThe DC Motor Drive Module 2 Channel Reversing PWM Speed Dual H Bridge Stepper Controller is a versatile module designed to control the speed and direction of two DC motors or one stepper motor. The module features two-channel H-bridge drivers, enabling bi-directional motor control with PWM (Pulse-Width Modulation) speed regulation.Pinout and Connections| Pin | Function |
| --- | --- |
| VCC | Power supply (5V to 24V) |
| GND | Ground |
| ENA | Enable pin for motor channel A |
| IN1 | Input pin for motor channel A |
| IN2 | Input pin for motor channel A |
| ENB | Enable pin for motor channel B |
| IN3 | Input pin for motor channel B |
| IN4 | Input pin for motor channel B |
| VOUTA | Motor channel A output |
| VOUTB | Motor channel B output |Programming Examples### Example 1: Controlling Two DC Motors with ArduinoIn this example, we'll demonstrate how to control two DC motors using an Arduino board.Hardware Requirements:Arduino Board (e.g., Arduino Uno)
DC Motor Drive Module 2 Channel Reversing PWM Speed Dual H Bridge Stepper Controller
Two DC motorsArduino Code:
```c++
const int enA = 2; // Enable pin for motor channel A
const int in1 = 3; // Input pin for motor channel A
const int in2 = 4; // Input pin for motor channel A
const int enB = 5; // Enable pin for motor channel B
const int in3 = 6; // Input pin for motor channel B
const int in4 = 7; // Input pin for motor channel Bvoid setup() {
pinMode(enA, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(enB, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
}void loop() {
// Set motor channel A to move forward at 50% speed
digitalWrite(enA, HIGH);
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
analogWrite(enA, 128); // 50% speed (0-255)// Set motor channel B to move backward at 75% speed
digitalWrite(enB, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
analogWrite(enB, 191); // 75% speed (0-255)delay(2000);// Stop both motors
digitalWrite(enA, LOW);
digitalWrite(enB, LOW);
delay(1000);
}
```
### Example 2: Controlling a Stepper Motor with Raspberry Pi (Python)In this example, we'll demonstrate how to control a stepper motor using a Raspberry Pi board with Python.Hardware Requirements:Raspberry Pi Board
DC Motor Drive Module 2 Channel Reversing PWM Speed Dual H Bridge Stepper Controller
Stepper motorPython Code:
```python
import RPi.GPIO as GPIO
import time# Set up GPIO library
GPIO.setmode(GPIO.BCM)# Define pins for stepper motor control
ena = 17 # Enable pin for stepper motor
in1 = 23 # Input pin for stepper motor
in2 = 24 # Input pin for stepper motor# Set up GPIO pins as outputs
GPIO.setup(ena, GPIO.OUT)
GPIO.setup(in1, GPIO.OUT)
GPIO.setup(in2, GPIO.OUT)try:
while True:
# Set stepper motor to move clockwise at 50% speed
GPIO.output(ena, GPIO.HIGH)
GPIO.output(in1, GPIO.HIGH)
GPIO.output(in2, GPIO.LOW)
time.sleep(0.01) # 50% speed (adjust for desired speed)# Set stepper motor to move counterclockwise at 75% speed
GPIO.output(ena, GPIO.HIGH)
GPIO.output(in1, GPIO.LOW)
GPIO.output(in2, GPIO.HIGH)
time.sleep(0.005) # 75% speed (adjust for desired speed)# Stop stepper motor
GPIO.output(ena, GPIO.LOW)
time.sleep(1)except KeyboardInterrupt:
# Clean up GPIO pins
GPIO.cleanup()
```
Note: In this example, we're using the RPi.GPIO library for Python. Make sure to install it before running the script.