EcoRenovator  

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


Blog 60+ Home Energy Saving Tips Recent Posts


Reply
 
Thread Tools Display Modes
Old 01-25-15, 03:23 PM   #311
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

http://www.taco-hvac.com/uploads/Fil...ves003-008.pdf

Updated code

Code:
/********************************************************
 *
 * ARDUINO Taco 008 Flow.
 *
 * In Setup, Source & Load pumps are set OFF
 *     , read Source pump static pressure, convert to Feet of Head & save
 *     , read Load pump static pressure, convert to Feet of Head & save
 *
 * In Void Loop, Source & Load pumps are set ON
 *     , read Source pump ON pressure , convert to Feet of Head
 *     , calculate Source pump Delta pressure (ON - OFF)
 *     , estimate Source pump GPM
 *
 *     , read Load pump ON pressure , convert to Feet of Head
 *     , calculate Load pump Delta pressure (ON - OFF)
 *     , estimate Load pump GPM
 * Repeat
 *
 *
 * Change History: 
 * 01/27/15 Coded
 *
 *
 *
 ********************************************************/

#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #else
  #include "WProgram.h"
  #endif

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>


#define DEBUG 1
//#define DEBUG 0


#define I2C_ADDR    0x3F // <<----- Add your address here.  Find it from I2C Scanner
                       //D3
#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 D2 -> D12 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  

//  pinMode(A0, OUTPUT);     //This works acording 
                             //  http://arduino.cc/en/Tutorial/AnalogInputPins
//  digitalWrite(A0, HIGH);  //



#define Source_Pump_relay_pin    2   // D2 Buffer tank Pump Relay D1102  2.5A
#define Load_Pump_relay_pin      3   // D3 Buffer tank Pump Relay D1102  2.5A

#define Source_pump_sensor_pin      A0  // 
#define Load_pump_sensor_pin        A1  // 
 
float Src_on_head,       Load_on_head;
float Src_on_delta_head, Load_on_delta_head;
float Src_off_head,      Load_off_head;
float Src_on_flow,       Load_on_flow;

int I, W, Y;



void setup(void)       //Start Setup
  {
        
  pinMode (Source_pump_sensor_pin,   INPUT);
  pinMode (Load_pump_sensor_pin,     INPUT);
 
  pinMode (Source_Pump_relay_pin,    OUTPUT);  
  pinMode (Load_Pump_relay_pin,      OUTPUT);  

 
 // Serial.begin(9600); // start serial communication
 // delay(10000);      //time to enable monitor window
 // Serial.println(F("........Hello world!......."));
 // delay(100); 
 
  
  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("008 FLOW"));
  delay(10000);


  if(DEBUG)
  {       
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("DEBUG = ON"));
  delay(10000);
  }
  else 
  {       
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("DEBUG = OFF"));
  delay(10000);
  }


  digitalWrite (Source_Pump_relay_pin, HIGH);  //Source Pump OFF
  digitalWrite (Load_Pump_relay_pin, HIGH);    //Load Pump OFF
  delay(10000);
 
  W = analogRead(Source_pump_sensor_pin);  //read Src pump off pressure

if(DEBUG){ W = 500;}
    
  Src_off_head = convert_raw_sensor_to_head(W);
  
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SRC_PUMP_OFF_HD"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Src_off_head);  
  lcd.print(F(" Feet"));
  delay(10000);
  
  
  W = analogRead(Load_pump_sensor_pin);  //read Load pump off pressure         
 
if(DEBUG){ W = 500;}

  Load_off_head = convert_raw_sensor_to_head(W);
 
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("LOAD_PUMP_OFF_HD"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Load_off_head);  
  lcd.print(F(" Feet"));
  delay(10000); 

  }    //end setup




  void loop ()
{ 
   
  digitalWrite (Source_Pump_relay_pin, LOW);  //Source Pump ON
  digitalWrite (Load_Pump_relay_pin,   LOW);  //Load Pump ON
  delay(10000);
 
  W = analogRead(Source_pump_sensor_pin);   //read Src pump ON pressure         
 
if(DEBUG){ W = 600;}

  Src_on_head = convert_raw_sensor_to_head(W); 
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SRC_PUMP_ON_HD"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Src_on_head);  
  lcd.print(F(" Feet"));
  delay(10000);

  Src_on_delta_head = Src_on_head - Src_off_head; 
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SRC_PUMP_ON_DLT"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Src_on_delta_head);  
  lcd.print(F(" Feet"));
  delay(10000);
  
  Src_on_flow = estimate_008_flow(Src_on_delta_head);
  if (Src_on_flow == -1)
  {
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SRC_DELTA_HD_NG"));   
  lcd.setCursor(0,1);
  lcd.print(F("HANG_FOREVER_1"));   
  do{Y = Y;} while (Y == Y);  //hang forever
  }      
  
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("SRC_P_ON_FLOW"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Src_on_flow);  
  lcd.print(F(" GPM"));
  delay(10000);
   
 
 
 
  
  W = analogRead(Load_pump_sensor_pin);     //read Load pump ON pressure         

if(DEBUG){ W = 650;}

  Load_on_head = convert_raw_sensor_to_head(W);
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("LOAD_PUMP_ON_HD"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Load_on_head);  
  lcd.print(F(" Feet"));
  delay(10000);

  Load_on_delta_head = Load_on_head - Load_off_head; 
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("LOAD_PUMP_ON_DLT"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Load_on_delta_head);  
  lcd.print(F(" Feet"));
  delay(10000);
  
  Load_on_flow = estimate_008_flow(Load_on_delta_head); 
  if (Load_on_flow == -1)
  {
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("LOAD_DELTA_HD_NG"));   
  lcd.setCursor(0,1);
  lcd.print(F("HANG_FOREVER_2"));   
  do{Y = Y;} while (Y == Y);  //hang forever
  }    
    
  lcd.clear();
  lcd.home (); // go home
  lcd.print(F("LOAD_P_ON_FLOW"));
  lcd.setCursor(0,1);
  lcd.print(F("= "));
  lcd.print(Load_on_flow);  
  lcd.print(F(" GPM"));
  delay(10000); 
  
 
}  //end forever loop



