EcoRenovator  

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


Blog 60+ Home Energy Saving Tips Recent Posts


Reply
 
Thread Tools Display Modes
Old 08-16-14, 03:31 PM   #211
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

Quote:
Originally Posted by Ormston View Post
AC

A is 22mm copper pipe (metric equivalent or 3/4 though not sure how close in size they are), it sits inside B/C with an olive as a seal(compression fitting).
Known as a 3/4 female iron.
BSP - F/I - Female Iron - Straight Compression Fitting | eBay
Thanks for the information.

Since my last post, I went to a local hardware store and looked through all their related stuff and it looks like if I had chosen 3/4", there are several adapters that could work for 3/4".

I also went through a bin of "discontinued parts" and found some parts with compatible threads that could be made to work after some medium-grade creative repurposement. I got about a half-dozen for $2.40, for testing.

It looks like the company you pointed out ships everywhere except the US. I think that for the cost of those fittings, after adjustment for exchange rates, & shipping (however that could be made to happen), I'd be better off buying 3/4" sensors and using some adapters that are locally available.

But thanks for looking for that information.

Best,

-AC

__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
The Following User Says Thank You to AC_Hacker For This Useful Post:
buffalobillpatrick (08-16-14)
Old 08-16-14, 04:59 PM   #212
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

I'm down in spirit, found out that in Teller County Colorado Building Code & Inspectors
require Engineers Stamp & Building permits for all Solar & Heat Pump systems.

I could never get approval for my DIY Heat Pump.
Thus it will have to be added "off the record" after getting "Certificate of Occupancy" for house.

My DIY Heat Pump & Solar hot water system will reside in my 2,000ft2 steel building/garage about 75' from house.

I will only have 2 water pipes (condenser flow) & wires between the 2 buildings.
Pipes will be 3/4" O2 barrier PEX very well insulated inside 4" ABS pipe burried about 4' below grade.

Last edited by buffalobillpatrick; 08-16-14 at 05:08 PM..
buffalobillpatrick is offline   Reply With Quote
Old 08-16-14, 05:05 PM   #213
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Too bad the cheaper flow sensors are not reliable & better ones are $$$

I think that the code should use a switch input to enable bypassing using flow sensors.
buffalobillpatrick is offline   Reply With Quote
Old 08-16-14, 06:00 PM   #214
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

Quote:
Originally Posted by buffalobillpatrick View Post
Too bad the cheaper flow sensors are not reliable & better ones are $$$

I think that the code should use a switch input to enable bypassing using flow sensors.


Yeah, either in software or in hardware.

There could be so much hanging on the reliability of a $14 sensor (with movable parts).

I totally understand the rationale behind verifying that water is flowing before turning on the compressor. It seems to me though that water flow verification could be done without the need to actually measure the quantity of water flow.

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 08-16-14, 06:22 PM   #215
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Added:

A preface outline, to be filled in describing what code does, inputs, outputs, etc.

#define skip_flowPin 8 //D8 input switch to skip flow testing

if (digitalRead(skip_flowPin) == LOW) readFlows();

changed wait_Time logic

Ormston_Rev04

Code:
/********************************************************
 *
 * ARDUINO Heat Pump Controller
 *
 *
 * INPUTS:
 *
 * Winter switch                 //control switches
 * HP SKIP switch
 *
 * OUTDOOR_sensor               //10K NTC Thermisters
 * BUFFER_tank_sensor 
 * SOLAR_tank_sensor                     
 * DHW_tank_sensor        
 *
 * MQ-2_GAS_sensor                            
 *
 *
 * OUTPUTS:
 *
 * LCD Display: Status & Progression through code
 *
 * BO_HEAT_CALL_RLY_R1     Boiler heat call Relay 1
 * DHW_P2_RLY_R2           DHW Pump Relay 2
 * BT_P3_RLY_R3            Buffer tank Pump Relay 3
 * //SOLAR_P4_RLY_R4         Solar tank Pump Relay 4
 * HP_HEAT_CALL_RLY_R5     Heat Pump call Relay 5,
 *                          Powers on Slave HP Arduino
 *
 * 
 *
 ********************************************************/
 


                                    //Got tired of counting zeros
