having issues with all relays shutting off for a split second

ok i'm having issues where all of my relays go hi for a split second right after halide 3 turns on and right before Blue 3 shuts off cant seem to figure it out hopefully one of you guys can help me with this issue.

// Date and time functions using RX8025 RTC connected via I2C and Wire lib

#include <Wire.h>
#include "Sodaq_DS3231.h"

char weekDay[][4] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
const int Relay1 = 22;
const int Relay2 = 23;
const int Relay3 = 24;
const int Relay4 = 25;
const int Relay5 = 26;
const int Relay6 = 27;
const int Relay7 = 28;
const int Relay8 = 29;
const int actinicSwitch = 8;
const int halideSwitch = 9;

void setup ()
{
  pinMode(Relay1, OUTPUT);
  pinMode(Relay2, OUTPUT);
  pinMode(Relay3, OUTPUT);
  pinMode(Relay4, OUTPUT);
  pinMode(Relay5, OUTPUT);
  pinMode(Relay6, OUTPUT);
  pinMode(Relay7, OUTPUT);
  pinMode(Relay8, OUTPUT);
  pinMode(actinicSwitch, INPUT);
  pinMode(halideSwitch, INPUT);
  digitalWrite(Relay8, HIGH);  // unused relay at current time high to turn off led notifier
  Serial.begin(9600);
  Wire.begin();
  rtc.begin();

}

uint32_t old_ts;

void loop ()
{
  DateTime now = rtc.now(); //get the current date-time
  uint32_t ts = now.getEpoch();

  if (old_ts == 0 || old_ts != ts) {
    old_ts = ts;
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.date(), DEC);
    Serial.print('/');
    Serial.print(now.year(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.print(' ');
    Serial.print(weekDay[now.dayOfWeek()]);
    Serial.println();
    unsigned int currentTime = now.hour() * 100 + now.minute() ; // time in 24hr format fits an int as max is 2359
    int actinicState = 0;// Switch state for actinic Override Switch
    actinicState = digitalRead(actinicSwitch);
    int halideState = 0;// Switch state for halide Override Switch
    halideState = digitalRead(halideSwitch);

    //---------------------------------------------ACTINIC LIGHT CONTROL---------------------------------------------

    //Turns Blue T5 #1 on and off
    if (currentTime >= 1200 && currentTime <= 1359) {
      digitalWrite(Relay1, LOW); // Blue #1 on between 12pm and 2pm
    }
    else if (currentTime >= 1730 && currentTime <= 1929) {
      digitalWrite(Relay1, LOW); // Blue #1 on between 530 and 730pm
    }
    else if (actinicState == HIGH) {
      digitalWrite(Relay1, LOW); // Turns Blue #1 with Switch Override
    }
    else {
      digitalWrite(Relay1, HIGH); // Blue #1 off rest of time
    }


    // Turns Blue T5 #2 on and off
    if (currentTime >= 1230 && currentTime <= 1429) {
      digitalWrite(Relay2, LOW); // Blue #2 on between 12:30pm and 2:30pm
    }
    else if (currentTime >= 1800 && currentTime <= 1959) {
      digitalWrite(Relay2, LOW); //Blue #2 on between 600 and 800pm
    }
    else if (actinicState == HIGH) {
      digitalWrite(Relay2, LOW); // Turns Blue #2 on with Switch Override
    }
    else {
      digitalWrite(Relay2, HIGH); // Blue #2 off rest of time
    }


    //turns Blue T5 #3 on and off
    if (currentTime >= 1300 && currentTime <= 1459) {
      digitalWrite(Relay3, LOW); // Blue #3 on between 1pm and 3pm
    }
    else if (currentTime >= 1830 && currentTime <= 2029) {
      digitalWrite(Relay3, LOW);//Blue #3 on between 6:30 and 8:30pm
    }
    else if (actinicState == HIGH) {
      digitalWrite(Relay3, LOW); // Turns Blue #3 on with Switch Override
    }
    else {
      digitalWrite(Relay3, HIGH); // Blue #3 off rest of time
    }

    //---------------------------------------------HALIDE LIGHT CONTROL-----------------------------------------------
    //                                   ON TIMES INCLUDE OVERLAP FOR LIGHT WARMUP

    // Turns Halide#1 on and off
    if (currentTime >= 1359 && currentTime <= 1729) {
      digitalWrite(Relay4, LOW); // on after 2pm off at 5:30pm
    }
    else if (halideState == HIGH) {
      digitalWrite(Relay4, LOW); // Turns Halide #1 on with Switch Override
    }
    else {
      digitalWrite(Relay4, HIGH); // turns Halide #1 off rest of time
    }


    // Turns Halide#2 on and off
    if (currentTime >= 1429 && currentTime <= 1759) {
      digitalWrite(Relay5, LOW); // on after 2:30pm off at 6pm
    }
    else if (halideState == HIGH) {
      digitalWrite(Relay5, LOW); // Turns Halide #2 on with Switch Override
    }
    else {
      digitalWrite(Relay5, HIGH); // turns Halide #2 off rest of time
    }

    // Turns Halide#3 on and off
    if (currentTime >= 1459 && currentTime <= 1829) {
      digitalWrite(Relay6, LOW); // on after 3pm off at 6:30pm
    }
    else if (halideState == HIGH) {
      digitalWrite(Relay6, LOW); // Turns Halide #3 on with Switch Override
    }
    else {
      digitalWrite(Relay6, HIGH); // turns Halide #3 off rest of time
    }

    //-----------------------------------------------LED LIGHT CONTROL-----------------------------------------------

    // Turns leds on and off
    if (currentTime >= 1200 && currentTime <= 2029) {
      digitalWrite(Relay7, HIGH); // turns leds off between 12pm and 8:30pm
    }

To post code and/or error messages:

  1. Use CTRL-T in the Arduino IDE to autoformat your code.
  2. Paste the autoformatted code between code tags (the </> button)
    so that we can easily see and deal with your code.
  3. Paste the complete error message between code tags (the </> button)
    so that we can easily see and deal with your messages.

Before posting again, you should read the three locked topics at the top of the Programming Questions forum, and any links to which these posts point.

If your project involves wiring, please provide a schematic and/or a wiring diagram and/or a photograph of the wiring.

Good Luck!

i think this may have been a wiring problem. ill have to wait till tomorrow when the cycle starts to find out. if im not mistaken my pulldown resistors where not proper value for what i was trying to accomplish.

Is your code complete? It's definitely missing some closing '}' so might be missing something more. A schematic can also be useful (scan / photo of handdrawn one is OK) so we can see how everything is powered.

Does this happen in 'automatic' mode (specific times?) or when you press buttons? Are you using pull-up / pull-down resistors (looking at the code, it should be pull-down)? Which value did you use? Length of wiring between button and Arduino?

I have figured out the small flicker for the relays my pull down resistors were not the proper value. but you mentioned some closing curly brackets missing would you mind showing me i like to have my coding as clean as possible so there is less problems later down the road. im just starting this sketch there will be alot more added to it. eventually hope for this to be a IoT type setup, and will start the coding of the wifi and be writing the android app to control it within the next week.

There are one or two missing '}' at then end of your code. That might have been a copy / paste error but we can not be sure. Hence the comment, there might have been more code that could affect on what happens. If it compiles on your system, there is no issue from that perspective.