Don't use Delay. CrossRoads provided a decent starting point for your code, but his code is based on
delay(), which is a dead end.
Instead of delay, use a bool
running to track whether you're relay sequence is running or not. Also have an
startTime, and an array of bools to track if each relay is on or off.
If !running, check the button. If the button is pressed, set running to true, and set startTime to
Then, use millis() to figure out where you are in the sequence. Calculate
(millis()-startTime)/1000/num_relays. Let's call it
relayIndex is less than
num_relays - 1, check the bool for that relay, and if it's off, set it on and turn on that relay. When
num_relays-1, you're done turning on relays. Now it's time to wait for 3 minutes to go by. After 3 minutes, turn off all the relays and relay bools, and set
running=false. Have the reset button do the same thing.
Also note that controlling relays from an Arduino (or from other solid state devices for that matter) requires special hardware and precautions. You should probably use a "digital" relay (something like this, or better yet this 6 channel relay) that isolates the Arduino control line from the high current needed to drive the relay.
Failing that, you should build a control circuit from a MOSFET transistor and a "flyback diode". Without flyback diodes, the inductive coils on your relays emit "back EMF" which will likely fry your transistors (and possibly the Arduino)