Motorshield reseting arduino?

Hi,
I am currently building a small robot and I am having a wierd problem with the Motorshield. At first I though it was caused by the power supply ( I used the same source for both the arduino and the shield). But then I rigged the shield to an indenpendent source of power and the problem persisted.

The motor will run for sometime (apparently random) and then stop, usually for about 2 second, and then it seems like the arduino resets(not sure). I am really puzzled about all that. Could it be a heat issue? Is it because my power supply for the motor shield does not supply enough current? Could it be mechanic or software?

I made a video of the problem and you can see it here :

In there I actually switch the separate power supply for the motor shield from 3.3v in the begginning to 5v, then 9v, then back to 3.3v. This way you can see how it doesn't seem to happen at low voltage and then more frequently at high voltage.

Here is the code I use to program the arduino :

#include <AFMotor.h>

AF_DCMotor motor1(4);
AF_DCMotor motor2(3);

void setup()
{
motor1.run(RELEASE);
motor2.run(RELEASE);
}

void loop()
{
motor1.run(BACKWARD);
motor2.run(FORWARD);
motor1.setSpeed(100);
motor2.setSpeed(100);
 
}

Any help would be greatly appreciated.

I would suggest adding a serial.print msg into the setup() function so you can be certain if it is resetting. Kind of sounds like you're browning out the Arduino somehow. Maybe post a wiring schematic of your setup?

Sure I will try that as soon I as get back home. For the wiring, it's pretty simple : Arduino MotorShield on top of the Arduino Duemilanove.

The Arduino is powered by a USB CABLE.

Then, I have the DC Motors in the M3 and M4 port of the Motorshield. The motorshield doesn't have the power jumper so I takes it's power from the other external source.

This source is from a adjustable power supply
(Adjustable Breadboard Supply)
and plugged into the wall with a 0.660 A, 9V DC/AC converter.

Thats about it.

I did put a print ln in the setup part of the code. The arduino was resetting. It's seems the problem just disapeared by itself, all I did is take out the wire that were passing through in between the arduino and the motorshield. I guess is was doing a magneticfield or something (maybe just interference...)

Anyhow, thanks a lot!

Was the wire carrying rapidly switched high currents? That would induce significant voltages on wires nearby. You have re-discovered electromagnetic induction perhaps!

Well those were the wire connecting the DC MOTOR, and since I think the control is being made with Pulse Width Modulation, I would say that yea, it did have big variation. How awesome is that I discovered and old physics law !