Speed Control of a DC Motor Using L293D fail

The IRF520, on the HCMODU0083 module, is not a logic level MOSFET. The IRF520 will not completely turn on with 5V. The IRL520 is a better choice, but not the best because the Rds(on) if the IRL520 is relatively high (0.27Ω @ 5V, 5.5A).

1 Like

If you just need to control your pump speed you may do that without Arduino.
6V 12V 2A PWM Motor Speed Controller
6V 12V 24V 28VDC 3A 80W PWM Motor Speed Controller

1 Like

I don't have the literacy on this subject apparently.
assumed this was a beginner project... to upload a program on the arduino board to make the motor spin randomly at different speeds, I dont want to control the speed manually, but to have a program doing that from arduino

To be honest, I'm not really surprised that this isn't working properly.
L293D is a very old and very inefficcient linear motor driver.
You'd be much better off using a PWM ESC like this one:
Link

Hook its power input to the external power supply or battery, its output to the motor, and the triple wires to the Arduino. Connect it like you would a servo.

Then, install the servo library and use WriteMicroseconds. 1000 is off, 2000 is full speed, numbers in between give you other speeds.

Also, NEVER drive a motor directly from the Arduino's power pins. They draw too much current and can burn out the Arduino's regulator.

1 Like

Keep in mind that you cannot adjust the motor speed from 0 to 255. At low voltage, the motor has a low torque and stops. For example, I change the 6V DC motor speed in the range 120-255.

1 Like

wow these are expensive, I ll make a bit of research, thank you

alright, I ll keep that in mind, so wondering if I could use the arduino uno and a N-CH MOSFET... I ll check if there are some projects already using these

Here is a N channel logic level MOSFET motor driver:

Look for a logic level MOSFET capable of handling the stall current of the motor. The stall current is pulled, briefly, every time that the motor starts. The stall current can be several times the running current. To estimate the stall current, measure the motor winding resistance. Take several measurements rotating the motor a bit between readings. Use the lowest reading in the calculation. The estimated stall current is the motor supply voltage divided by the measured resistance.

that looks good, thanks so much, I ll go and draw from here

You have not answered about needed motor current and keep looking for the driver. This is the wrong approach.
MOSFET is the best solution for high power switching circuits. However, not all MOSFETs work with an Arduino. It's needed a MOSFET with a low gate threshold voltage (logic-level MOSFET). Usually such MOSFETs have the letter L in the name (IRLP3034, IRLZ44N, IRL2203N, AOD4184, etc.) See examples here Popular MOSFETs frequently used in power electronics designs. The best MOSFETs with low gate threshold voltage and low RdsON are expensive.
The IRF520 is not a low-threshold transistor, but its threshold is min 2.0V max 4.0V. This is quite enough to work with Arduino. This is one of the most popular modules in Aarduino world. If you don't like this transistor, you can choose any other. No one will make a decision instead of you.

That is the voltage that the MOSFET turns off at. Not very relevant. The criteria to look for is the voltage specified in the Rds(on) specification. For instance, an IRF520 is specified Vgs = 10V. So that MOSFET will not completely turn on at 5V. However, the IRL520 (note the L means logic level) is specified at Vgs = 4V and Vgs = 5V making it a logic level device.

@groundFungus the author of the post is novice to arduino. He wants to control a toy pump with a current of, I think, about 0.5A. Please give him a link to a ready-made module on the IRL520 and let him use it.
And also tell him what Vgs and Rds are. I know.

There must be millions of tutorial on MOSFETs on the internet. The search for "how mosfet switches work" nets over 4.5 million hits.

Like I said earlier, there are better choices for MOSFETs than the IRL520 with its relatively high Rsd(on). But to choose one we need to know the stall current of the motor. With a running current of 0.5A the stall could be 5A or more.

Yes mosfet us also good. But if you really work on code. Provide the true supply to the motor drive and motors. Then using the enable pins control the speed of the motor using the code on ide. I believe lot many tutorials on the Web of this kind will surely help in this regard.

Hi, thanks for your comments, I've been looking for my multimeter but I don't know where it is.
What I can see from the sticker of the device are these specifications:
6V DC ----- 0.80A (see picture)

It is difficult to build electronic circuits without a multimeter. From what is written on the sticker, you can believe that it was made in China. And I would advise you to check the current.

I have found my multimeter. So, I measured the motor by feeding it with a converter with this characteristics: input: AC 100-240V 0.6 (max) -50 / 60Hz and output: DC 5V-4A (total) ____ the result was: -when it turns freely: 0.28mA and -when it is turned on and I jam it with the hand until it does not move gives: 0.93mA

Hi,
With those specs, I would suggest you use the circuit in post #28, you do not need the complexity of an inefficient 293 to run the motor in one direction only.

Use a H-bridge is you need motor speed AND direction control.

Tom... :grinning: :+1: :coffee: :australia:

Thanks TomGeorge,
would this MOSFET do the job then?
info: IRLML6246 N-Channel Mosfet 20V 4,1A 1,3W 0,046R SOT23

Are you sure the meter shows 0.28mA? It's impossible.
Maybe 0.28A is the correct result?