#define  One_Sec              1000
#define  Half_Min            30000
#define  One_Min             60000
#define  Two_Min            120000
#define  Five_Min           300000
#define  Ten_Min            600000
#define  Thirty_Min        1800000

      
#define evap_Sensor           A0   //???
#define cond_Sensor           A1 
#define skip_flowPin           8   //D8 input switch to skip flow testing


int evap_Temp, cond_Temp;  //Variables for temperatures from thermistors
float HpLPM;                   //Flow rate from flow meter in L/m
float HpLPM1;                   //Flow rate from flow meter in L/m
int minLPM = 3;                //Minimum flowrate to run HP
int minEv = 2;                //Minimum evaporator temp
int maxCon = 65;              //Maximum condensor temp
byte runHP = false;
byte runCompressor = false;
byte runOutPump = false;       // pump to circulate water to house/tank
byte runInPump = false;        //fan in case of ASHP
const int demandPin = 4;       // input connected to external thermostat to request heat
byte demand = false;               // variable for reading if heat required from thermostat

unsigned long wait_Time;          // Delay Time
unsigned long hpStart_Time;        // Time HP cycle started
unsigned long hpStop_Time;        // Time HP cycle stopped

volatile int NbTopsFan; //measuring the rising edges of the signal
volatile int NbTopsFan1; //measuring the rising edges of the signal
int hallsensor = 2; //The pin location of the sensor
int hallsensor1 = 3; //The pin location of the sensor
byte led = 13;
byte ledState = false;
byte comp = 5;
byte inPump = 6;
byte outPump = 7;
unsigned long prevMillis = 0;        //used for led blinking


// ********************Temperature measurement starts here**************
void readTemps()
{ //read all temperatures from thermistors in C

  evap_Temp   =  (Read_10K_NTC_C (evap_Sensor)); 
  cond_Temp   =  (Read_10K_NTC_C (cond_Sensor));
}

// ********************Temperature measurement ends here**************



// ********************Flow meter reading starts here**************

void hpFlow () //This is the function that the interupt calls
{
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
}

void hpFlow1 () //This is the function that the interupt calls
{
  NbTopsFan1++;  //This function measures the rising and falling edge of the hall effect sensors signal
}

void readFlows()
{
  NbTopsFan = 0; //Set NbTops to 0 ready for calculations
  NbTopsFan1 = 0; //Set NbTops to 0 ready for calculations
  interrupts(); //Enables interrupts
  delay (One_Sec); //Wait 1 second
  noInterrupts(); //Disable interrupts
  HpLPM = (NbTopsFan / 2.75);
  HpLPM = (NbTopsFan1 / 2.75);
}
// ********************Flow meter reading ends here**************




int Read_10K_NTC_C (int which_sensor)
{   
  #define sample_cnt 30
  
  float alpha =   0.9;     // factor to tune
  float average = 0.0;
  float steinhart;
  
  int I;
 
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000

// TEMP. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25

// The beta coefficient of the thermistor (usually 3000-4000)
#define BCOEFFICIENT 3892

// the value of the series resistor
#define SERIESRESISTOR 10000
  
  for (I=0; I< sample_cnt; I++) 
  {  
  average =  alpha * analogRead(which_sensor) + (1-alpha) * average;
  delay(10);
  }
 
  // convert the value to resistance
  average = 1023 / average - 1;
  average = SERIESRESISTOR / average;
  steinhart = average / THERMISTORNOMINAL;     // (R/Ro)
  steinhart = log(steinhart);                  // ln(R/Ro)
  steinhart /= BCOEFFICIENT;                   // 1/B * ln(R/Ro)
  steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
  steinhart = 1.0 / steinhart;                 // Invert
  steinhart -= 273.15;                         // convert to C
  
//  return (round(steinhart * 1.8) + 32);       // round to whole number 
                                              // & convert to F            

return (round(steinhart));         // round to whole number, return int

}  // end of Read_10K_NTC





void setup() {
  pinMode(evap_Sensor, INPUT); //init
  pinMode(cond_Sensor, INPUT); //init
  
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  pinMode(hallsensor1, INPUT); //initializes digital pin 3 as an input
  attachInterrupt(0, hpFlow, RISING); //and the interrupt is attached (1 for Leonardo 0 for mega/uno)
  attachInterrupt(1, hpFlow1, RISING); //and the interrupt is attached (0 for Leonardo 1 for mega/uno)
  pinMode(led, OUTPUT);
  pinMode(comp, OUTPUT);
  pinMode(inPump, OUTPUT);
  pinMode(outPump, OUTPUT);
  pinMode(demandPin, INPUT); 
  pinMode(skip_flowPin, INPUT); 
  wait_Time = millis(); 

}

