Can I directly feed my DC motor with Arduino 5V pin?

Hi guys,

I am new to Arduino.
I have started my small projects and trying to learn more in the COVID time.
I did buy 10 small DC motor which I guess suffice the purpose: https://www.amazon.de/gp/product/B07FM8J9WP.

At first, I wanted to simply connect it to my 11.1V battery through the Mosfet module(https://www.amazon.de/gp/product/B07VRCXGFY) and control the V-in to DC motor by the PWM pin(P9), but I realized even with the analogWrite(9, 5) still my output voltage is around 5V(again used Mosfet module).
Does the MOSFET module have a problem? It is weird, right?

Then I thought perhaps I can feed it with the 5V pin of Arduino, which I have tried but saw smoke coming out of it. Later checked the Arduino and I guess the Mosfet behind the Arduino looks like it burned.

Also, I was thinking to use the 5V output of the L298N for these DC motors. Is it a good idea?

Some information:

  • Battery: 11.1V 1500mh
  • Arduino Nano
  • The project: trying to build a robot vacuum cleaner. The chassis is built manually with Plexy, Wood, Plastic and etc.
  • For the robot wheel, I am also using 2 gear motor with wheel, and L298N H bridge. It was simple to use.

BTW,

You should not draw power for any motor from the Arduino 5v pin. It is not designed to produce sufficient current and it has protection against the voltage spikes that a motor creates.

I don’t understand what you mean by this

but I realized even with the analogWrite(9, 5) still my output voltage is around 5V(again used Mosfet module).
Does the MOSFET module have a problem? It is weird, right?

Please post the program you have tried and also post a diagram showing how you have everything connected. A photo of a simple pencil drawing is best. See this Simple Image Posting Guide

See also How to use the forum

…R

PLz dont do that....the dc motors creates a backward EMF...which will harm your arduino....u can use a DIODE....to directly feed power to the motor..i.e. use a diode betwen the 5v line and motor properly ...for more information about diodes...see..Diode - Wikipedia

Thanks, guys for the answers.
So can I use the 5v pin of my L298N H-bridge pin?

To answer Robin2: I have attached the Fritzing Schema:


The schema is bigger, but I was just testing the DC motor parts and just wired the minimum to have that, which ends having the Mosfet-module and connects to PWM P9.
About the following line which you have said you didn't understand:

but I realized even with the analogWrite(9, 5) still my output voltage is around 5V(again used Mosfet module).
Does the MOSFET module have a problem? It is weird, right?

As I tried to say and it is in my schema, I have connected the 11.1V to the VIN of my MOSFET-module to control the out voltage less than 6v(My dc motors work 3v to 6v). And as I did learn, the PWM values are from 254 to 0. When I write 0 in pin 9, the output voltage becomes zero. But I thought the PWM pin in the Mosfet works linear, meaning going to 6v from 12v input becomes like 6*255/12 = 127.5. So I thought having 127 would give me something that my DC motor could afford. But even writing on P9(PWM) with 5('analogWrite(9, 5)') would give me around 5v, still.
So, does it expected behavior of the Mosfet-module? or my module is broken?

Thanks rdx_op for the reply.

So, I tried to switch to the 5v pin of Arduino, because I did think once using the MOSFET-module with PWM to lower down the 11.1 input to less than 6v, it may keep the power and increase the current which will be harmful to the DC motors. One of Dc motors also smells like burning, but still works with the normal 1.5 AA battery.
Sorry guys for asking so elementary question.

Regards,
Amir

Image from Reply #3 so we don't have to download it. See this Simple Image Posting Guide

...R

PS ... I shouldn't have to do this. I already gave you the link for the instructions in Reply #1

Sure Robin, you re right.
Will do better next time.

And if you re-read Reply #1 you will see that I said a photo of a simple pencil drawing would be best. Fritzing diagrams are generally useless - it is too easy to misunderstand them. In this case it is quite impossible to read the pin labels.

PWM does not vary the voltage. What it does is vary the proportion of time that the full voltage (in your case 11.iv) is applied. For example analogWrite(pin, 128); will cause the 11.1v to be on for 50% of the time and analogWrite(pin. 255) will cause it to be on for 100% of the time.

Rather than try to measure the voltage I suggest you find the analogWrite() value that gives you the required motor speed. analogWrite(pin, 139); would pass 54% of the power which, for an 11v input would be roughly equivalent to powering the motor directly with 6v.

And, no, you can’t use the 5v connection on an L298. It is not even as powerful as the 5v on an Uno.

…R

Thanks Robin2,
Very helpful.
Also, thank you for guiding me to be better in this forum.
Also, thank you for the fast reply. Very good comments and helped me a lot.
I guess I will not go through burning more stuff, at least I hope so;-).

Regards,
Amir