relay board

I have a 8 relay board and would like to set in up to turn the relays on at different time for different lengths of time. any help with code would be awesome or help point me in the right direction

Here is my sketch so for I am not sure how to get the times correct. I want relay 1 to turn on then 10 minutes later the other 3 to turn on and run for 12 hours.

// set pin numbers:
#define Relay1 2
#define Relay2 3
#define Relay3 4
#define Relay4 5

// Variables will change:
long previousMillis = 0;

void setup() {
  pinMode(Relay1, OUTPUT);
  digitalWrite(Relay1, HIGH);
  pinMode(Relay2, OUTPUT);
  digitalWrite(Relay2, HIGH);
  pinMode(Relay3, OUTPUT);
  digitalWrite(Relay3, HIGH);
}

void loop()
{
  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis < 5000)
    digitalWrite(Relay1, LOW);
  else
    digitalWrite(Relay1, HIGH);

  if (currentMillis - previousMillis > 5000 && currentMillis - previousMillis < 10000)
    digitalWrite(Relay2, LOW);
  else
    digitalWrite(Relay2, HIGH);

  if (currentMillis - previousMillis > 10000 && currentMillis - previousMillis < 15000)
    digitalWrite(Relay3, LOW);
  else
    digitalWrite(Relay3, HIGH);

  if (currentMillis - previousMillis > 10000 && currentMillis - previousMillis < 15000)
    digitalWrite(Relay4, LOW);
  else
    digitalWrite(Relay4, HIGH);
/code]

here’s the bones of a sketch I’m working on for a 16ch relay board using arrays

byte relayNum[] = {22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 }; //relayNum[0] - [15]
byte relayCount = 16;
boolean RelayState[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
//boolean ON = LOW;
//boolean OFF = HIGH;
unsigned long relayOnTime[] = {250, 500, 1000, 250, 500, 1000, 250, 500, 1000, 250, 500, 1000, 250, 500, 1000, 250};  //relayOnTime[arrayPosition][0] - [15]
unsigned long relayOffTime[] = {1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000};  //relayOffTime[arrayPosition][0] - [15]
unsigned long currentMillis;
unsigned long RelaypreviousMillis[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

void setup() {
  Serial.begin(9600);
  //set relay pins out and high (=off)
  for (byte arrayPosition = 0; arrayPosition < relayCount; arrayPosition++)  {
    pinMode(relayNum[arrayPosition], OUTPUT);
    digitalWrite(relayNum[arrayPosition], HIGH);
  }
  testCycle();
}    //setup

void loop() {
  cycleRelays();

}    //loop

void cycleRelays() {
  currentMillis = millis();
  for (byte arrayPosition = 0; arrayPosition < relayCount; arrayPosition++)  {
    if ((RelayState[arrayPosition] == HIGH) && (currentMillis - RelaypreviousMillis[arrayPosition] >= relayOffTime[arrayPosition]))
    {
      RelayState[arrayPosition] = LOW;                                       // Turn it on
      RelaypreviousMillis[arrayPosition] = currentMillis;                    // Remember the time
      digitalWrite(relayNum[arrayPosition], RelayState[arrayPosition]);      // Update the [arrayPosition] RelayState
    }
    else if ((RelayState[arrayPosition] == LOW) && (currentMillis - RelaypreviousMillis[arrayPosition] >= relayOnTime[arrayPosition]))
    {
      RelayState[arrayPosition] = HIGH;                                     // turn it off
      RelaypreviousMillis[arrayPosition] = currentMillis;                   // Remember the time
      digitalWrite(relayNum[arrayPosition], RelayState[arrayPosition]);	    // Update the [arrayPosition] RelayState
    }
  }
}    //cycleRelays


void testCycle() {
  // arrays for cycle time for test routine
  int testSwitchIncrement[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 1000};  //test delay Time array [0] - [15]
  int testSwitchDecrement[] = {1000, 150, 140, 130, 120, 110, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10};  //test delay Time array [0] - [15]
  //  Increment:
  for (byte arrayPosition = 0; arrayPosition < relayCount; arrayPosition++) {
    digitalWrite(relayNum[arrayPosition], LOW);   // "ON"
    delay(testSwitchIncrement[arrayPosition]);
    digitalWrite(relayNum[arrayPosition], HIGH);  // "OFF"
  }
  //  Decrement:
  for (byte arrayPosition = relayCount--; arrayPosition >= 0; arrayPosition--) {
    digitalWrite(relayNum[arrayPosition], LOW);
    delay(testSwitchDecrement[arrayPosition]);
    digitalWrite(relayNum[arrayPosition], HIGH);
  }
}    //testCycle

And 1 milli = 1/1000th of a second so (((1 millis()*1000= 1 second) *60 for minutes) *60 for hours) etc.

rlawns83:
Here is my sketch so for I am not sure how to get the times correct. I want relay 1 to turn on then 10 minutes later the other 3 to turn on and run for 12 hours.

You forgot to initialize the pin for Relay4.
Relay1 is turned on for the first 5 seconds after reset, then turned off. Change that to 10 minutes (600,000 milliseconds).
Relay2 is turned on from 5 seconds to 10 seconds. Change that to come on at 10 minutes and off at 12 hours and 10 minutes. Then you can turn Relay3 and Relay4 on and off at those same times.
You have not said what happens after the 12 hours and 10 minutes. As the code is written the cycle will start again in about 49 days when the time rolls over to 0.