void loop() {
  readTemps();
  
  if (digitalRead(skip_flowPin) == LOW) readFlows();
  
  demand = digitalRead(demandPin);

  unsigned long current_Time = millis();
    
  if ((demand == true) 
     && ((current_Time - Two_Min) >= wait_Time))  //Wait 2 min.
  {
  if (runHP == false) hpStart_Time = current_Time;
  
  runHP = true;
  }
  else 
  {
  if (runHP == true) hpStop_Time = current_Time;
  
  runHP = false;
  }



  //*****HP startup cycle********
  if (runHP == true) runInPump = true;
  
  if ((runHP == true)
     && ((current_Time - Half_Min) >= hpStart_Time))  //wait 30s compressor start 
  {   
  if (digitalRead(skip_flowPin) == LOW)
  {   
  if (HpLPM > minLPM)  runCompressor = true;
  }
  else runCompressor = true;
  }
  
  if ((runHP == true) 
     && ((current_Time - One_Min) >= hpStart_Time)) //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
  }
 
 
  
  //*****HP shutdown cycle********
  if (runHP == false) runCompressor = false;
  
  if ((runHP == false) 
     && ((current_Time - Two_Min) >= hpStop_Time))   //wait 2 min
  runInPump = false;
     
  if ((runHP == false) 
     && ((current_Time - Five_Min) >= hpStop_Time))   //wait 5 min
  {
  runOutPump = false;
  wait_Time = current_Time;
  ledState = false;               //turn off pin 13 led after shutdown of HP
  }
 
 
  if (digitalRead(skip_flowPin) == LOW)
  {
  //***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);


}

Last edited by buffalobillpatrick; 08-16-14 at 06:45 PM..
buffalobillpatrick is offline   Reply With Quote
Old 08-16-14, 07:43 PM   #216
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

A/C should I add 16x2 LCD to show progression through code?

Uses only A4 & A5 I2C

Last edited by buffalobillpatrick; 08-16-14 at 07:45 PM..
buffalobillpatrick is offline   Reply With Quote
The Following User Says Thank You to buffalobillpatrick For This Useful Post:
AC_Hacker (08-17-14)
Old 08-17-14, 10:58 AM   #217
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

Quote:
Originally Posted by buffalobillpatrick View Post
A/C should I add 16x2 LCD to show progression through code?

Uses only A4 & A5 I2C
Wow!

You save me from having to suggest it...

I really was considering this very thing.

I have that very hardware just a-waitin'

Go for it.

BTW, sometime I completely lose track of how unusual and interesting and filled with potential this work that we are doing actually is.

I had dinner last night with some newly-acquired friends, and I started talking about this project, but in the wider sense, all the related projects and considerations and reasons for particular approaches.

It did help that I was talking to someone with an advanced degree in computer science, and who is deeply interested in environmental issues, but the whole unrolling of the story and supporting information went well past midnight.

It's really pretty cool, what we're doing here.

Best,

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
The Following 2 Users Say Thank You to AC_Hacker For This Useful Post:
buffalobillpatrick (08-17-14), jeff5may (12-28-14)
Old 08-17-14, 02:26 PM   #218
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Split due to length

Had to force SKIP_FLOW_BOOL = true; //debug
due to readFlows(); hanging due to no hardware & interrupts happening

Forced demand: demand = HIGH; //debug

Again restructured wait_Time logic

This seems to cycle through turning on: Comp, pumps etc.

Rev05
Code:
/********************************************************
 *
 * ARDUINO Heat Pump Controller
 *
 *
 * INPUTS:
 *
 * Winter switch                 //control switches
 * HP SKIP switch
 *
 * OUTDOOR_sensor               //10K NTC Thermisters
 * BUFFER_tank_sensor 
 * SOLAR_tank_sensor                     
 * DHW_tank_sensor        
 *
 * MQ-2_GAS_sensor                            
 *
 *
 * OUTPUTS:
 *
 * LCD Display: Status & Progression through code
 *
 * BO_HEAT_CALL_RLY_R1     Boiler heat call Relay 1
 * DHW_P2_RLY_R2           DHW Pump Relay 2
 * BT_P3_RLY_R3            Buffer tank Pump Relay 3
 * //SOLAR_P4_RLY_R4         Solar tank Pump Relay 4
 * HP_HEAT_CALL_RLY_R5     Heat Pump call Relay 5,
 *                          Powers on Slave HP Arduino
 *
 * 
 *
 ********************************************************/
 
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>


