why pwm seems weak when using laptop usb for powering arduino?

hello everyone, newbie here. i just start playing pwm function for my dc motor and i run into something that i cant understand.
here’s the thing i use:

  1. arduino uno rev3
  2. l298n driver module
  3. 12v - 5v step down with usb output
  4. dc brushed motor
  5. 11v battery

so basically i split my 11v battery power to:

  1. 12v input L298n driver
  2. 12v - 5v stepdown that i use to power the arduino

the rest is pretty much where it should be. for testing i only use one dc motor. the dc motor is freespinning without any load.
i use a simple code where it giving increasingly pwm 80,150,250, with 3000 delay in between.

but here’s what i didnt understand
when i use the stepdown to power my arduino, theres no noticeable speed different at given pwm number. in fact, it look like the motor are spinning full speed everytime.
is it because i didnt give load to the motor so it look like it spinning on full speed?

but when i use my laptop to power the arduino, theres noticeable speed different. but it seems very weak. even when pwm number is 80, the motor are hardly spinning.

Firstly never ever power a motor from the Arduino 5V, especially if the Arduino is powered from a computer's USB port. That can destroy the Arduino and the computer.

When you are using the 12V supply for the motor driver, the L298N will lose about 2.5V - so expect the performance as if the motor has 10V or so only.

The problem with speed control is I think because of the mode used. Probably fast decay mode given its an L298.

There are various modes for driving an H-bridge and and most do not exhibit linear behaviour.

Hey I was the guy on Quora who commented on your post earlier today.

Okay, after looking at the schematic I'm thinking you should go ahead and connect a ground line between the Arduino and the Motor driver. It seems that connection *might be there through the 12V to 5V converter. But I'm assuming you are removing that connection when powering off of USB?

Remember all voltage is relative. The Arduino is putting out PWM at 5V relative to GND.. what is the driver supposed to make of that if it is not referenced to the same ground?

Sometimes you need to be careful with motors as they can damage sensitive devices elsewhere in the circuit. In this case I have gone ahead and reviewed the datasheet of the driver and seen the recommended circuit layout includes the ground connection between the Arduino and the driver. It will work.

jward93: Hey I was the guy on Quora who commented on your post earlier today.

Okay, after looking at the schematic I'm thinking you should go ahead and connect a ground line between the Arduino and the Motor driver. It seems that connection *might be there through the 12V to 5V converter. But I'm assuming you are removing that connection when powering off of USB?

Remember all voltage is relative. The Arduino is putting out PWM at 5V relative to GND.. what is the driver supposed to make of that if it is not referenced to the same ground?

Sometimes you need to be careful with motors as they can damage sensitive devices elsewhere in the circuit. In this case I have gone ahead and reviewed the datasheet of the driver and seen the recommended circuit layout includes the ground connection between the Arduino and the driver. It will work.

it works. i just found you can use 5v from driver to powering the arduino and it works. so then i just leave the ground wire between driver and arduino connected, and try to use the converter again and it works just like you said. about using laptop usb for powering arduino, i think that it can't give enough power to do pwm perfectly because the pwm is still weak. for comparison, i can run a motor from stand still with pwm at 80 by powering arduino using converter. while using power from laptop usb need pwm about 100-120 to run it from stand still. i dont know how is this a thing but that what i just found out.

cheers mate, thank you very much. and sorry for my broken english if it give you a hard time.

I'm glad you have a working solution. I must say it's odd that you cannot run off USB Power, but perhaps there are good reasons. Good luck with the rest of your project.