DC motor control using PWM

Hey guys,

So I am currently working off this tutorial http://learn.adafruit.com/downloads/pdf/adafruit-arduino-lesson-13-dc-motors.pdf it was working originally but randomly the PWM function failed and the board is reading the motor as if its turned off when it is still at like 50 anyone got a solution to this?

I don't know what you mean by:

the board is reading the motor

The motor isn't a sensor: what makes you think it is being read?

As an aside: not good practice to power the motor from the 5v pin of the Arduino.... might be an idea to give it a separate 5v supply, with only the motor's ground to the Arduino ground. It could be that the stall current is too high.

Hi, Chris, are you using the motor supplied with the kit, or another motor. Note the warning in RED.
In fact it would be good practice as suggested by Jimbo that you supply the motor with its own power supply.
This will minimize any power or noise problems associated with motors.

Tom..... :slight_smile:

Hi Chriss122,
Different motors work differently with PWM! I find many motors fail to move until the PWM or analogWrite() value is about 70-100, working with a couple of cheap motors at the minute and their not even matched so one starts slowly causing a slight turn! before the other even begins to turn. Yes use a separate set of batteries for your motors, just to be safe their cheaper then a new Arduino whichever one it is?

Try starting at 100 to 255, hope it helps.