I'm having trouble with an Arduino that appears to be constantly rebooting. The setup is attached. Hardware is:
- Lolin NodeMCU v3
- Deek-Robot Arduino Pro Mini 3.3v
- 28byj-48 5v steppers
- ULN2003 Driver boards
- XL6009 DC-DC boost module
Overview: NodeMCU provides 3.3v output to power the Pro Mini. It connects to an MQTT server for commands, and parses those commands and sends motor id and position updates to the Pro Mini via SoftwareSerial. Pro Mini handles all of the stepper motors.
Power is delivered by a 5v 2A USB charger (Samsung Adaptive Fast charger, testing shows it doesn't limit current). Initially, I was powering the steppers from the NodeMCU's VUSB pin, which passes through the USB voltage. However, the NodeMCU board seemed to be getting pretty hot, and I was having issues with the steppers missing steps. The ULN2003 has a voltage drop of about 1v, which means the steppers were actually only getting 4v, so I decided to try providing 6v to the ULN2003 boards. I initially tested with a completely separate 9v supply with a buck converter set to 6v, and that worked great, so I grabbed some boost converters.
Now I'm splitting the USB power to the NodeMCU and the XL6009, and boosting the power to the steppers up to 6v. When I plug it in, the LEDs on the ULN2003 boards all briefly blink, then shut off, then repeat that ad-nauseam. However, if I unplug 2 or 3 of the 4 stepper motors from the driver boards, it will boot up.
Here's the really weird part (to me, at least): I figured doing some serial debugging would be useful, so I hooked my FTDI board to the Pro Mini, and it powered up fine with all motors connected. I can then unplug the FTDI board and it will continue functioning. I also discovered that I can plug in the unplugged stepper motors after startup, and that works too.
Some other info: I'm using the AccelStepper class, but I've written my own derived class from that which overrides some methods and adds some other new methods. (For example, I've overridden the run() and move() methods to disable the output pins when the motor is done moving and re-enable before moving, since I care about limiting power usage and don't need the holding torque. So I'm not sure how useful posting my code will be, but I'm happy to provide anything desired. Here's the main part of my code, at least:
#include "ClockHand.h"
#include <SoftwareSerial.h>
#define STEPS 4096
#define MODE 8
#define SPEED 500
#define POSITIONS 13
#define SERBUFFER 8
ClockHand one = ClockHand(true, POSITIONS, SPEED, STEPS, MODE, 2, 4, 3, 5);
ClockHand two = ClockHand(false, POSITIONS, SPEED, STEPS, MODE, 6, 8, 7, 9);
ClockHand three = ClockHand(true, POSITIONS, SPEED, STEPS, MODE, 10, 12, 11, 13);
ClockHand four = ClockHand(false, POSITIONS, SPEED, STEPS, MODE, 14, 16, 15, 17);
ClockHand *active;
SoftwareSerial ser(A5, A4);
char cmd[SERBUFFER];
boolean newData = false;
void setup() {
Serial.begin(9600);
ser.begin(9600);
Serial.println("Startup complete.");
}
void loop() {
serReceive();
if(newData) {
processCommand();
newData = false;
}
one.run();
two.run();
three.run();
four.run();
}
Any suggestions? Am I doing something dumb with my power setup? Thanks in advance!
