Button problems with industrial pipeline washer timer

I'm attempting to create a timer for a pipeline washer in a dairy barn, it's very similar to the way a washing machine would be. The code just controls a set of relays that operate hot and cold water solenoid, drain plug and vacuum pump. For the most part the code is functional and does what i need it too, but i need it to start at the push of a button and now i just have it looping. I've spent a lot of time trying to figure out what im doing wrong but i haven't made much success. I'm rather new to Arduino so the codes pretty messing but i would appreciate any help i can get.
I tried making the cycle code in a separate void and only had the push button info in the loop but i couldn't get that to work either. Thanks in advance!

Washer_timer_sketch.ino (10.9 KB)

/* ------------------------------------------------------------------------------- */
// character LCD example code
// www.hacktronics.com

#include <LiquidCrystal.h>

// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

 int backLight = 13;    // pin 13 will control the backlight
 const int buttonPin = A0;  // input pin for pushbutton
 const int buttonPin2 = A1;
int previousButtonState = HIGH;   // for checking the state of a pushButton

 

#define RELAY1  6   //Controles vacum pump                     
#define RELAY2  7   //Controles Drain plug                     
#define RELAY3  8   //Controles Hot solenoid #1
#define RELAY4  9   //Controles Hot solenoid #2
#define RELAY5  1   //Controles Cold solenoid #1                    
#define RELAY6  0   //Controles Cold solenoid #2                     
#define RELAY7  8
#define RELAY8  9 
#define goButton A1
#define stopButton A3

void setup()
{
 
  // Initialise the Arduino data pins for OUTPUT
  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(goButton, INPUT);
  digitalWrite(goButton, HIGH);  // activate internal pull-up resistor for this input pin  
  pinMode(stopButton, INPUT);
  digitalWrite(stopButton, HIGH);
 
   digitalWrite(RELAY1,HIGH);          // Turns Relay Off
   digitalWrite(RELAY2,HIGH);          // Turns Relay Off
   digitalWrite(RELAY3,HIGH);          // Turns Relay Off
   digitalWrite(RELAY4,HIGH);          // Turns Relay Off 
   digitalWrite(RELAY5,HIGH);          // Turns Relay Off
   digitalWrite(RELAY6,HIGH);          // Turns Relay Off  
   digitalWrite(RELAY7,HIGH);          // Turns Relay Off  
   digitalWrite(RELAY8,HIGH);          // Turns Relay Off 
  
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("The 182 Washer Timer");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("By Brandon Myers");
  
  delay(2000);                                      // Wait 2 seconds
}

