Cause of LED to double blink?

Good afternoon,

I am utilizing a Mega with ethernet/SD card shield and the pin 13 LED on the shield starts a double blink after ~27sec. while being powered via an external power source. This does not happen while powered via USB. I'm not sure if this is an error code or an operational code I've not yet encountered. But seemingly all forum & web search results yield the standard blink sketch and I don't think its a "garbage in, garbage out" case regarding how I'm searching.

I am getting power to the motor drivers (TB6612FNG) and while probing wires for power I get highs as expected but wires that should be low are not indicating any current. Suspicion this is connected to blinking light issue but not sure.

This is part of a larger project utilizing 4 DC motors and 6 gate valves so I am simply trying to verify correct connections as I go to avoid larger issues down the road. As such, the code I'm using is:

int STBY = 27; 

//Motor A
int PWMA = 8; 
int AIN1 = 23; 
int AIN2 = 25; 

//Motor B
int PWMB = 6; 
int BIN1 = 29; 
int BIN2 = 31; 

void setup(){
pinMode(STBY, OUTPUT);

pinMode(PWMA, OUTPUT);
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);

pinMode(PWMB, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
}

void loop(){
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 255); 

digitalWrite(BIN1, HIGH);
digitalWrite(BIN2, LOW);
analogWrite(PWMA, 255); 

delay(3000); 

digitalWrite(AIN1, LOW);
digitalWrite(AIN2, LOW);
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, LOW);

delay(1000); 

digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
analogWrite(PWMA, 255); 
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, HIGH);
analogWrite(PWMA, 255); 

delay(3000);

digitalWrite(AIN1, LOW);
digitalWrite(AIN2, LOW);
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, LOW);
delay(1000);
}

Any guidance troubleshooting would be greatly appreciated.

System drawing/diagram (inline) please.
Probably power supply and/or wiring.

Delay is BAD, but ok for this simple test.

Karma for posting in code tags

EFox:
I am utilizing a Mega with ethernet/SD card shield and the pin 13 LED on the shield starts a double blink after ~27sec. while being powered via an external power source. This does not happen while powered via USB.

What is the external power source? Sounds like when your motors run they draw too much current. That causes a brownout on the 2560 chip, causing it to reboot.

EFox:
I'm not sure if this is an error code or an operational code I've not yet encountered.

Sounds like you're seeing the bootloader run when the processor reboots.

I had tested all soldering on the motor drivers for any errant cross pin connections and they checked out fine prior to install. After going down a list of components to isolate and test (to no avail) I decided to try another driver board and voila! The individual motors worked as well as all four that will be utilized for this project.

That being said, at one point during isolation and testing the LED began blinking in an ever shorting cycle. The code was never more than a simple alternating pins HIGH/LOW with a delay between change in current directions. Would I likely be correct in assuming something was inadvertently causing low voltage from the board or causing the board itself to trip/reset?

Actual issue resolved, I'm now just curious as to what I was seeing with the LED to file under "lessons learned".

Mahalo!

Evan

Well it may be coincidence, but on a Arduino UNO, pin13 is SPI CLK which is used by both the Ethernet chip and the SD card.

Motors are a common cause of voltage drops and related issues such as crashes and reboots, usually caused by a too weak power supply.

You didn't specify the motors or your power supply, nor did you post a circuit diagram, so whether that's an issue is anyone's guess.