Not familiar with "timers"

Folks, it has gotten to that time where I need help, please. I have tried over and again and can't get it right.

Long story when short, I have an Earth Leakage that's too sensitive to lighting - hooked up a solenoid to reset it (Which I do manually with a battery on a long 2-core cable from my room.

I need to put some brains behind this solenoid for when I'm out of the house in the fear that my gates battery runs flat and I get stuck outside.

Right so, on to the code. Everything works fine on tinkercad.com, I'm only struggling with an "auto-reset timer" If the Earth Leakage is still misbehaving and I'm not there to intervene.

Herewith is my code which I've done my best to explain with //

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(6, 5, 4, 3, 2, 1);

const int CURRENTRELAY=7; //Power control to Solenoid
const int POLRELAY1=8;    //Polarity changer A
const int POLRELAY2=9;    //Polarity changer B
const int ERRORSIG=13;    //Signal Earth Leakage Error
const int POWER=12;       //Eskom line input

//Key connections with Arduino
const int up_key=10;      //Activate the EL Tool
const int down_key=11;    //Deactivate the EL Tool

int SetPoint=0;           //Up/Down key status
int SetPoint2=0;          //Eskom Line input status
int SetPoint3=0;          //Solenoid Counter


//=================================================================
//                  SETUP
//=================================================================


void setup(){
  pinMode(CURRENTRELAY,OUTPUT);
  pinMode(POLRELAY1,OUTPUT);  
  pinMode(POLRELAY2,OUTPUT);  
  pinMode(ERRORSIG,OUTPUT);
  pinMode(up_key,INPUT);
  pinMode(down_key,INPUT);
  
  //Pull up for setpoint keys
  digitalWrite(up_key,HIGH);
  digitalWrite(down_key,HIGH);
  
  
   // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("E/L RESET TOOL");  
  lcd.setCursor(0,1); //Move cursor to second Line
  lcd.print("VER 1.0");
  //lcd.clear();
  //digitalWrite(CURRENTRELAY,LOW);  //Green LED Off
  //digitalWrite(POLRELAY1,LOW);     //Red LED On
  //digitalWrite(POLRELAY2,LOW);       //Turn off Relay
  delay(3000);
}


//=================================================================
//                  LOOP
//=================================================================  


void loop(){
 //Get user input for setpoints  
 if(digitalRead(down_key)==LOW)
 {
  if(SetPoint>0)
  {
   SetPoint--;    
  }
 }
 if(digitalRead(up_key)==LOW)
 {
  if(SetPoint<1)
  {
   SetPoint++;
  }
 }
 
 //MAIN Control
 if(SetPoint3>=6 && SetPoint==1)       //If EarthLeakage has been reset 6 times then shut down
 {
    digitalWrite(CURRENTRELAY,LOW);    //Turn off solenoid
    digitalWrite(POLRELAY1,LOW);       //Turn Polarity changer A off
    digitalWrite(POLRELAY2,LOW);       //Turn Polarity changer B off
    digitalWrite(ERRORSIG,HIGH);       //Turn Alarm output on
    lcd.setCursor(0,0);
    lcd.print("ERROR FAIL ERROR");     //Print message on screen
  }
 
 //==========================================================================
 //Here is my problem - I though I had it a couple times but it either freezes or does nothing
 //If I am not home and its been 1hr I want the arduino to reset and try execute the solenoid
 //operation again and repeat:
 /*
 
 else if(SetPoint3==6 && SetPoint2==0 && SetPoint==1)
 {
  delay(10000);
  SetPoint3*=0;
  digitalWrite(ERRORSIG,LOW);
 }
 
 */
 //Also if I so happen to be sleeping, EL trips and cant reset - this counter must do its thing
 //but if I wake up and come toggle the system on/off I must be able to override the countdown
 //and have the code reset to be ready for the next trip
 //ditto if I'm away it must do its thing and carry on without intervention
 //============================================================================================
 
 if(SetPoint3>=1 && SetPoint==0) //If the solenoid counter is maxed and I toggle the system off/on it resets
 {
   SetPoint3*=0;
   digitalWrite(ERRORSIG,LOW);
  }
 else
 {
  if(SetPoint3<6 && SetPoint==1 || SetPoint3<6 && SetPoint==0)
  { 
   //Display Set point on LCD
   lcd.setCursor(0,1);
   lcd.print("SYSTEM:");
   if(SetPoint==1)
   {
    lcd.print("       ON");
   }
   if(SetPoint==0)
   {
    lcd.print("      OFF");
   }
   
   if(digitalRead(POWER)==LOW) //Check if EarthLeakage has tripped
   {
    if(SetPoint2>0)
    {
     SetPoint2--;
    }
    lcd.setCursor(0,0);
    lcd.print("POWER: ");
    lcd.print("FAIL    ");
    lcd.print(SetPoint3);       //Display Solenoid Counter
   }
   
   if(digitalRead(POWER)==HIGH) //Check if EarthLeakage has tripped
   {
    if(SetPoint2<1)
    {
     SetPoint2++;
    }
    lcd.setCursor(0,0);
    lcd.print("POWER: ");    
    lcd.print("ACTIVE  ");   
    lcd.print(SetPoint3);      //Display Solenoid Counter
   } 
   
   //Check if Power is on or off
   if(SetPoint2 > SetPoint)
   {
    digitalWrite(CURRENTRELAY,LOW);    //Turn off solenoid
    digitalWrite(POLRELAY1,LOW);       //Turn Polarity changer A off
    digitalWrite(POLRELAY2,LOW);       //Turn Polarity changer B off
   }
   
   //If Power is off then do the following
   if(SetPoint2 < SetPoint)
   {
    SetPoint3++;
    digitalWrite(CURRENTRELAY,HIGH);    //Turn on solenoid to pull
     delay(500);
    digitalWrite(CURRENTRELAY,LOW);    //Turn off solenoid to release
     delay(500);
    digitalWrite(POLRELAY1,HIGH);       //Switch Polarity A +>-
    digitalWrite(POLRELAY2,HIGH);       //Switch Polarity B ->+
     delay(500);
    digitalWrite(CURRENTRELAY,HIGH);    //Turn on solenoid to push
     delay(500);
    digitalWrite(CURRENTRELAY,LOW);     //Turn off solenoid to release
    digitalWrite(POLRELAY1,LOW);       //Turn Polarity changer A off
    digitalWrite(POLRELAY2,LOW);       //Turn Polarity changer B off
     delay(500);
   }
  } 
 }   
}