void loop()
{

 // read the pushbutton:
  int buttonState = digitalRead(buttonPin);
  // if the button state has changed, 
  if ((buttonState != previousButtonState) 
    // and it's currently pressed:
  && (buttonState == LOW)) {
   

   
   
  // if you have a 4 row LCD, uncomment these lines to write to the bottom rows
  // and change the lcd.begin() statement above.
  //lcd.setCursor(0,2);         // set cursor to column 0, row 2
  //lcd.print("Row 3");
  //lcd.setCursor(0,3);         // set cursor to column 0, row 3
  //lcd.print("Row 4");
  
      //Rinse cycle:
      
       lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Rinse Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Initializing");
 //Controles Drain plug
       digitalWrite(RELAY2,LOW);           // Turns ON Relays 2
      
    
    //Controles Hot solenoid #1
   digitalWrite(RELAY3,LOW);           // Turns ON Relays 3
 
   //Controles Cold solenoid #1
   digitalWrite(RELAY5,LOW);           // Turns ON Relays 5
  
   delay(145000);                                      // Wait 1:45 m/seconds
   digitalWrite(RELAY5,HIGH);          // Turns Relay Off
   digitalWrite(RELAY3,HIGH);          // Turns Relay Off

   delay(2000);                                      // Wait 2 seconds
   
          lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Rinse Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Runing"); 
      
   //Controles vacum pump
   digitalWrite(RELAY1,LOW);           // Turns ON Relays 1
   delay(620000);                                      // Wait 6:20 m/seconds
 
  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Air Cycle");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("And Drain sequince"); 
 
  digitalWrite(RELAY2,HIGH);          // Turns Relay Off
  delay(110000);                                      // Wait 1:00 m/seconds
  digitalWrite(RELAY1,HIGH);          // Turns Relay Off
  
  delay(5000);                                      // Wait 5 seconds
    
      lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Wash Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Initializing"); 
      
        //Wash cycle:
      
       lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Wash Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Initializing"); 
      
      
      //Controles Drain plug
       digitalWrite(RELAY2,LOW);           // Turns ON Relays 2
      
    
      //Controles Hot solenoid #2
   digitalWrite(RELAY4,LOW);           // Turns ON Relays 4
 
   delay(145000);                                      // Wait 1:45 m/seconds
   digitalWrite(RELAY4,HIGH);          // Turns Relay Off

   delay(2000);                                      // Wait 2 seconds
   
          lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Wash Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Runing"); 
      
   //Controles vacum pump
   digitalWrite(RELAY1,LOW);           // Turns ON Relays 1
   delay(620000);                                      // Wait 6:20 m/seconds
 
  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Air Cycle");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("And Drain sequince"); 
 
  digitalWrite(RELAY2,HIGH);          // Turns Relay Off
  delay(110000);                                      // Wait 1:00 m/seconds
  digitalWrite(RELAY1,HIGH);          // Turns Relay Off
  
  delay(5000);                                      // Wait 5 seconds
    
      lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Acid Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Initializing"); 
      
           //Acid cycle:
      
       lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Wash Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Initializing"); 
      
      
      //Controles Drain plug
       digitalWrite(RELAY2,LOW);           // Turns ON Relays 2
      
    
       //Controles Cold solenoid #2
   digitalWrite(RELAY6,LOW);           // Turns ON Relays 6

 
   delay(145000);                                      // Wait 1:45 m/seconds
   digitalWrite(RELAY6,HIGH);          // Turns Relay Off

   delay(2000);                                      // Wait 2 seconds
   
          lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
      lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
      lcd.print("Acid Cycle ");    // change this text to whatever you like. keep it clean.
      lcd.setCursor(0,1);           // set cursor to column 0, row 1
      lcd.print("Runing"); 
      
   //Controles vacum pump
   digitalWrite(RELAY1,LOW);           // Turns ON Relays 1
   delay(620000);                                      // Wait 6:20 m/seconds
 
  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Air Cycle");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("And Drain sequince"); 
 
  digitalWrite(RELAY2,HIGH);          // Turns Relay Off
  delay(110000);                                      // Wait 1:00 m/seconds
  digitalWrite(RELAY1,HIGH);          // Turns Relay Off
  
    lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Cycle");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("Has Fineshed"); 
 }}

sorry for the complicated posting, it wouldn't let me post all this at once.

See this

 lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Air Cycle");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("And Drain sequince");

it's repeated a dozen times with no difference but the strings, make a function that does this and reduce your code by a 1000 lines, then it will be easier to read and therefore easier to debug. Cut and paste should be banned from programming editors :slight_smile:

Also I don't think it's necessary to lcd.begin() all the time, I've not used the lcd lib but I would think a single call in setup() would suffice.

And put it in CODE tags as I just did.


Rob

Thanks Rob, at one point i had it as a function but then reverted back to this when it didn't work correctly. Once i get it re-implemented into a function how do i get the push button to properly execute it?

Brandon

With all that code I couldn't see the wood for the trees so I did some refactoring and got rid of most of the obvious comments.

/* ------------------------------------------------------------------------------- */
// character LCD example code
// www.hacktronics.com

#include <LiquidCrystal.h>

// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);


int backLight = 13;    // pin 13 will control the backlight
const int buttonPin = A0;  // input pin for pushbutton
const int buttonPin2 = A1;
int previousButtonState = HIGH;   // for checking the state of a pushButton



#define VACUUM_PUMP  		6   //Controles vacum pump                     
#define DRAIN_PLUG  		7   //Controles Drain plug                     
#define HOT_SOLENOID_1  	8   //Controles Hot solenoid #1
#define HOT_SOLENOID_2  	9   //Controles Hot solenoid #2
#define COLD_SOLENOID_1  	1   //Controles Cold solenoid #1                    
#define COLD_SOLENOID_2  	0   //Controles Cold solenoid #2                     
#define RELAY7  8
#define RELAY8  9 
#define goButton A1
#define stopButton A3

#define OFF	HIGH
#define ON	LOW

