Cannot power motor shield if USB not connected

Hi there,

I am controlling a motor shield from the Mega. If I have the USB cable connected, it works fine, without it, I cannot control the shield. The control signal comes on momentarily, but nothing happens.

The shield has a 9V power source, which is also connected to the Vin pin on the Mega.

All 0V connections are common.

Regards,

Do you have a link for the shield? Is it an original mega or a clone (link please)?

It's in general a bad idea to power motors and relays from the same power supply as the micro controller.

At the moment that you apply power to a motor (or relay), it will initially draw an (theoretically) infinite current causing you're voltage to drop resulting in a reset of the micro controller. So you need a rock solid power supply that is able to deliver that initial current without problems. Use a car battery might solve the issue :wink:

Easiest is to use 2 power supplies (one for each board) and not connecting the Vin pins.

Is that 9V power supply a 9V battery of the type found in smoke detectors?
If so, that's not adequate for powering motors, and barely adequate for powering just an Arduino on it's own.
What motor(s) do you have connected?

It sounds to me like you have not got a common ground in the circuit and the USB lead is accidentally completing the circuit for you.
Post a clear photo of what you have and a schematic of how you wired it up.

Hi all,

Thanks for the feedback.

I bought the Mega brand new in its original packaging.

I thought it might be the power supply that is not strong enough. The motors are 3W pump motors. The power supply is an AC/DC converter, 220V AC in: 9V 1A DC out.

Let me power the Mega on its own and test the results.

Thank you for all the feedback.

Regards,

sterretje:
Do you have a link for the shield?

So you are not going to answer that then? It is the most important part.

Sorry about that,

Please also see diagram attached.

D1404263961.pdf (34.4 KB)

So how have you got it wired up?

As well as the motor power supply it also needs a logic power supply, where is that coming from?

You should have the 5V from the Arduino connected to the VDD5 line and the ground on the motor driver connected to the ground on the Arduino.