Code not working correctly on Lipo unless also USB plugged in

Hi,

I'm also posting my issue in this section as I don't know if its specific to my stepper driver or the Arduino Mega2560.

The problem is that my stepper motor attached to a sparkfun autodriver only works, if I plug in a USB cable besides the 3cell 2000mAh lipo that is connected to the stepper and the Vin/Gnd on the arduino side.

If I connect the lipo only, the move command doesn't work. However, judging by a debug buzzer, the code runs until after the move command.

What also seems works is, if I boot the arduino with USB and Lipo connected and then unplug the USB before the move command.

This is strange behavior and I could find many topics on that through search, however most of those projects used 9V block batteries and not lipos. I hope someone knows what's going on?

All pins have correct voltages (5V, 3v3) (also if only powered through lipo) and the autodrivers are attached correctly.

Thank you in advance!

-Phil

Please post a circuit showing how it is all connected.

Weedpharma

I think this this is the wrong section :wink: The header says "For ..., NOT your project" :smiley:

You also should not cross post; it becomes very confusing because people answer in one thread and can't find their answer back when reading your other thread.

If in doubt, it's far better to report your post / thread and let a moderator decide where it fits best. In this case a bit difficult because (I think) you added your question to an older existing thread (hat of that you at least did some research though :wink: ). But a moderator can split it off if needed.

I guess the other post that you're referring to is http://forum.arduino.cc/index.php?topic=202376.msg2959574#msg2959574

Okay. I've solved the problem and definitely think its arduino related and not specific to the stepper driver I'm using. That's why I think it fits better here now, since I am hoping for someone to explain the cause of the problem.

I used the mega's digital pins to provide gnd and 5V to the autodriver board. (D46 HIGH and D44 LOW if that's relevant).

They are being pulled high first thing in the setup function. Afterwards I even used a 500ms delay before adressing the setup of the autodriver.

When using both digital pins for high and low, I need to reset the arduino after powering up the first time to make the autodrivers work.

When using only the digital low and the mega's normal 5V pin however, the autodrivers work properly when powering with lipo only.

Any ideas?

I'm sorry for crossposting, I assume that not everyone in the arduino specific section is interested in the robotics section. I understand that its spamming the forum a little bit, but my head is kind of on the line considering a project deadline :-/.