I would absolutely love to do something like

else if(SetPoint3>1 && SetPoint2==0 && SetPoint==1 for>3600sec)
 {
  SetPoint3*=0;
  digitalWrite(ERRORSIG,LOW);
 }

But I'm very certain I just typed BS and have no clue how to remedy it.

  if(SetPoint3 < 1 || SetPoint2 !=0 || SetPoint != 1)
  {
    // Re-start a timer whenever the condition is false
    ResetTimer = millis();
    ResetTimerRunning = true;
  }

  // If the condition was last false 3600 seconds ago...
  if (ResetTimerRunning && millis() - ResetTimer >= (3600ul * 1000ul))
  {
    // Condition has been true for 3600 seconds.
    SetPoint3 *= 0;
    digitalWrite(ERRORSIG,LOW);
    ResetTimerRunning = false;
  }

Why not just remove the Earth leakage breaker completely ?
Do you understand HOW. an earth leakage breaker works internally ?

It sounds like you have a more fundamental problem in your mains wiring.

2 Likes

MR Wasser thank you so very much! I will try this right now and see how it interacts!
Otherwise, is my code up to C++ scratch? I'm a bit of a scatterbrained ADHD so things tend to get messy :slight_smile:

Well, that's the problem, I have had sparkie after sparkie come out and tell me nothing is wrong and I'm fed up with paying for their fuel and time. the EL works fine in all other conditions, but, if it so happens to even know that lightning is in the vicinity it trips. I even went to the extent of spending a couple grand and replacing the EL with no luck. the lighting around here can get pretty gnarly at times so...

Erm, am I missing a Library for this, or do I just need to declare ResetTimer, etc?

image

I'm not a native english speaker so I'm not sure if I understood everything right.

I try to decribe it in my own word:
You have a device that detecs "earth-leakage" does this mean it is a device that measure "outgoing" and "back-coming" current and if the difference is above a small limit the main supply of your house is shutting off? Such a device is called a RCD Residual Current Device

@the other users: is a earth-leakage the same as a RCD?? If not would a RCD be an option to protect the house?

does "lighting" mean daylight??? if too much light is shining on the eart-leakage device it shuts off?
does "lighting" mean if you switch on a lamp this interferes with your earth leakage-device??
does "lighting" mean lightning the million-voltage "sparks" that run down from the clouds to ground in a thunderstorm?

?????
Does "sparkie" mean a person who (should) have knowledge about how to install mains electric devices and be able to check if something is wrong on the supply-side???

just declare

unsigned long ResetTimer; // variable MUST be of type unsigned long

