Just a thank you.

Just wanted to say thank you to all who answered my questions and/or gave guidance.

@WAWA, @Paul__B, @Larryd, and many others.

attached are pictures of my project… it works great. After many test runs and hours, it works great. I even tested over night.

code

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

// Pins
int TR_PIN = A1;  // Thermistor
int SetPin = A3 ; // Pot
int LED_B = 9;    // PWM capable
int LED_G = 10;   // PWM capable
int LED_R = 11;   // PWM capable
int relayPin = 3; // PWM capable
const byte relaySensor = 4;   //
const byte button = 2;        // toggle switch

// Constants
int SensorTimer = 7000;  // 7  seconds

//Variables
int sensorVal;
int setVal;
int sensorTemp;
int setTemp;
int tempDiffPos;
int tempDiffNeg;
int count;
int sensorCount;
int MainsPollVal;
int MainsPollValA;
bool State;
float realTemp;
float trueTemp;
double a1, b1, c1, d1, r2, r1, vo, tempC, tempF, tempK;

unsigned long TimeNow;
unsigned long LastTime;

void setup() {
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  Serial.begin(9600);

  pinMode(LED_B, OUTPUT);
  pinMode(LED_G, OUTPUT);
  pinMode(LED_R, OUTPUT);
  pinMode(SetPin, INPUT);
  pinMode(relayPin, OUTPUT);
  pinMode(relaySensor, INPUT);
  pinMode(button, INPUT);
  pinMode(TR_PIN, INPUT);

  a1 = 3.354016E-03 ;
  b1 = 2.569850E-04 ;
  c1 = 2.620131E-06 ;
  d1 = 6.383091E-08 ;
  r1 = 9720.0;

  tempDiffPos = 0.00;
  tempDiffNeg = 0.00;
}

