Hi! I'm trying to run a 12V DC motor using this board: https://www.amazon.nl/H-Bridge-Snelheidsregeling-PWM-module-IRF3205-Response/dp/B08JM8DCJ8
I have connected a 12V battery to the boards' power input, I have connected one DC motor to the motor 1 output on the board.
I have a wire from pin 11 connected to the PWM1, and a wire from pin 12 connected to DIR1. GND to GND and 5V to 5V.
Furthermore I am using a potentiometer to adjust the output of pin 11, which I believe should adjust the power output of the control board, and hence control the speed of the DC motor.
The code I am running is the following:
const int analogInPin = A0;
const int PWM1_Pin = 11;
const int DIR1_Pin = 12;
int sensorValue = 0;
int motorPower = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(analogInPin); // read from potentiometer
motorPower = map(sensorValue, 0, 1023, 0, 255); // scale to sensible output
analogWrite(PWM1_Pin, motorPower); // send pulsemodulation to driver board
analogWrite(DIR1_Pin, 255); // send direction signal to driver board
}
When I power on nothing really happens, I can see that the LEDs on the arduino board dims a bit. If I break the circuit to the motor driver board by removing the 5V wire, I notice that the LEDs on my arduino shines a little brighter. Now, when I take the wire and closes the circuit again so that the driver board again receives 5V, the motor spins for a fraction of a second, and the LEDs dims again, but then it stops.
This is what it looks like: Problem using IRF3205 motor driver module with arduino - YouTube
I don't understand why this is happening, am I wiring this wrong ? Is the driver board is pulling too much power from the 5V outputted from the arduino, so it shuts down - or something?
Help is wanted !
Also feel free to suggest different hardware if you have experience with something that works nicely. This is my first project, so I know very little about all the differed hardware modules that exist.