Runs one sketch tethered, something else when not


I wrote a sketch. Verified it. Downloaded it. All no problems. It drives my robot and uses a Ping to look for obstacles.

Tethered to the USB cable the Ardweeny seems to run the sketch fine. Both motors turn, I can see the Ping sensor working, if I put my hand up as an obstacle it changes the motor spin to turn away. Very cool.

If I take it off the USB and switch on onboard power, the Ardweeny runs something else. One motor always on, the other cutting in and out repeatedly and the Ping isn’t on.

I don’t get it.

No errors. No feedback. Just not the expected behavior. About wore out the reset button. Why would it be different?

Any ideas? :-/

Apparently just posting solves problems.

The 9 volt powering the board was low and wasn't providing enough power to drive the Ping.

If you are using a single 9 volt to run everything, you're going to run into the same problem eventually. 9 volt batteries don't have a lot of current capability; you will want to use a battery pack composed of other cells (AAA or AA sized, at least) - or run the Arduino off the 9 volt, and the motors/servos/ping off a battery pack. Hook the positive leads up to their respective inputs, and tie the negative leads together and hook them to the ground points (common ground).

Yeah I am running the Arduino off the 9 volt and the servos off of 4 AA's. I didn't think I needed to put the Ping over on the AA's - I thought it needed regulated 5v as well.

I'll look at the data sheet- but maybe that is a good suggestion. Run the ping power off the same lead going into my motor driver chip.