Trying to run DC motor, but stops shortly after closing circuit

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 ! :slight_smile:

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.

On a quick glance, your output pins should have pinMode( , OUTPUT) set. And pin 12 is not a PWM pin on a Uno, only 3,5,6,9,10,11 can take analogWrite()s. There may be other problems but fix those first.

Steve

Hello, thanks for your input ! :slight_smile: I will fix these immediately and see where that takes me

Are you from the Netherlands ? So you are not offended by my direct and blunt approach ? Nice :kissing_smiling_eyes:

Thanks for the video, that explains a lot.
You should not to continue to try things, something is wrong and you might damage things.

To get a working project, you can buy from Adafruit, Sparkfun, Pololu and others. They provide information and show a schematic.
In many countries there are sellers that sell from those companies. Sometimes I have to wait a month.
Here is a list of the brushed DC drivers of Pololu: https://www.pololu.com/category/11/brushed-dc-motor-drivers.
They have also controllers, such as this one.

I can not find a schematic for that driver module, so you are in the dark.
What are the specifications of the motor ? Everything starts with the motor. The motor driver module is often more expensive than the motor.

Do you have a multimeter or other equipment ?

Some wire, or wires, are connected to the wrong pins.
You tried to show the wiring but...... Your picture uses a lot of surface showing the physics of the boards, and that's no help. Draw a real schematics showing pin designations etc.

Okay, these two obvious mistakes have been corrected (I believe)

  pinMode(PWM1_Pin, OUTPUT);
  pinMode(DIR1_Pin, OUTPUT);

and

  analogWrite(PWM1_Pin, motorPower);
  digitalWrite(DIR1_Pin, HIGH);

However, it did not resolve the problem, I still see the same behaviour that the motor runs for a very short time then it stops.

Hi, thanks :stuck_out_tongue:

The motor I am using is a quite powerful one, this is the details I have on it:

Specifications:
Model: 775
Mounting Hole Size: M4
Mounting Hole: 2
Cooling Fan: Yes
Rated Voltage: 24V
Current Rating: 0.16A
Rated Speed: 7000RPM
Different Voltage Parameters:
DC 12V, current 0.14A, speed 3500RPM
DC 18V, current 0.15A, speed 4500RPM
DC 24V, current 0.16A, speed 7000RPM
DC 30V, current 0.17A, speed 8100RPM
DC 36V, current 0.20A, speed 9000RPM
Shaft Diameter: 5mm / 0.2in
Shaft Length: 17mm / 0.67in
Body Length: 66.7mm / 2.63in
Front Steps Diameter: 17.4mm / 0.69in
Former High Level: 4.7mm / 0.19in
Body Diameter: 42mm / 1.65in
Motor Overall Length: 98mm / 3.86in
Diagonal Installation Pitch: 28.8mm / 1.13in
Package Weight: 351g / 12.38ounces
Package Size: 100 * 50 * 50mm / 3.94 * 1.97 * 1.97in

I was hoping that I would not have to spend 160$ on a driver, furthermore importing to NL is a pain, goods get stuck in customs for months, and there is not only import taxes, but also handling fees, so a small item will quickly become expensive - and you are almost certainly not gonna have it in time ^^ ...... sad but that's how it is.

I do have a multimeter yes, but I'm not sure where to start measuring. I know the battery is full and delivers 12.8V right now.

the arduino power out, with the potentiometer hooked up reads 4.8V - but drops to 2.8~3V when I also add in the controller board to the circuit.

I bought via iPrototype in the past, but now my browser won't even open their website.

It is not that hard:

Perhaps your module is broken ?

The motor has a "stall current".
See: Koepel asking about the stall current of the 775 motor.

If your motor driver is for 10A and the battery can give 10A, then the stall current should be below 10A.
If you connect the motor directly to the battery, how much does the battery voltage drop ? Do you have a shunt resistor ? I don't want to blow your multimeter in the 10A setting.

You are going to spend a lot of money. This driver might be broken, and maybe you need another motor as well.

That's a baby compared to the ones I use, without ever facing the difficulties You have.
Please post proper schematics before You burn things down.
Those coloured bird nests never tell all..

I don't know how to draw those, so that would not be an immediate action.

On my battery it says, "initial current: less than 2.1A"

Can I safely connect my motor directly to the battery? And when doing so, where to I meassure the drop in voltage? Directly from the battery connectors ?

Yes, that is safe. If you see smoke, then the motor was broken and it was not safe :roll_eyes:
The motor might jump by the acceleration/rotation force. Measure the voltage on the battery or on the motor or both.

Railroader asks for a schematic. We are used to look at schematics.
Can you show a photo ? Perhaps your wires are very thin or a soldered component is not soldered.

1 Like

Hi,
may be your board doc.
https://dcc-ex.com/advanced-setup/supported-motorboards/IRF3205-motor-board-setup.html

2 Likes

You do know how to use pen and paper? Show the logic function of each pin, not just pin number.

Okay, so the motor runs when I connect it directly to the battery. The voltage however jumps all over the place, I'm not sure if its my multimeter that is garbage, or if the this is normal. I had readings between 1-13V.

DC Volts

Alright sir, I will give it a try! will take a little time

Can you ask someone to have a look at it ?

I hope this will do....:

How do you mean look at it? the multimeter or the battery?

Here is a photo of the wiring, not sure it is possible to see whats going on, but maybe the schematic can support it.