power requirements and low power = crazy crashes?

This is a two part question but I think I know the second answer is that “yep, that can happen”…

First is how to figure power requirements for a battery. I have a Mega2560 with a dual motor shield, LCD keypad shield, Bluetooth, GPS and (currently non working) compass. I also have a couple of small motors on the prototype. On the real thing, this will be electronically isolated and I will control big power hungry motors through an ESC. I will need to tell the guy wiring power to the motors how much I need and will get a pair for the barrel plug.

Second question is the follow on. I have tried connecting to the barrel plug with a small wall wort and with a ni-cad and when I pulled the USB umbilical cord, the system went haywire. Program crashed, motors that had been off started running erratically. LCD predicted end of world, etc. Pulled the power and go back on USB and the motors continue to run until I load code that shuts them off or remove their power. I think that is just an interesting cosequence of low power, but it did worry me about whether or not my barrel adapter works right.

I have tried connecting to the barrel plug with a small wall wort and with a ni-cad and when I pulled the USB umbilical cord, the system went haywire.

Either of these, of the appropriate amperage, should be able to power your system. The USB port is supply 200mA or less currently, so any power supply able to supply that much current, at the appropriate (5V) voltage should work.

Any old wall wart may or may not work. Tell us about yours.

Any old battery may or may not work - ni-cad or not. Tell us about yours.

I will need to tell the guy wiring power to the motors how much I need and will get a pair for the barrel plug.

A pair of what?

A pair of what?

Wires - ground and whatever voltage/amperage I ask for.

Well, my wall wart claims 300ma and my 6V NiCd claims 600ma hours.

I have been trying this by using the USB to program it and then pulling the USB. It crashes then, so I tried pulling the USB and then powering the unit. If I plug the USB back in, it doesn't crash; it just rests and runs what I last downloaded. Do I need to do this differently?

Well, my wall wart claims 300ma and my 6V NiCd claims 600ma hours.

300mA at what voltage? Is it a regulated or unregulated power supply?

600mAh is a capacity rating, not a current rating. It means that the battery will output some amount of current for some time, where the current and time are not explicitly specified. Could be 30 amps for a few milliseconds or 30mA for 20 hours.

If you're feeding the arduino via its DC plug you'll need a battery with a higher voltage than 6V. Is it actually 6V ? 6V would require 5 cells in series, its likely to be 4.8 volts which passes for 6V in heavy load / not too fussy about voltage scenarios. But no good feeding the arduino via the DC Jack. You could do with a meter so you can test stuff, labels are very often miles away from reality......

The wall wart is a universal 3v-9v selectable. Mostly I have used it at 6v and 7.5. It makes no claims about regulation.

The other reply came in while I was replying about wall wart. My meter says the battery is actually putting out 6.7.

As others mentioned about input voltage, yes, 6V or 7.5 are on the low end of acceptable voltage. As you turn on a motor, the 6.7 V will further drop below the operating voltage of the Arduino's voltage regulator (6V). Then the arduino will be controlled by an unpredictable and time-varying voltage. Besides, not all wall warts are born the same. Some, especially selectable ones are made with sh*t. I use my standalone system with a 12V adapter. Never had a problem although the system requires no such power as yours. I would suggest you go with 9V and measure voltage without motor movement and then move the motors and see if voltage drops too much.

I bought my adapter at a thrift store for $2: 12V 1.25A and possibly a switching supply (feels so light).