// MAIN LOOP
void loop() {

  while ((setTemp == 0) && (digitalRead(button) == LOW)) {
    Start_Up();
  }

  while (digitalRead(button) == HIGH) {
    count = 0;
    MainsPollVal = 0;
    MainsPollValA = 0;
    SetTempVal();
  }

  // show state ture
  if (State == true) {
    lcd.setCursor(0, 1);
    lcd.print("^");
  }

  // check sensor
  TimeNow = millis();
  if (LastTime <= TimeNow - SensorTimer) {
    sensorPoll();
    LastTime = TimeNow;
    Serial.print(State);
  }

  tempDiffPos = (trueTemp - setTemp);
  tempDiffNeg = (setTemp - trueTemp);

  while ((MainsPollVal == 10) || (MainsPollVal - MainsPollValA == 10)) {
    MainsPollValA = MainsPollVal;
    Fault();
    if (digitalRead(button) == HIGH) {
      break;
    }
  }


  // COOLING
  while ((trueTemp - setTemp >= 0) && (State == true)) {
    digitalWrite(relayPin, HIGH);
    // digitalWrite(LED_B, HIGH);
    digitalWrite(LED_G, LOW);
    digitalWrite(LED_R, LOW);
    delay(25);
    Display();
    MainsCheck();
    Fade_Blue();
    // check sensor
    TimeNow = millis();
    if (LastTime <= TimeNow - SensorTimer) {
      sensorPoll();
      LastTime = TimeNow;
      Serial.print(State);
    }
     if (digitalRead(button) == HIGH) {
      break;
    }
    if (setTemp - trueTemp >= 0) {
      digitalWrite(relayPin, LOW);
      MainsPollVal = 0;
      MainsPollValA = 0;
      State = false;
      lcd.clear();
      break;
    }
    if ((MainsPollVal == 10) || (MainsPollVal - MainsPollValA == 10)) {
      MainsPollValA = MainsPollVal;
      Fault();
      break;
    }

  }
  //GOOD TEMP
  while ((((setTemp - trueTemp > 0) && (setTemp - trueTemp < 1.75)) || ((trueTemp - setTemp > 0) && (trueTemp - setTemp < 1.75))) && (State == false))  {
    // digitalWrite(LED_G, HIGH);
    digitalWrite(LED_B, LOW);
    digitalWrite(LED_R, LOW);
    digitalWrite(relayPin, LOW);
    Display();
    Fade_Green();
    // check sensor
    TimeNow = millis();
    if (LastTime <= TimeNow - SensorTimer) {
      sensorPoll();
      LastTime = TimeNow;
      Serial.print(State);
    }
     if (digitalRead(button) == HIGH) {
      break;
    }
    if (trueTemp - setTemp > 1.6) {
      State = true;
      break;
    }
  }

  // HIGH SET TEMP
  if (setTemp - trueTemp > 1.75) {
    // digitalWrite(LED_R, HIGH);
    digitalWrite(LED_B, LOW);
    digitalWrite(LED_G, LOW);
    digitalWrite(relayPin, LOW);
    // State = false;
    Fade_Red();
  }
}
//StartUP
void Start_Up() {
  lcd.setCursor(0, 0);
  lcd.print(" !  Mmmmmmmm  ! ");
  lcd.setCursor(0, 1);
  lcd.print("  KOEL'D  BEER  ");
  digitalWrite(relayPin, LOW);
  analogWrite(LED_B, random(10, 255));
  delay(50);
  analogWrite(LED_G, random(10, 255));
  delay(50);
  analogWrite(LED_R, random(10, 255));
  delay(50);
}
// TEMP SENSOR VALUE
// read temp sensor and return temp value
int sensorPoll() {
  // READ REAL TEMP
  sensorCount++;
  vo = analogRead(TR_PIN);
  vo = vo / (1023.0 / 5.0);

  // voltage divider calculation
  // vo = 5 * r2 /(r1+r2)
  // solve for r2
  // get the exact value for voltage divider r1

  r2 = ( vo * 7840) / (5.0 - vo);

  //equation from data sheet
  tempK = 1.0 / (a1 + (b1 * (log(r2 / 32500))) + (c1 * pow(log(r2 / 20040), 2.0)) + (d1 * pow(log(r2 / 11210), 3.0)));
  tempC  = (tempK - 273.15);
  tempF  = ((tempC * 1.8) + 32.0) * 10;
  realTemp = map(tempF, 1350, 860, 350, 740);
  trueTemp = realTemp / 10;
  return trueTemp;
}
// SET TEMPURATURE
// read potentiometer for setting temperature
int SetTempVal() {
  lcd.setCursor(0, 0);
  lcd.print("  KOEL'D  BEER  ");
  lcd.setCursor(0, 1);
  lcd.print(" SET TEMP     ");
  setVal = analogRead(SetPin);
  setTemp = map (setVal, 2.0, 880.0, 28.0, 80.0);   // change 120 to 80
  lcd.setCursor(14, 1);
  lcd.print(setTemp);
  delay(100);
  State = true;
  return setTemp;
}
//LED FADE
void Fade_Blue() {
  for (int b = 15; b <= 255; b++) {
    analogWrite(LED_B, b);
    delay(5);
  }
  for (int b = 255; b >= 15; b--) {
    analogWrite(LED_B, b);
    delay(5);
  }
}
void Fade_Green() {
  for (int g = 15; g <= 255; g++) {
    analogWrite(LED_G, g);
    delay(5);
  }
  for (int g = 255; g >= 15; g--) {
    analogWrite(LED_G, g);
    delay(5);
  }
}
void Fade_Red() {
  for (int r = 15; r <= 255; r++) {
    analogWrite(LED_R, r);
    delay(5);
  }
  for (int r = 255; r >= 15; r--) {
    analogWrite(LED_R, r);
    delay(5);
  }
}
// CHECK MAINS SENSOR
// check mains voltage sensor for voltage
int MainsCheck() {
  if (digitalRead(relaySensor) == LOW) {
    digitalWrite(relayPin, HIGH);
    MainsPollVal++;
    delay(20);
    return MainsPollVal;
  }
}
//FAULT
void Fault() {
  digitalWrite(LED_B,LOW);
  lcd.setCursor(0, 0);
  lcd.print("     SYSTEM     ");
  lcd.setCursor(0, 1);
  lcd.print("     FAULT!     ");
  digitalWrite(LED_R, HIGH);
  delay(500);
  digitalWrite(LED_R, LOW);
  delay(500);
}

void Display() {
  lcd.setCursor(0, 0);
  lcd.print("SENSOR      ");
  lcd.setCursor(12, 0);
  lcd.print(trueTemp);
  lcd.setCursor(1, 1);
  lcd.print("  SET        ");
  lcd.setCursor(14, 1);
  lcd.print(setTemp);
  // show state ture
  if (State == true) {
    lcd.setCursor(0, 1);
    lcd.print("^");
  }
}