int relay_pins[] =  {
  VACUUM_PUMP,DRAIN_PLUG,HOT_SOLENOID_1,HOT_SOLENOID_2,COLD_SOLENOID_1,COLD_SOLENOID_2,RELAY7,RELAY8};

const int N_RELAYS = sizeof(relay_pins) / sizeof(int);

void setup()
{

  // Initialise the Arduino data pins for OUTPUT

  for (int i = 0; i < N_RELAYS; i++) {
    pinMode(relay_pins[i], OUTPUT);       
  }

  pinMode(goButton, INPUT);
  digitalWrite(goButton, HIGH);  // activate internal pull-up resistor for this input pin  
  pinMode(stopButton, INPUT);
  digitalWrite(stopButton, HIGH);

  for (int i = 0; i < N_RELAYS; i++) {
    digitalWrite(relay_pins[i],HIGH);   
  }

  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.

  lcdFunc ("The 182 Washer Timer","By Brandon Myers");

  delay(2000);                                      // Wait 2 seconds
}

void loop() {

  int buttonState = digitalRead(buttonPin);			// read the pushbutton:

  // if the button state has changed, and it's currently pressed:
  if ((buttonState != previousButtonState) && (buttonState == LOW)) {

    previousButtonState = buttonState;

    doCycle();

  }
}

