Problem switching between USB and external power

Hi all,

I have an UNO with a motor shield running a small stepper motor. For my project I basically run my motor forward at certain high input signals and backward at lower inputs. When I plug my board into my computer via USB and upload my program, everything runs perfectly. However, when I unplug the USB and plug in external power, my motor just starts running forward continuously.

I am using a 9V DC 1000mA external power source. My motor shield is operating from a separate power source. I was able to run a stepper motor test program using the external power source before.

Any ideas on the problem? Should I wait a few minutes between unplugging the USB and plugging in the external power?

Thanks

Do you have the grounds for the different sources connected to the Arduino ground?

I am new to this so please excuse my ignorance.

I am working with 3 boards: the UNO and motor shield that are stacked on top of each other, and a board that is generating the signal for the UNO/shield. All three have separate power. The signal board is grounded with the UNO/shield and the motor is grounded. That accounts for everything, unless I have to ground the 9V battery powering the shield.

You have to connect the 9V Battery- to the other grounds.

So before reading your last post I eliminated the 9V battery alltogether. I shunted the power from the Arduino (USB or external source) and was able to run my motor. With the USB plugged in, everything was going fine as usual. When I switched to the external wall power my motor just started going forward non-stop again. Am I still missing a ground? Is the difference in voltage supplied by the USB and external source (5V vs 9V) cauing the problem?

I also noticed that my motor is much louder with the external power than with USB power.

Is the difference in voltage supplied by the USB and external source (5V vs 9V) cauing the problem?

No, voltage is not the problem, but current capacity might be. The USB can provide up to 500ma of current. What is the maximum current capacity of your 9vdc voltage source?

Lefty

1000 mA

dsterl54:
1000 mA

That should be plenty. Have you attempted to measure the 9vdc when it's powering the board? An easy place is to just take a voltage reading between the Vin pin and ground.

Lefty

USB only provides 500mA.
Perhaps the input pins are floating, so the higher current source is creating different behavior?

I am using an extremely old multimeter, but it seems as though I am getting 9V through the board using the external power.

The difference in current definitely seems like it could cause this problem. The weird thing is, though, that I have successfully run a stepper test program using external power. Should I try an external power source with a lower current?

dsterl54:
I am using an extremely old multimeter, but it seems as though I am getting 9V through the board using the external power.

The difference in current definitely seems like it could cause this problem. The weird thing is, though, that I have successfully run a stepper test program using external power. Should I try an external power source with a lower current?

The power module does not 'force' current through the arduino, the arduino draws only as much current as it requires, using the principles of ohms law. You could have a 500 amp DC power module and it would power the arduino board no different then your 1 amp module. There is something else going on with your power module and your best bet is to try a different external DC voltage source rated at 7 to 12 VDC and a current capacity of 500ma of higher.

Are you sure your 9 volt power module is a DC output and not a AC voltage output?

Lefty

Okay that seems like a good idea. I have noticed other people using external DC voltage sources like you have described.

My power is labeled as 9V DC.

So I did try something that worked. Rather than using the 9V 1000 mA power I was using, I plugged a 9V battery into the GND and Vin pins. My motor ran perfectly, although it made a crazy sound. I did shunt the power between the UNO and the shield, so next time I will try to power each with their own 9V battery.