best regards Stefan

Does this mean your gate can only be opened electrically usually supplied by mains-voltage but has a battery too in case mains-voltage is switched off?

Does this mean there is absolutely no possability to open your gate with a key pure mechanical?

How about installing a small and hidden socket to which you could connect an emergency-battery from outside to make your pure-electric gateopener work again?

Hi Stefan

to best answer your questions

  • I'm from South Africa and on our distribution boards/breaker boards/fuse box (whatever they're called elsewhere, we have a breaker that does detect Neutral to-earth leakage and trips when detected.

Matter of fact I have this exact one QF17C

and yes for those who are about to shout at me, I do have an isolation/overload switch before the earth leakage: https://www.se.com/za/en/product/download-pdf/A9N61522

For the Arduino to know if my house has lost power (Earth Leakage tripped) I will simply use a 12V 2pin PSU connected to a relay which will ground pin 12 and initiate the code.

No, nothing about light but rather "the million-voltage sparks from the thunderstorm"

Correct, we use sparkie as the term for "qualified Electrician"

To answer your question about the gate, yes and yes I deliberately have no access to my motor from the outside in the fear of theft/tampering/burglary

Correction on pure-electric gate opener - it does run on a big 12V 18Ah battery with a 220-12V 10A charger but all batteries go flat during usage (when there is no power to charge it)

I do however like your idea of a concealed socket close to the motor, I will have to figure out another simple relay logic (like an AutoTransferSwitch/ATS) to disconnect the installed battery and apply the current of the emergency battery when connected (If you apply emergency battery to installed battery it too will be drained as they will try balance each others voltages)

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(6, 5, 4, 3, 2, 1);

const int CURRENTRELAY=7; //Power control to Solenoid
const int POLRELAY1=8;    //Polarity changer A
const int POLRELAY2=9;    //Polarity changer B
const int ERRORSIG=13;    //Signal Earth Leakage Error
const int POWER=12;       //Eskom line input

//Key connections with arduino
const int up_key=10;      //Activate the EL Tool
const int down_key=11;    //Deactivate the EL Tool

int SetPoint=0;           //Up/Down key status
int SetPoint2=0;          //Eskom Line input status
int SetPoint3=0;          //Solenoid Counter

unsigned long ResetTimer; // variable MUST be of type unsigned long
int ResetTimerRunning;

//=================================================================
//                  SETUP
//=================================================================


void setup(){
  pinMode(CURRENTRELAY,OUTPUT);
  pinMode(POLRELAY1,OUTPUT);  
  pinMode(POLRELAY2,OUTPUT);  
  pinMode(ERRORSIG,OUTPUT);
  pinMode(up_key,INPUT);
  pinMode(down_key,INPUT);
  
  //Pull up for setpoint keys
  digitalWrite(up_key,HIGH);
  digitalWrite(down_key,HIGH);
  
  
   // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("E/L RESET TOOL");  
  lcd.setCursor(0,1); //Move coursor to second Line
  lcd.print("VER 1.0");
  //lcd.clear();
  //digitalWrite(CURRENTRELAY,LOW);  //Green LED Off
  //digitalWrite(POLRELAY1,LOW);     //Red LED On
  //digitalWrite(POLRELAY2,LOW);       //Turn off Relay
  delay(3000);
}


//=================================================================
//                  LOOP
//=================================================================  