void doCycle () {

  lcdFunc("Rinse Cycle ", "Initializing");

  digitalWrite(DRAIN_PLUG,ON);   			   
  digitalWrite(HOT_SOLENOID_1,ON);         
  digitalWrite(COLD_SOLENOID_1,ON);        
  delay(145000);                                      // Wait 1:45 m/seconds

  digitalWrite(COLD_SOLENOID_1,OFF);      
  digitalWrite(HOT_SOLENOID_1,OFF);     
  delay(2000);  

  lcdFunc("Rinse Cycle ", "Runing");
  digitalWrite(VACUUM_PUMP,ON);     
  delay(620000);                                      // Wait 6:20 m/seconds

  lcdFunc("Air Cycle", "And Drain sequince");
  digitalWrite(DRAIN_PLUG,OFF);      
  delay(110000);                                 // Wait 1:00 m/seconds
  digitalWrite(VACUUM_PUMP,OFF);         
  delay(5000);                                      // Wait 5 seconds

  //Wash cycle:
  lcdFunc("Wash Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON);      
  digitalWrite(HOT_SOLENOID_2,ON);   
  delay(145000);                                      // Wait 1:45 m/seconds

  digitalWrite(HOT_SOLENOID_2,OFF);         
  delay(2000);                                    

  lcdFunc("Wash Cycle", "Runing");

  digitalWrite(VACUUM_PUMP,ON);         
  delay(620000);                                      // Wait 6:20 m/seconds

  lcdFunc("Air Cycle", "And Drain sequince");
  digitalWrite(DRAIN_PLUG,OFF);        
  delay(110000);                                      // Wait 1:00 m/seconds
  digitalWrite(VACUUM_PUMP,OFF);       
  delay(5000);                                      // Wait 5 seconds

  //Acid cycle:
  lcdFunc("Acid Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON);        
  digitalWrite(COLD_SOLENOID_2,ON);       
  delay(145000);                                      // Wait 1:45 m/seconds

  digitalWrite(COLD_SOLENOID_2,OFF);          // Turns Relay Off
  delay(2000);                                      // Wait 2 seconds

  lcdFunc("Acid Cycle", "Runing");
  digitalWrite(VACUUM_PUMP,ON);         
  delay(620000);                                      // Wait 6:20 m/seconds

  lcdFunc("Air Cycle", "And Drain sequince");
  digitalWrite(DRAIN_PLUG,OFF);       
  delay(110000);                                      // Wait 1:00 m/seconds
  digitalWrite(VACUUM_PUMP,OFF);       

  lcdFunc("Cycle", "Has Fineshed");

}	

void lcdFunc(char * str1, char * str2) {
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print(str1);    			// change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print(str2); 
}

Then some things became obvious, like you were printing the wash cycle twice etc but that's not a show stopper.

One problem was that you never updated previousButtonState after you detected a pressed button. I think this would have manifested as you never being about to get a second run of the cycle, was that the problem?

Anyway now that there's a single line in the conditional part of the loop it's easy to print out something to see if that works, then move on to the next problem.

doCycle() is still pretty bad, a table-driven loop would be much better but as a new programmer that would not help I think.

BTW, for testing this sort of thing it's often better to have a define like

#define SEC 1000

then use

delay(SEC * 2);

Now you can change the definition of SEC to say 100 and the code runs 10 times faster.


Rob

brandon-182:
sorry for the complicated posting, it wouldn't let me post all this at once.

Make an attachment.

How to use this forum

WOW Rob! Thank you, you have no idea how much that helped me!

/* ------------------------------------------------------------------------------- */
#include <LiquidCrystal.h>
// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

int backLight = 13;    // pin 13 will control the backlight
const int buttonPin = A0;  // input pin for pushbutton
const int buttonPin2 = A1;
int previousButtonState = HIGH;   // for checking the state of a pushButton

#define VACUUM_PUMP  		6   //Controles vacum pump                     
#define DRAIN_PLUG  		7   //Controles Drain plug                     
#define HOT_SOLENOID_1  	8   //Controles Hot solenoid #1
#define HOT_SOLENOID_2  	9   //Controles Hot solenoid #2
#define COLD_SOLENOID_1  	1   //Controles Cold solenoid #1                    
#define COLD_SOLENOID_2  	0   //Controles Cold solenoid #2                     
#define RELAY7  8
#define RELAY8  9 
#define goButton A1
#define stopButton A3

#define OFF	HIGH
#define ON	LOW

#define SEC 1000

int relay_pins[] =  {
  VACUUM_PUMP,DRAIN_PLUG,HOT_SOLENOID_1,HOT_SOLENOID_2,COLD_SOLENOID_1,COLD_SOLENOID_2,RELAY7,RELAY8};

const int N_RELAYS = sizeof(relay_pins) / sizeof(int);

void setup()
{
  for (int i = 0; i < N_RELAYS; i++) {
    pinMode(relay_pins[i], OUTPUT);       
  }
  pinMode(goButton, INPUT);
  digitalWrite(goButton, HIGH);  // activate internal pull-up resistor for this input pin  
  pinMode(stopButton, INPUT);
  digitalWrite(stopButton, HIGH);

  for (int i = 0; i < N_RELAYS; i++) {
    digitalWrite(relay_pins[i],HIGH);   
  }

  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.

  lcdFunc ("The 182 Washer Timer","By Brandon Myers");

  delay(SEC*2);                                      // Wait 2 seconds
}
void loop(){
  
  int buttonState = digitalRead(buttonPin);			// read the pushbutton:

  // if the button state has changed, and it's currently pressed:
  if ((buttonState != previousButtonState) && (buttonState == LOW)) {

    previousButtonState = buttonState;

  rinse();
  drain();
  wash();
  drain();
  acid();
  drain();
  lcdFunc("Cycle", "Has Fineshed");
  }
}
void rinse(){

//Rinse cycle:
      
   lcdFunc("Rinse Cycle ", "Initializing");
      
  digitalWrite(DRAIN_PLUG,ON);   			   
  digitalWrite(HOT_SOLENOID_1,ON);         
  digitalWrite(COLD_SOLENOID_1,ON); 
  
  delay(SEC*145);                                      // Wait 1:45 m/seconds

  digitalWrite(COLD_SOLENOID_1,OFF);      
  digitalWrite(HOT_SOLENOID_1,OFF);
  
  delay(SEC*2);  

  lcdFunc("Rinse Cycle ", "Runing");
  digitalWrite(VACUUM_PUMP,ON); 
  
  delay(SEC*620);                                      // Wait 6:20 m/seconds
}
void drain(){
  
 lcdFunc("Air Cycle", "And Drain sequince");
  digitalWrite(DRAIN_PLUG,OFF);      
  delay(SEC*110);                                 // Wait 1:00 m/seconds
  digitalWrite(VACUUM_PUMP,OFF);         
  delay(SEC*5);                                      // Wait 5 seconds
}  

void wash(){
  //Wash cycle:
     lcdFunc("Wash Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON);      
  digitalWrite(HOT_SOLENOID_2,ON);   
  delay(SEC*145);                                      // Wait 1:45 m/seconds

  digitalWrite(HOT_SOLENOID_2,OFF);         
  delay(SEC*2);                                    

  lcdFunc("Wash Cycle", "Runing");

  digitalWrite(VACUUM_PUMP,ON);         
  delay(SEC*620);                                      // Wait 6:20 m/seconds

}
void acid(){
   //Acid cycle:
  lcdFunc("Acid Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON);        
  digitalWrite(COLD_SOLENOID_2,ON);       
  delay(SEC*145);                                      // Wait 1:45 m/seconds

  digitalWrite(COLD_SOLENOID_2,OFF);          // Turns Relay Off
  delay(SEC*2);                                      // Wait 2 seconds

  lcdFunc("Acid Cycle", "Runing");
  digitalWrite(VACUUM_PUMP,ON);         
  delay(SEC*4200);                                      // Wait 4:20 m/seconds
  
   lcdFunc("Air Cycle", "And Drain sequince");
  digitalWrite(DRAIN_PLUG,OFF);       
  delay(SEC*100);                                      // Wait 1:00 m/seconds
  digitalWrite(VACUUM_PUMP,OFF);       
}

void lcdFunc(char * str1, char * str2) {
  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print(str1);    			// change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print(str2); 
}

/* ------------------------------------------------------------------------------- */

That's what i have now. I was noticing some of my simple errs too right after i posed that last one. I think I made all the changes you suggested, i did have to add lcd.begain for it to format correctly and when i changed the time delays it now nearly skips the rinse fill (Or initialization) maybe i just implemented it wrong. Some of the delays will later be replaced with a level sensor for the water, but i was going to leave that out till the end. For the button it still just takes off on its own (it's not waiting for the button to be pressed). i'll try to read through the link tomorrow that Nick posted, it looks like it might contain some answers.

Try putting an L suffix on your SEC definition:

#define SEC 1000L

Many of your delays are too big to fit in an int - that may be what's causing the misbehavior.

Hey guys thanks again for all the help, currently everything is working just the way i wanted it to including the buttons and the level sensor for the water. Thanks a bunch, if there's anything in the latest code that could be improved don't hesitate to comment.

/* ------------------------------------------------------------------------------- */
#include <LiquidCrystal.h>
// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);


int backLight = 13;    // pin 13 will control the backlight


#define VACUUM_PUMP  		6   //Controles vacum pump                     
#define DRAIN_PLUG  		7   //Controles Drain plug                     
#define HOT_SOLENOID_1  	8   //Controles Hot solenoid #1
#define HOT_SOLENOID_2  	9   //Controles Hot solenoid #2
#define COLD_SOLENOID_1  	1   //Controles Cold solenoid #1                    
#define COLD_SOLENOID_2  	0   //Controles Cold solenoid #2                     
#define RELAY7  8
#define RELAY8  9 

#define goButton A4
#define goButton2 A3
#define fillButton A5

#define OFF	HIGH
#define ON	LOW

#define SEC 1000L

int relay_pins[] =  {
  VACUUM_PUMP,DRAIN_PLUG,HOT_SOLENOID_1,HOT_SOLENOID_2,COLD_SOLENOID_1,COLD_SOLENOID_2,RELAY7,RELAY8};

const int N_RELAYS = sizeof(relay_pins) / sizeof(int);

void setup()
{
  for (int i = 0; i < N_RELAYS; i++) {
    pinMode(relay_pins[i], OUTPUT);       
  }
  pinMode (goButton, INPUT);
  digitalWrite(goButton, HIGH);
  pinMode(goButton2, INPUT);
  digitalWrite(goButton2, HIGH);
  pinMode (fillButton, INPUT);
  digitalWrite(fillButton, HIGH);
  
  for (int i = 0; i < N_RELAYS; i++) {
    digitalWrite(relay_pins[i],HIGH);   
  }

  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.

  lcdFunc ("The 182 Washer Timer","By Brandon Myers");

  delay(SEC*2);                                      // Wait 2 seconds
}
void loop(){
  
 
    if (!digitalRead(goButton)){ 
  rinse();
  drain();
  wash();
  drain();
  acid();
  drain();
  lcdFunc("Wash Cycle", "Has Finished");}
  
  if (!digitalRead(goButton2)){ Sanitizer();
  drain(); lcdFunc("Sanitizer Cycle", "Has Finished"); }
 
}

void rinse(){

//Rinse cycle:
      
   lcdFunc("Rinse Cycle ", "Initializing");
      
  digitalWrite(DRAIN_PLUG,ON); 
  delay(SEC*3);   			   
  digitalWrite(HOT_SOLENOID_1,ON);         
  digitalWrite(COLD_SOLENOID_1,ON); 
  
  while (digitalRead(fillButton) != LOW) { } // do nothing{                                  
    if(digitalRead(fillButton) != HIGH) {    //wait for fill sensor                                  

     digitalWrite(COLD_SOLENOID_1,OFF);      
     digitalWrite(HOT_SOLENOID_1,OFF);
  
     delay(SEC*2);  

     lcdFunc("Rinse Cycle ", "Runing");
     digitalWrite(VACUUM_PUMP,ON); 
  
     delay(SEC*252);                    // Wait 4:20 m/seconds
     digitalWrite(DRAIN_PLUG,OFF);  
     delay(SEC*2);      
     digitalWrite(VACUUM_PUMP,OFF);   
   }                                    
}
void drain(){
 delay(SEC*20); 
 lcdFunc("Air Cycle", "And Drain sequince");
  digitalWrite(DRAIN_PLUG,OFF);      
  delay(SEC*100); 
  // Wait 1:00 m/seconds
  digitalWrite(VACUUM_PUMP,OFF);         
  delay(SEC*5);                                      // Wait 5 seconds
}  

void wash(){
  //Wash cycle:
     lcdFunc("Wash Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON);  
  delay(SEC*3);     
  digitalWrite(HOT_SOLENOID_2,ON);   
    while (digitalRead(fillButton) != LOW) { } // do nothing{                                  
    if(digitalRead(fillButton) != HIGH) {       //wait for fill sensor                          

     digitalWrite(HOT_SOLENOID_2,OFF);         
     delay(SEC*2);                                    

     lcdFunc("Wash Cycle", "Runing");

     digitalWrite(VACUUM_PUMP,ON);         
     delay(SEC*372); 
 
     digitalWrite(DRAIN_PLUG,OFF);  
     delay(SEC*10);      
     digitalWrite(VACUUM_PUMP,OFF);      
    }  // Wait 6:20 m/seconds

}
void acid(){
   //Acid rinse cycle:
  lcdFunc("Acid Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON); 
  delay(SEC*3);     
  digitalWrite(COLD_SOLENOID_2,ON); 
  
  while (digitalRead(fillButton) != LOW) { } // do nothing{                                  
    if(digitalRead(fillButton) != HIGH) {     //wait for fill sensor 
     digitalWrite(COLD_SOLENOID_2,OFF);          // Turns Relay Off
     delay(SEC*2);                                      // Wait 2 seconds

     lcdFunc("Acid Cycle", "Runing");
     digitalWrite(VACUUM_PUMP,ON);         
     delay(SEC*252);                                      // Wait 4:20 m/seconds
  
     
     digitalWrite(DRAIN_PLUG,OFF);  
     delay(SEC*2);      
     digitalWrite(VACUUM_PUMP,OFF);    
  }  
  
}
void Sanitizer(){
   //Sanitizer cycle:
  lcdFunc("Sanitize Cycle", "Initializing");
  digitalWrite(DRAIN_PLUG,ON); 
  delay(SEC*3);     
  digitalWrite(COLD_SOLENOID_2,ON); 
  
  while (digitalRead(fillButton) != LOW) { } // do nothing{                                  
    if(digitalRead(fillButton) != HIGH) {     //wait for fill sensor 
     digitalWrite(COLD_SOLENOID_2,OFF);          // Turns Relay Off
     delay(SEC*2);                                      // Wait 2 seconds

     lcdFunc("Sanitize Cycle", "Runing");
     digitalWrite(VACUUM_PUMP,ON);         
     delay(SEC*252);                                      // Wait 4:20 m/seconds
  
     
     digitalWrite(DRAIN_PLUG,OFF);  
     delay(SEC*2);      
     digitalWrite(VACUUM_PUMP,OFF);    
  }  
  
}

void lcdFunc(char * str1, char * str2) {
  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print(str1);    			// change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print(str2); 
}

/* ------------------------------------------------------------------------------- */

What do RELAY7 and RELAY8 do? They're set high in setup but after that, there's nothing more done with them.