Hi all!
I'm trying to Run a 24V motor with the following Motor control board:
For the wiring i have the following setup:
For the programming i created the following:
int switch1 = 2; // switch 1 connected to digital pin 2
int switch2 = 4; // switch 2 connected to digital pin 4
int pwmPin = 11; // PWM1 of IRF3205 module connected to digital pin 11
int dirPin = 12; // DIR1 of IRF3205 module connected to digital pin 12
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.
pinMode(switch1, INPUT); // switch 1 as input
pinMode(switch2, INPUT); // switch 2 as input
pinMode(pwmPin, OUTPUT); // PWM1 as output
pinMode(dirPin, OUTPUT); // DIR1 as output
}
void loop() {
if (digitalRead(switch1) == HIGH && digitalRead(switch2) == LOW) {
digitalWrite(dirPin, LOW); // change direction to left
analogWrite(pwmPin, 255); // set PWM value to max (255)
}
else if (digitalRead(switch2) == HIGH && digitalRead(switch1) == LOW) {
digitalWrite(dirPin, HIGH); // change direction to right
analogWrite(pwmPin, 255); // set PWM value to max (255)
}
else {
analogWrite(pwmPin, 0); // set PWM value to 0 to stop the motor
}
}
When eliminating the Arduino and operating the motor control board directly with the external 5V Power source and variable power source, the motor spins and it all works nicely.
After checking the wiring and code multiple times it left me out of new ideas to find the problem. ![]()
I hope some fresh eyes and bright minds on this forum can give me some sew insights. Thanks in advance for your input.