float convert_raw_sensor_to_head(float Raw)
{
  //Pressure sensor output .5v = 0 PSI, 4.5v = 30 PSI
  //analogRead results     .5v = 102,   4.5v = 921
  
#define PSI_0                           102
#define PSI_30                          921
#define PSI_max                         30
#define Convert_psi_to_head     2.31

  return ((((Raw - PSI_0) / (PSI_30 - PSI_0)) * PSI_max) * Convert_psi_to_head);
}




float estimate_008_flow(float Delta_head)
{ 
/* 
 * http://www.taco-hvac.com/uploads/Fil...ves003-008.pdf
 *
 * Pretty tricky array usage, the array element values (feet of head) 
 * are taken from the Taco 008 pump performance curve Y-axis 
 * at each GPM along X-axis, 
 * array index is whole GPM along X-axis
 *
 * Flow in GPM is returned to caller after interpolation between 
 * whole GPM values along X-axis, 
 * or ERROR is returned (-1) if "out of array bounds" 
 * ie. not between array highest & lowest head values
 *
 */
 
#define Array_size            16

float Array_008 [Array_size] = {15.25,15.05,14.8,14.35,13.75,13.15,12.35, 
                                11.3,10.4,9.15,7.8,6.45,4.8,3.1,1.3, -1.0};
                                
float Val, Next_val, Span, GPM; 


  if ((Delta_head < Array_008[0]) && (Delta_head > 0)) //Bounds check
  {
  // in bounds, continue
  
  for (I=0; I< Array_size; I++) //Scan array to find where Delta_head falls
  {  
  Val = Array_008[I];           //get array value
  Next_val = Array_008[I+1];    //get Next array value
  Span = Val - Next_val;        //Calc Span

  if((Delta_head <= Val) && (Delta_head >= Next_val)){break;}
  }  //end for loop when Delta_head falls between elements, I = whole GPM
  
  GPM = (I + ((Val - Delta_head) / Span));  //interpolate to get decimals
  return (GPM);                             // return GPM

  }  //end if in bounds
  else {return (-1);}       // error return, out of bounds 

}  // end of estimate_008_flow


Last edited by buffalobillpatrick; 01-28-15 at 12:03 PM..
buffalobillpatrick is offline   Reply With Quote
Old 11-15-15, 12:06 AM   #312
Acuario
Apprentice EcoRenovator
 
Join Date: May 2011
Location: Tortosa, Spain
Posts: 221
Thanks: 2
Thanked 81 Times in 46 Posts
Default

Did this project ever advance any further?
I'm just finishing off my own heatpump controller that has many of the features originally listed plus a few more.

Although a home made thermometer and display is 'cool' I wanted something a bit more professional looking so after much hunting around found a device called a BAC 1000 that:
  • Functions for heat and cool
  • Can be programmed for on/off
  • Has an RS485 interface
  • Looks 'cool'
  • Is touch control



After starting the controller (which used an Arduino UNO) I quickly ran out of space so upgraded o a Mega. I also quickly discovered that for all the functionality I wanted to include a single threaded program was not going to work.

A bit of investigation into real time operating systems and I came across NilRTOS which had been ported to the Arduino and was perfect for my needs.

If there is interest I'll start a new thread with the design, the pitfalls and what I have ended up with.

Acuario

p.s. For AC - using the RTOS is finally going to give me the platform to continue with the inverter project that I still have sitting in my workshop.
Acuario is offline   Reply With Quote
The Following User Says Thank You to Acuario For This Useful Post:
AC_Hacker (11-15-15)
Old 11-15-15, 07:15 AM   #313
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,428
Thanks: 431
Thanked 619 Times in 517 Posts
Send a message via Yahoo to jeff5may
Default

