Problem with Adafruit Motor Controller v2.3 and Arduino Uno

Hi!

I'm trying to build an Arduino robot using Arduino Uno, the DFRobot Pirate chassis with the 4 motors that come with it, and Adafruit Motor Controller v2.3. When testing with Adafruits DCMotor test sketch, the motor runs fine for a few seconds up to sometimes 15-20 seconds. Then it stops changing speed up and down as its supposed to based on the sketch code and just runs at constant speed.

I'm thinking what might be happening is that my Arduino crashes or resets although I'm not sure. On some occations I have seen in Serial Monitor the text that the sketch sends when it first starts running show up midway through running the sketch. Sometimes the motor just keeps going at constant speed.

I have stacked the shield ontop of the Arduino. At the moment im powering the Arduino from USB. I'm powering the motors from a pack of 5xAA batteries in series through the Adafruit shields external power connection.

Has anyone had this problem? I have been googling and first I found a discussion somewhere that suggested there might be a problem with wire.h file and the Adafruit shield and I2C, but that related to an old version of the shield. I then found a bunch of stuff on DC motor noise. I'm thinking this might be what is going on. I have read that capacitors soldered to the motors might help. Also, my power wires are quite long and some of them run close to the Arduino. I understood that the interference from motors might be amplified by the wires acting as antennas?

I just ran a test by having the Arduino print out numbers every 2 secs to the Serial Monitor to see if there is a problem when the motors are not running. Everything works fine with power to the Adafruit shields external power supply on but motors not turning.

Ideas as to whats going on and what to do? If you think it is the motors, I'll certainly try soldering capacitors to them, but can you recommend good replacement DC motors with low interference?

Thanks in advance!

I then found a bunch of stuff on DC motor noise. I'm thinking this might be what is going on.

I think so too, this is a very typical problem with motors.

can you recommend good replacement DC motors with low interference?

No they all kick out interference, it is the brush contacts that produce sparks and hence the noise.

While a small capacitor directly across the motor will help you also need to apply some supply decoupling to the voltage from the battery. At least a 47uF and a ceramic 0.1uF across the supply as close to the motor as you can. But you should use a pi circuit, that is the last one on this page:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Ok, thanks for the info! I'll do that!

Just to update on this: I finally got around to getting capacitors and trying to fix this. Adding three 0.1uF capacitors per motor (one across the connectors and one from each connector to the motor casing) and twisting the motor power wires fixed the problem. I will certainly have another look at the linked circuit above to understand how it works, for future reference. Thanks again for help!