#define I2C_ADDR    0x3F // <<----- Add your address here.  Find it from I2C Scanner

#define BACKLIGHT_PIN     3  //define LCD digital pins
#define En_pin  2
#define Rw_pin  1             //can't use D0 & D1 Tx Rx
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5              //can use 2 -> 12 below in code
#define D6_pin  6
#define D7_pin  7

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

#define SDA                   A4  //RESERVE I2C for LCD           
#define SCL                   A5  


                                    //Got tired of counting zeros
#define  One_Sec              1000
#define  Half_Min            30000
#define  One_Min             60000
#define  Two_Min            120000
#define  Five_Min           300000
#define  Ten_Min            600000
#define  Thirty_Min        1800000

      
#define evap_Sensor               A0   //???
#define cond_Sensor               A1 
#define skip_flow_check_Switch     8   //D8 input switch to skip flow testing


unsigned long T1;
unsigned long T2;
unsigned long TT;

int I;
int T_START;
int T_NOW;

boolean SKIP_FLOW_BOOL    = false;


int evap_Temp, cond_Temp;  //Variables for temperatures from thermistors
float HpLPM;                   //Flow rate from flow meter in L/m
float HpLPM1;                   //Flow rate from flow meter in L/m
int minLPM = 3;                //Minimum flowrate to run HP
int minEv = 2;                //Minimum evaporator temp
int maxCon = 65;              //Maximum condensor temp
byte runHP = false;
byte runCompressor = false;
byte runOutPump = false;       // pump to circulate water to house/tank
byte runInPump = false;        //fan in case of ASHP
const int demandPin = 4;       // input connected to external thermostat to request heat
byte demand = false;               // variable for reading if heat required from thermostat

unsigned long wait_Time;          // Delay Time
unsigned long hpStart_Time;        // Time HP cycle started
unsigned long hpStop_Time;        // Time HP cycle stopped

volatile int NbTopsFan; //measuring the rising edges of the signal
volatile int NbTopsFan1; //measuring the rising edges of the signal
int hallsensor = 2; //The pin location of the sensor
int hallsensor1 = 3; //The pin location of the sensor
byte led = 13;
byte ledState = false;
byte comp = 5;
byte inPump = 6;
byte outPump = 7;
unsigned long prevMillis = 0;        //used for led blinking


// ********************Temperature measurement starts here**************
void readTemps()
{ //read all temperatures from thermistors in C

  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("readTemps()"));
  delay(5000);        //Delay 5 sec  
  
  evap_Temp   =  (Read_10K_NTC_C (evap_Sensor)); 
  cond_Temp   =  (Read_10K_NTC_C (cond_Sensor));
}

// ********************Temperature measurement ends here**************



// ********************Flow meter reading starts here**************

void hpFlow () //This is the function that the interupt calls
{
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("hpFlow()"));
  delay(5000);        //Delay 5 sec  
  
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
}

void hpFlow1 () //This is the function that the interupt calls
{
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("hpFlow1()"));
  delay(5000);        //Delay 5 sec 
  
  NbTopsFan1++;  //This function measures the rising and falling edge of the hall effect sensors signal
}

void readFlows()
{
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("readFlows()"));
  delay(5000);        //Delay 5 sec  
  
  NbTopsFan = 0; //Set NbTops to 0 ready for calculations
  NbTopsFan1 = 0; //Set NbTops to 0 ready for calculations
  interrupts(); //Enables interrupts
  delay (One_Sec); //Wait 1 second
  noInterrupts(); //Disable interrupts
  HpLPM = (NbTopsFan / 2.75);
  HpLPM = (NbTopsFan1 / 2.75);
}
// ********************Flow meter reading ends here**************




int Read_10K_NTC_C (int which_sensor)
{   
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("Read_10K_NTC_C()"));
  delay(5000);        //Delay 5 sec  
  

  #define sample_cnt 30
  
  float alpha =   0.9;     // factor to tune
  float average = 0.0;
  float steinhart;
  
  int I;
 
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000

