New and baffled - Stops working after ~30 secs

Hello all! First post, and new(ish) to arduino.

I've done lots on searching, but cant seem to find the issue to this problem.
(Similar issues though)

My plan is to build a synchronous motor for a clock build.
I picked up a 5 pack of Arduino nano V3.0 ATmega328P 5V 16M and
28BYJ-48 ULN2003 5V Stepper Motor + ULN2003 Driver Boards.

I have had nothing but troubles from the start. Seems the first PSU I used was faulty,
and was outputting 12v instead of 5v... so 2 boards down... (the breadboard power supply module)
(I'm using a 12v AA battery tray - the power module drops 12v down to 5v via jumper pins to the breadboard)

The 3rd board I got programmed, and it ran for about 2 minutes. The Arduino
seemed to crash. I tried to reprogram it, but its no longer responding. I was really frustrated
with it, so I left it for the night.
The next morning, I plugged it in, and it ran! for about a minute, then died again...
I tried my 4th board, and got the exact same thing happening. Runs for a minute or two then quits.

I've watched many tutorials with the arduinos/steppers and have the most basic setup one could imaging.
I'm using pins 8,9,10,11 plugged into pins 1,2,3,4 on the motor driver.
There is nothing else plugged into the arduino, using a common ground between the arduino and stepper driver.

So...

The adruino will power up, connect through USB, I can program it once (maybe twice)
The code will run for about a minute and stop.
I can not reset or reprogram the arduino.
Once power is disconnected for at least an hour, the code will run again for a minute or so.

I don't think anything is blown, as it runs again after an hour with no power.
That tells me the bootloader is fine.
Drivers are working, as I was able to detect, and upload the code...

I'm stumped!
Anyone with some insight as to what is happening with this?

Mogal:
I can not reset or reprogram the arduino.
Once power is disconnected for at least an hour, the code will run again for a minute or so.

Based of this I think the actual atmega chip is faulty, since the reset is at a hardware level.
But do the chips get hot? also does it also stop working without anything attached (except USB for power)?
How much voltage does the atmega chip actually receive at the VCC pin?

Not sure if this will help diagnose the issue, but it's worth a shot

LOL I should have know... was at work, and didn't have access to pics or the code.

So now there is a pic attached, and the link to the tutorial and code I am using.

DroneBot Workshop

/*
Stepper Motor Demonstration 1
Stepper-Demo1.ino
Demonstrates 28BYJ-48 Unipolar Stepper with ULN2003 Driver
Uses Arduino Stepper Library

DroneBot Workshop 2018

*/

//Include the Arduino Stepper Library
#include <Stepper.h>

// Define Constants

// Number of steps per internal motor revolution
const float STEPS_PER_REV = 32;

// Amount of Gear Reduction
const float GEAR_RED = 64;

// Number of steps per geared output rotation
const float STEPS_PER_OUT_REV = STEPS_PER_REV * GEAR_RED;

// Define Variables

// Number of Steps Required
int StepsRequired;

// Create Instance of Stepper Class
// Specify Pins used for motor coils
// The pins used are 8,9,10,11
// Connected to ULN2003 Motor Driver In1, In2, In3, In4
// Pins entered in sequence 1-3-2-4 for proper step sequencing

Stepper steppermotor(STEPS_PER_REV, 8, 10, 9, 11);

void setup()
{
// Nothing (Stepper Library sets pins as outputs)
}

void loop()
{
// Slow - 4-step CW sequence to observe lights on driver board
steppermotor.setSpeed(1);
StepsRequired = 4;
steppermotor.step(StepsRequired);
delay(2000);

// Rotate CW 1/2 turn slowly
StepsRequired = STEPS_PER_OUT_REV / 2;
steppermotor.setSpeed(100);
steppermotor.step(StepsRequired);
delay(1000);

// Rotate CCW 1/2 turn quickly
StepsRequired = - STEPS_PER_OUT_REV / 2;
steppermotor.setSpeed(700);
steppermotor.step(StepsRequired);
delay(2000);

}

Okay, I also own one of those power boards.
When you try to run your code, does by any chance the LED on the power board start flashing really quick?
If that is the case, the power board is overheating and then it starts acting weird (which would cause the voltage to drop and that is probably why your code is hanging, the atmel chip is in a weird state at that point)

Here is a video of what's happening.

Nothing gets warm on the board(s)
I've talked to a few people now, and they are thinking these are cheap knock off boards and faulty. They are all behaving the same way, and just doesn't make sense.
As far as I can tell, both the board and stepper are getting the proper 5v.

Today, it ran for about 3 minutes, then stopped. Before I had a chance to power the board down (about 5 seconds) it actually started again, but only for about 5 more seconds, then died.
An hour later, i powered it up again and it ran for 2 or so minutes before dieing again...

So the board isn't dead, but something sure is funky with it.

I guess I should mention I did change the code and got it uploaded.
The program is as before, but just without the slow motion, and spins one direction for 10 revs, pauses 1 sec, then reverses for 10 revs.

Well, so good news I guess!
I managed to solder my last board together, and got it working.
(It ran for over an hour without issues)

Still do not know why the first couple did not work correctly? Baffling!

Either way, it seems I can now progress to the next steps of my clock
(After my RTC shows up)

I noticed something odd about the video, when the arduino hung, the L led flashed kinda weird.
While you didn't use pin 13, have you tried reflashing the bootloader and have you updated everything (IDE and libraries)?
Also, do you have an oscilloscope by any chance? If you do, connect it to the power rail and see if it is unstable or if there are any spikes

edit: What happens if you power the arduino using USB? (disconnect the 5 volt wire and use USB instead)

CrazyVito11:
I noticed something odd about the video, when the arduino hung, the L led flashed kinda weird.
While you didn't use pin 13, have you tried reflashing the bootloader and have you updated everything (IDE and libraries)?
Also, do you have an oscilloscope by any chance? If you do, connect it to the power rail and see if it is unstable or if there are any spikes

edit: What happens if you power the arduino using USB? (disconnect the 5 volt wire and use USB instead)

I am using IDE 1.8.10.0
I updated only the libraries I'm using.
I have no idea about the bootloader, or how it works, thought about getting this to reprogram it?
I do not have an osciliscope, so best is my multi-meter and it seems steady at 5v.
It seemed to make no difference what the power source is/was.

What does the 'L' led indicate?

Mogal:
I have no idea about the bootloader, or how it works

The bootloader allows you to program the arduino over usb, it is also responsible for starting your code that you flashed. But you don't have to buy that programmer since you can use another arduino as an ISP. You need to program 1 arduino with the Arduino as ISP sketch included with the Arduino IDE, this will be your programmer. Then you need to connect that arduino up to the other arduino that is having issues and connect to it using the ICSP header (tutorial: https://www.arduino.cc/en/Tutorial/ArduinoISP)

Mogal:
I do not have an osciliscope, so best is my multi-meter and it seems steady at 5v.

A multimeter is not fast enough to see the voltage dips and spikes, you would need an oscilloscope for that.
But it doesn't have to be the voltage drops/spikes that causes the issue, I just wanted to make sure

Mogal:
What does the 'L' led indicate?

The 'L' LED is directly connected to pin 13 and can be used by your code, simply set pin 13 high and that LED will light up. So you can do whatever you want with that LED, it can for example be a status report