void loop(){
 //Get user input for setpoints  
 if(digitalRead(down_key)==LOW)
 {
  if(SetPoint>0)
  {
   SetPoint--;    
  }
 }
 if(digitalRead(up_key)==LOW)
 {
  if(SetPoint<1)
  {
   SetPoint++;
  }
 }
 
 //MAIN Control
 if(SetPoint3 < 1 || SetPoint2 !=0 || SetPoint != 1)
 {
    // Re-start a timer whenever the condition is false
    ResetTimer = millis();
    ResetTimerRunning = true;
  }
  // If the condition was last false 3600 seconds ago...
  if (ResetTimerRunning && millis() - ResetTimer >= (3600ul * 1000ul))
  {
    // Condition has been true for 3600 seconds.
    SetPoint3 *= 0;
    digitalWrite(ERRORSIG,LOW);
    ResetTimerRunning = false;
  }
 
 
 if(SetPoint3>=6 && SetPoint==1)       //If EarthLeakage has been reset 6 times then shut down
 {
    digitalWrite(CURRENTRELAY,LOW);    //Turn off solenoid
    digitalWrite(POLRELAY1,LOW);       //Turn Polarity changer A off
    digitalWrite(POLRELAY2,LOW);       //Turn Polarity changer B off
    digitalWrite(ERRORSIG,HIGH);       //Turn Alarm output on
    lcd.setCursor(0,0);
    lcd.print("ERROR FAIL ERROR");     //Print message on screen
  }
 
 else if(SetPoint3>5 && SetPoint2==0 && SetPoint==1 /*for>3600sec*/) //If the solenoid counter is maxed and I toggle the system off/on it resets
 {
   SetPoint3*=0;
   digitalWrite(ERRORSIG,LOW);
  }
  else
  {
  if(SetPoint3<6 && SetPoint==1 || SetPoint3<6 && SetPoint==0)
  { 
   //Display Set point on LCD
   lcd.setCursor(0,1);
   lcd.print("SYSTEM:");
   if(SetPoint==1)
   {
    lcd.print("       ON");
   }
   if(SetPoint==0)
   {
    lcd.print("      OFF");
   }
   
   if(digitalRead(POWER)==LOW) //Check if EarthLeakage has tripped
   {
    if(SetPoint2>0)
    {
     SetPoint2--;
    }
    lcd.setCursor(0,0);
    lcd.print("POWER: ");
    lcd.print("FAIL    ");
    lcd.print(SetPoint3);       //Display Solenoid Counter
   }
   
   if(digitalRead(POWER)==HIGH) //Check if EarthLeakage has tripped
   {
    if(SetPoint2<1)
    {
     SetPoint2++;
    }
    lcd.setCursor(0,0);
    lcd.print("POWER: ");    
    lcd.print("ACTIVE  ");   
    lcd.print(SetPoint3);      //Display Solenoid Counter
   } 
   
   //Check if Power is on or off
   if(SetPoint2 > SetPoint)
   {
    digitalWrite(CURRENTRELAY,LOW);    //Turn off solenoid
    digitalWrite(POLRELAY1,LOW);       //Turn Polarity changer A off
    digitalWrite(POLRELAY2,LOW);       //Turn Polarity changer B off
   }
   
   //If Power is off then do the following
   if(SetPoint2 < SetPoint)
   {
    SetPoint3++;
    digitalWrite(CURRENTRELAY,HIGH);    //Turn on solenoid to pull
     delay(500);
    digitalWrite(CURRENTRELAY,LOW);    //Turn off solenoid to release
     delay(500);
    digitalWrite(POLRELAY1,HIGH);       //Switch Polarity A +>-
    digitalWrite(POLRELAY2,HIGH);       //Switch Polarity B ->+
     delay(500);
    digitalWrite(CURRENTRELAY,HIGH);    //Turn on solenoid to push
     delay(500);
    digitalWrite(CURRENTRELAY,LOW);     //Turn off solenoid to release
    digitalWrite(POLRELAY1,LOW);       //Turn Polarity changer A off
    digitalWrite(POLRELAY2,LOW);       //Turn Polarity changer B off
     delay(500);
   }
  } 
 }   
}

I still get a problem with the "for" though, where did I go wrong?

I posted the code and that's all the compiler gives me in the screenshot

In function 'void loop()':
104:53: error: expected ')' before 'for'

