Strange behavior of Adafruit motor shield (not original one) and DC motor


I face somewhat strange behavior of motor shield (which I bought from and DC geared motor.

I use following code to run motor:

int pwm;
void setup()
  pwm = map(speed, 0,100, 0,255);

And my power source is 5xAA.

When I connect motor with 0.68uF capacitor, motor twitches and stops. When I connect motor with 0.1uF, motor runs for about minute (or 10sec, or 3mins) and stops. Bizzare thing is when I touch shield's motor terminals with multimeter, motor runs without problems for at least 5 mins.

I am a bit stuck here. I know that shield is not original and I found out that C7 and C8 are differens - they're 100uF 16v instead of 47uF 25V. Dunno if it has something to do with this issue.

Oh yeah, I have tried also separate power source for arduino and motors with same effect.

Also, arduino does not seem to reset or "freeze" - I have led blinking all the time without interruption.

Can someone explain me what is going on and point me out to the direction of troubleshooting?

It is an Adafruit Motor Shield. You could have bought if from Adafruit, or a clone from Ebay for 5 euros or 6 dollars.

Can you check every solder point with a magnifier. Perhaps the terminals do not make contact very well.

Yeah, those shields look same as mine.

I'll check soldering once again, however I am far from being expert and to my eyes in looks ok. In fact, I got same reply about checking contacts on stackexchange.

However, the fact that 0.1uF capacitor makes it run much longer than 0.68uF still makes me think that problem might be not in contacts. I don't have enough knowledge in electronics and cannot explaint what is going on there. Also, motor works fine if I touch motor terminals with multimeter, which probably (probably) rules out version about bad contacts.

Do you think it might have something to do with noice generated by motor and soldering +2 0.1uF capacitors to the motor might help?

You are right, noise by the motors seems the problem. What kind of motors are they ? Some motors behave very bad, causing a lot of noise. Some cheap motors cause even shortcut spikes if they run at a lower speed.

How is the Arduino and motor shield powered. Not just by the USB cable I hope ? What kind of power supplies are you using ?

You could solder 100nF over the motors, but I would prefer a spark suppressor of 47 ohm and 100nF in series.


Motors are from DFRobot 2WD platform - I have no info about it except that data, hope this is enought.

I power motor shield with 5xAA batteries, arduino with 9V battery.

Could you provide more info about spark supressor (maybe link to schematics) ?

5 AA batteries in series for 5*1.5 = 9.5 V ? ← wrong calculated, see post below.
And the motors are for 6V ?
Allthough the motor have a stall current of only 450mA, I doubt if the batteries supply enough current. I think a peak current will drop the voltage too much causing the motors to stop.
Could you try adding a capacitor of at least 1000uF to the batteries ?
Could you try with a normal power supply ?

There is a link to the motors, and comments by users.
Perhaps the information on the website is not right. The motors could perhaps be for 3V to 12V and perhaps the stall current is a lot higher.

That ‘spark suppressor’ is called a ‘snubber circuit’ I think.
But reading more about it, perhaps they are not needed.
Most circuits rely on the flyback diode inside the L293D, and don’t use any noise suppression.

Here is some explanation,
The switch could be the motor, making the sparks and shortcuts.

You've probably meant 7.5V?

I didn't think before about too much current draw since that power scheme was taken from the "Make an Arduino-controlled robot" book.

Regarding capacitor - I shall add it across batterys terminals, right?

Power supply - I have 9V DC adapter, I could try it out - plug it in arduino and make shield use arduino's power source.

Also, do you have any ideas why touching motor terminals / shield connector with multimeter (which measures voltage) seems to fix the problem? Does it somehow remove noise which is probably the cause?

Just in case of someone will face similar issue - I've managed to fix it by:

1) Replacing C7 and C8 with correct capacitance - 47uF instead of 100. 2) Bridging grounds of L293D leads.

Don't know which one of those fixed the problem - or maybe both of them. Anyway, now I managed to run 2 motors for 10 mins (until I powered them off).