Aquario,

Yes please share. Too much info is better than not enough. I don't hate you for going with a mega dev board, at least it has an atmega chip in it still. A few others did the same.
jeff5may is offline   Reply With Quote
The Following User Says Thank You to jeff5may For This Useful Post:
AC_Hacker (11-15-15)
Old 11-16-15, 02:53 AM   #314
TechShop
FNG
 
Join Date: Jul 2015
Location: Washington
Posts: 71
Thanks: 8
Thanked 19 Times in 13 Posts
Default

I hadn't seen this thread until now. Looks like you guys have been busy and have some good ideas here.
TechShop is offline   Reply With Quote
Old 12-09-15, 02:19 PM   #315
Fordguy64
Journeyman EcoRenovator
 
Join Date: Oct 2011
Location: Cincinnati ohio
Posts: 338
Thanks: 40
Thanked 35 Times in 31 Posts
Default

So I didn't read every page of this but I skimmed through it.. Looks like we have a lot of great ideas to put into a controller. I'm not sure if this idea was covered but it seems like a common theme was running out of space on the boards. My idea is what if we had 2-3 different boards. Ie one that controlled just the compressor and the super heat and the defrost cycle and maybe a few other things that you might want to control directly related to the operation on the compressor and the refrigerant. Then have another one that was basically the thermostat that would send a signal to the other board on the compressor and that board would then turn compressor on and keep it running at its best.

Not sure if that makes sense or not
Fordguy64 is offline   Reply With Quote
Old 12-10-15, 12:48 AM   #316
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 Fordguy64 View Post
So I didn't read every page of this but I skimmed through it.. Looks like we have a lot of great ideas to put into a controller. I'm not sure if this idea was covered but it seems like a common theme was running out of space on the boards. My idea is what if we had 2-3 different boards. Ie one that controlled just the compressor and the super heat and the defrost cycle and maybe a few other things that you might want to control directly related to the operation on the compressor and the refrigerant. Then have another one that was basically the thermostat that would send a signal to the other board on the compressor and that board would then turn compressor on and keep it running at its best.

Not sure if that makes sense or not
I think this sounds like a good idea.

My original idea was less involved than yours.

The original idea would leave the superheat regulation to a TXV. And the Uno would monitor a few temperature set points, and cut power to the compressor when these setpoints were reached. I envisioned a couple of LEDs to indicate status.

The original idea spun out of control when sophisticated menu-driven LCD display was added which require more pinouts than were available (more programming to). Later, after the gumption was gone, the idea of using I2C to communicate with the display was floated.

I wanted to keep it all to an Arduino Uno because of the low price and very easy availability of hardware and experience.

I have spoken to some very experienced programmers since then and they all said that an Uno would have plenty of power for such a project.

My idea would also require a room thermostat of some sort, like your idea.

If you have any ideas of how it could be done, it is still a missing link in the DIY heat pump chain. It would be off tremendous help to many people.

Best,

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 12-10-15, 12:53 AM   #317
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 Acuario View Post
A bit of investigation into real time operating systems and I came across NilRTOS which had been ported to the Arduino and was perfect for my needs.

If there is interest I'll start a new thread with the design, the pitfalls and what I have ended up with.

Acuario

p.s. For AC - using the RTOS is finally going to give me the platform to continue with the inverter project that I still have sitting in my workshop.
Acurio,

I am shocked that I missed your offer to sart another thread using the RTOS.

By all means have at it!

Do you have links to RTOS?

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 12-10-15, 09:04 PM   #318
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,428
Thanks: 431
Thanked 619 Times in 517 Posts
Send a message via Yahoo to jeff5may
Default

Guys,

The one I put together acts just like a wall thermostat. It runs off a single 1wire sensor. Modes: off, heat, cool, auto. outputs: fan, compressor, rv. The only thing it don't do is defrost. I have room for more sensors, and plan to make it do defrost for a window shaker conversion. It uses an uno board, an lcd keypad shield, and a relay shield. Works for me using the hacktronix libraries.
jeff5may is offline   Reply With Quote
Old 12-11-15, 11:21 AM   #319
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 jeff5may View Post
Guys,

The one I put together acts just like a wall thermostat. It runs off a single 1wire sensor. Modes: off, heat, cool, auto. outputs: fan, compressor, rv. The only thing it don't do is defrost. I have room for more sensors, and plan to make it do defrost for a window shaker conversion. It uses an uno board, an lcd keypad shield, and a relay shield. Works for me using the hacktronix libraries.
More pix, info & code please.

By the way, what is "rv"? Recreational Vehicle??

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 12-11-15, 12:10 PM   #320
Fordguy64
Journeyman EcoRenovator
 
Join Date: Oct 2011
Location: Cincinnati ohio
Posts: 338
Thanks: 40
Thanked 35 Times in 31 Posts
Default

Reversing valve?

Fordguy64 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 01:20 AM.


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