Strange dc motor behaviour

Dear forum,

Firstly i am new to the arduino community but i must say these little boards are quite innovative and have endless applications :slight_smile: . I bought an Arduino RoMeo as my 1st board (this is simply an arduino nano in an arduino uno form factor with an in built motor shield).

Now i have written a small sketch that basically cycles the dc motor's PWM from 100 to 1000 BUT it doesn't keep reving up gradually gettin faster, infact i have realised that for example at 800 PWM on the dc motor gives the slowest speed, much less then 100 PWM ... can anyone explain to me why this is so please ? :slight_smile: (the dc motor is 4.5v-6v, 0.32A , power is being supplied to the board via a wall adapter 9v 300 ma)

Thanks in advance,

I hope you aren't trying to power the motor from the arduino board.

or example at 800 PWM on the dc motor gives the slowest speed, much less then 100 PWM

It depends on how the motor is wired up on your arduino like clone. All the PWM value gives is an on off ratio. If your interface is sourcing current then this is proportional to the smoother output power. However if your interface is sinking current then it is inversely proportional to the output power. It looks like your clone has this sort of power arrangements.

Suspect that your wall-wart power supply is being dragged down by the motor attempting to increase speed. Suggest you try repeating the exercise but use a 12volt sla type battery or similar. The board is rated at 2A maximum so fit a 1amp fuse into the power line to protect your board.

Firstly thanks for all the quick replies ! :slight_smile:

Now @zoomkat yes even though the board can have an external power source for the motors it is currently running off the external power supply of the arduino board itself ie. there is no battery attached to the motor's dedicated power terminal.

@Grumpy_Mike on the manual it came with there wasn't much about this topic but on its motor driver chip there is written l298p so i'm guessing i can have a look at that shield's datasheet for more info ?

@jackrae the wall supply isn't bought it was actually of another appliance and it is 9v not 12v might be a problem ?

also even though 800 PWM is less speed then 100 PWM, 1000 PWM is still the fastest speed.


i can have a look at that shield's datasheet for more info ?

It only tells you part of the story, you need the schematic of what you have. Given they are cloning the arduino they should not be able to withhold it from you. Contact them and ask for, and then demand a schematic.

I've found that for the motor's speed to be continually increasing the PWMs must be in this order 800,300,600,100,900,400,700,200,500,1000 does this make any particular sense pls ?


does this make any particular sense

Well given that the PWM values only go from 0 to 255 these is some wrapping round going on.
Value decimal -- Hex value -- wrapped value hex -- wrapped value decimal
800 -- 320 -- 20 -- 32
300 -- 12C --- 2C -- 44
600 -- 258 -- 58 -- 88
and so on...
so yes you are increasing the the actual number you apply in this sequence.

0-255 ... aha ! ... worked like a charm thanks Mike :stuck_out_tongue: i'm more on the programming side of things hehe thanks again !