// TEMP. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25

// The beta coefficient of the thermistor (usually 3000-4000)
#define BCOEFFICIENT 3892

// the value of the series resistor
#define SERIESRESISTOR 10000
  
  for (I=0; I< sample_cnt; I++) 
  {  
  average =  alpha * analogRead(which_sensor) + (1-alpha) * average;
  delay(10);
  }
 
  // convert the value to resistance
  average = 1023 / average - 1;
  average = SERIESRESISTOR / average;
  steinhart = average / THERMISTORNOMINAL;     // (R/Ro)
  steinhart = log(steinhart);                  // ln(R/Ro)
  steinhart /= BCOEFFICIENT;                   // 1/B * ln(R/Ro)
  steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
  steinhart = 1.0 / steinhart;                 // Invert
  steinhart -= 273.15;                         // convert to C
  
//  return (round(steinhart * 1.8) + 32);       // round to whole number 
                                              // & convert to F            

return (round(steinhart));         // round to whole number, return int

}  // end of Read_10K_NTC

Last edited by buffalobillpatrick; 08-17-14 at 02:42 PM..
buffalobillpatrick is offline   Reply With Quote
Old 08-17-14, 02:27 PM   #219
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

Code:
void setup() 
{
  
  lcd.begin (16,2); //  <<----- My LCD is 16x2
  lcd.clear();
 
  //Switch on the backlight
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
  lcd.setBacklight(HIGH);  


  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("HEAT PUMP REV05"));
  lcd.setCursor(0,1);
  lcd.print(F("START SETUP"));
  delay(5000);        //Delay 5 sec 
                          
  
  pinMode(evap_Sensor, INPUT); //init
  pinMode(cond_Sensor, INPUT); //init
  
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  pinMode(hallsensor1, INPUT); //initializes digital pin 3 as an input
  attachInterrupt(0, hpFlow, RISING); //and the interrupt is attached (1 for Leonardo 0 for mega/uno)
  attachInterrupt(1, hpFlow1, RISING); //and the interrupt is attached (0 for Leonardo 1 for mega/uno)
  pinMode(led, OUTPUT);
  pinMode(comp, OUTPUT);
  pinMode(inPump, OUTPUT);
  pinMode(outPump, OUTPUT);
  pinMode(demandPin, INPUT); 
  
  pinMode(skip_flow_check_Switch, INPUT);
  
  
 /* debug
  if (digitalRead(skip_flow_check_Switch) == HIGH)
  {
  SKIP_FLOW_BOOL    = true; 
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SKIP FLOW SW=ON"));
  delay(5000);        //Delay 5 sec                           
  }
  else
  { 
  SKIP_FLOW_BOOL    = false;
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SKIP FLOW SW=OFF"));
  delay(5000);        //Delay 5 sec 
  }    
*/

  SKIP_FLOW_BOOL    = true; //debug
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SKIP FLOW SW=ON"));
  delay(5000);        //Delay 5 sec  
  
  
  lcd.clear();  
  lcd.home (); // go home 
  lcd.print(F("END SETUP"));
  delay(5000);        //Delay 5 sec  
   
  wait_Time = millis(); 

}





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;
  
  if ((runHP == false) 
     && (current_Time >= (hpStop_Time + Two_Min)))  //Wait 2 min
  runInPump = false;
     
  if ((runHP == false) 
     && (current_Time >= (hpStop_Time + Five_Min)))  //Wait 5 min  
  {
  runOutPump = false;
  wait_Time = current_Time;
  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); 
  
  
}
buffalobillpatrick is offline   Reply With Quote
Old 08-17-14, 05:18 PM   #220
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

BBP,

Apparently there's more than one version of the LCD I2C assembly.

And maybe more than one version of the LiquidCrystal_I2C library.

At any rate, I did go to Github and got THIS version, and put it into a library folder in the Arduino library folder.

I haven't integrated the LCD with the I2C hardware yet, maybe I need to do that before I try to compile your new code.

So, while I'm putting the little cable together, I've tried a compile, but the errors were many.

Where did you get these two libraries?
  • #include <LCD.h>
  • #include <LiquidCrystal_I2C.h>

I think I may have botched something with these libraries.

Best,

-AC

__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Reply



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 06:06 AM.


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