The MDDS30 Cytron Motor Driver is a robust module designed for controlling two DC motors with directional and speed control capabilities. It is suitable for a variety of applications, including robotics, electric vehicles, and automation systems. The driver accepts a wide range of input voltages and uses Pulse Width Modulation (PWM) for precise control over motor speed.
Pin Name | Description |
---|---|
V+ | Motor power supply input (7V to 35V) |
GND | Ground connection |
M1A, M1B | Motor 1 output terminals |
M2A, M2B | Motor 2 output terminals |
PWM1 | PWM input for Motor 1 speed control |
DIR1 | Direction input for Motor 1 |
PWM2 | PWM input for Motor 2 speed control |
DIR2 | Direction input for Motor 2 |
AN1 | Analog input for Motor 1 speed control (alternative to PWM1) |
AN2 | Analog input for Motor 2 speed control (alternative to PWM2) |
EN | Enable input (active HIGH) |
Power Connections:
Motor Connections:
Control Signal Connections:
Enable the Driver:
// Example code to control a motor using the MDDS30 Cytron Motor Driver
#include <Arduino.h>
// Define control pins
const int pwmPin1 = 3; // PWM input for Motor 1
const int dirPin1 = 4; // Direction input for Motor 1
void setup() {
// Set control pins as outputs
pinMode(pwmPin1, OUTPUT);
pinMode(dirPin1, OUTPUT);
}
void loop() {
// Set Motor 1 direction to forward
digitalWrite(dirPin1, HIGH);
// Ramp up the speed
for (int speed = 0; speed <= 255; speed++) {
analogWrite(pwmPin1, speed);
delay(10);
}
// Ramp down the speed
for (int speed = 255; speed >= 0; speed--) {
analogWrite(pwmPin1, speed);
delay(10);
}
// Change direction to reverse
digitalWrite(dirPin1, LOW);
// Repeat the ramp up and down with reverse direction
for (int speed = 0; speed <= 255; speed++) {
analogWrite(pwmPin1, speed);
delay(10);
}
for (int speed = 255; speed >= 0; speed--) {
analogWrite(pwmPin1, speed);
delay(10);
}
}
Note: The above code is a simple demonstration of controlling a motor's speed and direction using PWM. Adjust the pwmPin1
and dirPin1
variables to match your actual control pin connections on the Arduino UNO.