EcoRenovator  

Go Back   EcoRenovator > Improvements > Geothermal & Heat Pumps
Advanced Search
 


Blog 60+ Home Energy Saving Tips Recent Posts


 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 08-17-14, 06:04 PM   #11
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

A/C I can barely remember my name at 72

I'm gonna be gone for about 12 days. Son is getting married.

This code is not debugged. I think that LCD feedback will help.

Rev06
Code:
void loop() 
{
  readTemps();
  
  if (SKIP_FLOW_BOOL == false)    readFlows();
  
  demand = digitalRead(demandPin);
  
  demand = HIGH;  //debug

  unsigned long current_Time = millis();
    
  T1 =   current_Time;

  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("curr_Time = "));
  lcd.setCursor(0,1);
  lcd.print(current_Time);
  delay(5000);        //Delay 5 sec 
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("wait_Time = "));
  lcd.setCursor(0,1);
  lcd.print(wait_Time);
  delay(5000);        //Delay 5 sec 
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("wait_Time+2min= "));
  lcd.setCursor(0,1);
  lcd.print((wait_Time + Two_Min));
  delay(5000);        //Delay 5 sec 
 
 
     
  if (demand == true) 
  {   
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("demand=true"));
  lcd.setCursor(0,1);
  lcd.print(F("WAIT 2 MIN"));
  delay(5000);        //Delay 5 sec 
  }
  
  if ((demand == true) 
     && (current_Time >= (wait_Time + Two_Min)))  //Wait 2 min.
  { 
    
  if (runHP == false) hpStart_Time = current_Time;
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("hpStart_Time = "));
  lcd.setCursor(0,1);
  lcd.print(hpStart_Time);
  delay(5000);        //Delay 5 sec 
  
  
  runHP = true; 
      
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runHP = true"));
  delay(5000);        //Delay 5 sec      
      
  }
  
  else 
  {
  if (runHP == true) 
  {
    
  hpStop_Time = current_Time;
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("hpStop_Time = "));
  lcd.setCursor(0,1);
  lcd.print(hpStop_Time);
  delay(5000);        //Delay 5 sec 

  
  runHP = false;
      
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runHP = false"));
  delay(5000);        //Delay 5 sec      
      
  }
  }


  //*****HP startup cycle********
  if (runHP == true) 
  {
  runInPump = true;
    
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runInPump = true"));
  delay(5000);        //Delay 5 sec      
  }
  
  if ((runHP == true) 
     && (current_Time >= (hpStart_Time + Half_Min)))  //Wait 1/2 min comp start
  { 
    
  if (SKIP_FLOW_BOOL == false)
  {   
  if (HpLPM > minLPM)  runCompressor = true;
  }
  else runCompressor = true;
  }

    
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runComp = true"));
  delay(5000);        //Delay 5 sec      
      

  
  if ((runHP == true) 
     && (current_Time >= (hpStart_Time + One_Min)))  //Wait 1 min
  {
  runOutPump = true;           //Delay out pump start 60s after starting in pump
  ledState = true;             ///turn on pin 13 led after startup of HP
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runOutPump=true"));
  lcd.setCursor(0,1);
  lcd.print(F("ledState=true"));
  delay(5000);        //Delay 5 sec             
  }
 
 
  
  //*****HP shutdown cycle********
  if (runHP == false) 
  {
  runCompressor = false;
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runComp=OFF"));
  delay(5000);        //Delay 5 sec 
  } 
  
  if ((runHP == false) 
     && (current_Time >= (hpStop_Time + Two_Min)))  //Wait 2 min
  {
  runInPump = false;
   
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runInPump=OFF"));
  delay(5000);        //Delay 5 sec 
  }
      
  if ((runHP == false) 
     && (current_Time >= (hpStop_Time + Five_Min)))  //Wait 5 min  
  {
  runOutPump = false;
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("runOutPump=OFF"));
  delay(5000);        //Delay 5 sec 
  }
 
  
  wait_Time = current_Time;
     
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("wait_Time = "));
  lcd.setCursor(0,1);
  lcd.print(wait_Time);
  delay(5000);        //Delay 5 sec 
        
  ledState = false;               //turn off pin 13 led after shutdown of HP
  
 
 
  if (SKIP_FLOW_BOOL == false)
  {
  //***Check flow rates above min***
  if (HpLPM < minLPM || HpLPM1 < minLPM) 
  {
  runCompressor = false;
  
  if (runHP == true) hpStop_Time = current_Time;
  
  wait_Time = (current_Time + Ten_Min); //prevent cycle restart for 10m
  runHP = false;
  }
  }


 //***Check evaporator/condensor above/below limits*** 
 //   not intended for defrost purposes, halts system for 30m
  if (evap_Temp < minEv || cond_Temp > maxCon) 
  {
  runCompressor = false;
  
  if (runHP == true) hpStop_Time = current_Time;
  
  wait_Time = (current_Time + Thirty_Min); //prevent cycle restart for 30m
  runHP = false;
  }
    
  
  digitalWrite(led, ledState);
  digitalWrite(comp, runCompressor);
  digitalWrite(inPump, runInPump);
  digitalWrite(outPump, runOutPump);


  T2 = millis();

  TT = T2 - T1;
  
  lcd.clear();
  lcd.home (); // go home
  lcd.print(TT);    // 5 sec
  delay(5000); 
  
  
}


Last edited by buffalobillpatrick; 08-17-14 at 06:07 PM..
buffalobillpatrick is offline   Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design