# Speed Control of a DC Motor Using L293D fail

I am trying to do this project from this link: Control DC Motor Using L293D : 4 Steps - Instructables

I set a value of 255 for analogWrite to get max speed, but in turn my motor rotate very slowly-compared to when I connect the motor directly to 5v + ground that it rotate fast.

…what can be happening? do I need more power?
all the connections and code are the same as the project in the link above…

Julio

As usual for Instructables, there are issues. A 9V transistor battery does not have the current capability to run a motor for long, if at all. The Arduino 5V regulator does not either. On top of that the ancient and very inefficient L293 motor driver’s bipolar Darlington output stage drops 2 to over 4 volts of the motor supply current dumping it off as heat.

So, let’s do a bit of engineering. What motor do you have? What is the motors rated voltage? What is the motors stall current? When we start from those facts, we can choose a proper motor driver and power source.

1 Like

According to the L293 Datasheet, the typical low voltage at the outputs of the circuit is 1.2 V (at a load of 0.6 A), and the typical high voltage is Vcc2 - 1.4 V. That is, the voltage applied to the motor is about 2.6-3 V less than the Vcc2 supply voltage of the chip.
If your motor is on 6V, supply Vcc2 about 9V to the chip.

1 Like

Oh I see, so the power is not enough then and even more the L293 drops the voltage…

So well, first, I am trying to vary different speeds of a mini air blower (normally used for inflatable costumes) for a sound installation.

here a link of the product I am using https://www.amazon.de/-/en/gp/product/B01DXBENKK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Thanks so much!

thanks so much, I am using this one:

What is the infernal machine? 6V 0.3KW and 4pcs AA battery? This is incredible! Your L293 will release smoke.

oh no - what can I use then ?!

I think the amazon is giving the wrong information. You just need to measure the current consumption at a voltage of 6 V.

I ll look for my multimeter and do the measure

There are more powerful motor drivers, for example L298N (but with similar voltage drops), or as a last resort MOSFET module with high current and very low voltage drop. You may see next link IRF520 MOSFET Driver Module with detailed explanations and code examples.

1 Like

cool, so you think that with that Mosfet module I could successfully obtain satisfactory results ?. Namely, to write a code in arduino so that the air blower motor varies speed randomly for long periods of time.
Or should I first try with the L298N?

something like this?

You need first know the current drawn by the motor. If the current of the L293 is sufficient, you can use it, but apply a voltage 3 volts higher than the motor voltage (about 9V). If the current is not enough, you can take the L298N, but it also has a large voltage drop.
I would take a MOSFET transistor. For example, the IRF520 has a current of up to 5A and a minimum voltage drop, that is, you can power the pump from a 6V source. Moreover, if you just need to change the motor speed (without reverse), one transistor is enough.

Hi,
Welcome to the forum.
I found this on another site.

6V and 4.8W
P = V x I
I = P / V
I = 4.8 / 6 = 0.8A

Sounds better with 4AA battery pack, but still might not last long.

Tom…

Ok perfectly explained, thank you very much, I cannot find my multimeter, but I will see to get one to make the measurement

Well, my idea is to connect it to the wall electricity through the arduino, so as not to run the risk that the batteries will run out, because the art installation will be open for 3 weeks, (although the devices will not be on all the time, only when the visitor activates the ignition sensors). Does it make sense to power the motor through the Arduino uno?

You must not power the motor through the arduino, you need supply power from the AC-DC adapter (6-9V) to the motor driver and to the arduino board. Arduino only needs to control the voltage supply to the motor by PWM. See link in post #11.
Some motor drivers have a built-in 5V voltage regulator that can be fed to the Vin of the arduino board.

Hi,
Do you need to control just the speed.
If so, why not use a single N-CH MOSFET?

Tom…

I could try that, or the HCMODU0083 ?