avre[0m 1.8.6 e[90m/home/tcad/.arduino15/packages/arduino/hardware/avr/1.8.6e[0m

exit status 1

The tutorial I linked to shows you how you have to adjust the Arduino-IDE to print out all the missing details of the compiler-error

so simply read it!

Apologies, I was on Tinkercad.com
Here is Arduino IDE V1.8.8 compilation

Arduino: 1.8.8 (Windows 7), Board: "Arduino Uno"

C:\Program Files\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\Cameron\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\Cameron\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Cameron\OneDrive\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path C:\Users\Cameron\AppData\Local\Temp\arduino_build_892442 -warnings=all -build-cache C:\Users\Cameron\AppData\Local\Temp\arduino_cache_473640 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino
C:\Program Files\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\Cameron\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\Cameron\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Cameron\OneDrive\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path C:\Users\Cameron\AppData\Local\Temp\arduino_build_892442 -warnings=all -build-cache C:\Users\Cameron\AppData\Local\Temp\arduino_cache_473640 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino
Using board 'uno' from platform in folder: C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Detecting libraries used...
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\sketch\\sketch_dec10a.ino.cpp" -o nul
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\sketch\\sketch_dec10a.ino.cpp" -o nul
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src\\LiquidCrystal.cpp" -o nul
Generating function prototypes...
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\sketch\\sketch_dec10a.ino.cpp" -o "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Program Files\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\sketch\\sketch_dec10a.ino.cpp" -o "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_892442\\sketch\\sketch_dec10a.ino.cpp.o"
C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino: In function 'void loop()':

sketch_dec10a:104:53: error: expected ')' before 'for'

  else if(SetPoint3>5 && SetPoint2==0 && SetPoint==1 for>3600sec) //If the solenoid counter is maxed and I toggle the system off/on it resets

                                                     ^~~

C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino:111:18: warning: suggest parentheses around '&&' within '||' [-Wparentheses]

   if(SetPoint3<6 && SetPoint==1 || SetPoint3<6 && SetPoint==0)

      ~~~~~~~~~~~~^~~~~~~~~~~~~~

Using library LiquidCrystal at version 1.0.7 in folder: C:\Program Files\Arduino\libraries\LiquidCrystal 
exit status 1
expected ')' before 'for'

This line tells you where the error is
line 104 columm 53 is the place where the error occurs
The reason is a missing closing parenthesis above line 104

Correct, so if when I put a closing parenthesis before "for" I then get the following

Perhaps @johnwasser can clarify the "for>3600sec" please?

Arduino: 1.8.8 (Windows 7), Board: "Arduino Uno"

C:\Program Files\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\Cameron\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\Cameron\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Cameron\OneDrive\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path C:\Users\Cameron\AppData\Local\Temp\arduino_build_919726 -warnings=all -build-cache C:\Users\Cameron\AppData\Local\Temp\arduino_cache_503097 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino
C:\Program Files\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\Cameron\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\Cameron\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Cameron\OneDrive\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path C:\Users\Cameron\AppData\Local\Temp\arduino_build_919726 -warnings=all -build-cache C:\Users\Cameron\AppData\Local\Temp\arduino_cache_503097 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino
Using board 'uno' from platform in folder: C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\Cameron\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Detecting libraries used...
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\sketch\\sketch_dec10a.ino.cpp" -o nul
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\sketch\\sketch_dec10a.ino.cpp" -o nul
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src\\LiquidCrystal.cpp" -o nul
Generating function prototypes...
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\sketch\\sketch_dec10a.ino.cpp" -o "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Program Files\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\Cameron\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Program Files\\Arduino\\libraries\\LiquidCrystal\\src" "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\sketch\\sketch_dec10a.ino.cpp" -o "C:\\Users\\Cameron\\AppData\\Local\\Temp\\arduino_build_919726\\sketch\\sketch_dec10a.ino.cpp.o"
C:\Users\Cameron\Desktop\sketch_dec10a\sketch_dec10a.ino: In function 'void loop()':

sketch_dec10a:104:57: error: expected '(' before '>' token

 else if(SetPoint3>5 && SetPoint2==0 && SetPoint==1) for>3600sec) //If the solenoid counter is maxed and I toggle the system off/on it resets

                                                        ^

sketch_dec10a:104:57: error: expected primary-expression before '>' token

sketch_dec10a:104:58: error: unable to find numeric literal operator 'operator""sec'

 else if(SetPoint3>5 && SetPoint2==0 && SetPoint==1) for>3600sec) //If the solenoid counter is maxed and I toggle the system off/on it resets

                                                         ^~~~~~~

sketch_dec10a:109:3: error: expected primary-expression before 'else'

  else

  ^~~~

sketch_dec10a:109:3: error: expected ';' before 'else'

sketch_dec10a:109:3: error: expected primary-expression before 'else'

sketch_dec10a:109:3: error: expected ')' before 'else'

sketch_dec10a:109:3: error: expected primary-expression before 'else'

Using library LiquidCrystal at version 1.0.7 in folder: C:\Program Files\Arduino\libraries\LiquidCrystal 
exit status 1
expected '(' before '>' token

what shall this misterious for > 3600 do???

Describe in normal words! avoid any programming term
You have a misconception about the programming. Using programming-terms would lead to new misunderstandings

as mentioned, perhaps @johnwasser could please clarify the suggested code I use in post #2 as this is where for>3600sec) originates.

@StefanL38 As mentioned in post #1 I would like to set up a 3600 countdown timer that resets SetPoint3 to 0 if I do not physically come and reset SetPoint3 by toggling SetPoint

however, if the timer is active and I come toggle SetPoint then I must still be able to reset SetPoint3 and the 3600 timer myself.

JOhnwasser is quoting you and then posts a suggestion that shall REPLACE the code that he has quoted.
This means in johnwasser's code there is aboslutely no "for > 3600"

Hello Creaper

How many threads do you run in parallel.

I´ve see this code snippest twice somewhere.