EcoRenovator  

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


Blog 60+ Home Energy Saving Tips Recent Posts Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Display Modes
Old 08-14-14, 05:42 PM   #191
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
...so unless anyone has any objections i'm going to ditch the lib and use more conventional thermistor code.
No objection here...

-AC

__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 08-14-14, 05:48 PM   #192
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 Arduino Simulator??

BTW,

What Arduino Simulator are you using??

Best,

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

This works fine:
Code:
int Read_10K_NTC (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            
}  // end of Read_10K_NTC
buffalobillpatrick is offline   Reply With Quote
Old 08-14-14, 08:07 PM   #194
buffalobillpatrick
Master EcoRenovator
 
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
Default

A/C is this code doing what you think needs done?

Why do anything in main void loop() if there is not a heat demand?

Reading flows before pumps are started?

I'm not a fan of "blocking delays" without checking for error conditions during custom delay.

Lots of comments need to be added to explain: what is being done & why.

I added this in code.
//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

Last edited by buffalobillpatrick; 08-14-14 at 08:19 PM..
buffalobillpatrick is offline   Reply With Quote
Old 08-15-14, 12:20 AM   #195
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 is this code doing what you think needs done?
I haven't tried the program with your new Thermistor routine yet.

What I'm interested in is simple reliable code for this version of the controller.

First software versions are almost never perfect...

We're all on the same team here.

A robust controller will surely evolve.

And, since we have chosen the most popular hardware platform on the planet, and are going Open Source with the software, even the best that we can possibly do will not be the last word...

* * *

BBP, I agree with the need for comments in the software, it'll help us with debugging.

I'm really stoked about this project, I've waited years.

I have searched the Internet and I have not found an Open Source Heat Pump Controller. As far as I can tell, we're breaking new ground.

BTW, I really was interested in the idea of an Arduino Simulator, so I want ahead and bought THIS_ONE. It was only $13.98 US... Such a deal!!

Review in a few days.

Best,

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...

Last edited by AC_Hacker; 08-15-14 at 12:36 AM..
AC_Hacker is offline   Reply With Quote
Old 08-15-14, 01:40 AM   #196
Ormston
Apprentice EcoRenovator
 
Join Date: Mar 2013
Location: UK
Posts: 131
Thanks: 13
Thanked 35 Times in 32 Posts
Default

Quote:
Originally Posted by AC_Hacker View Post

BTW, I really was interested in the idea of an Arduino Simulator, so I want ahead and bought THIS_ONE. It was only $13.98 US... Such a deal!!

Review in a few days.

Best,

-AC
That is the simulator I'm using, it,'s so useful for debugging but also very buggy itself.
Any #include files need to be located in the same folder as the sketch.
Ormston is offline   Reply With Quote
Old 08-15-14, 02:14 AM   #197
Ormston
Apprentice EcoRenovator
 
Join Date: Mar 2013
Location: UK
Posts: 131
Thanks: 13
Thanked 35 Times in 32 Posts
Default

Quote:
Originally Posted by buffalobillpatrick View Post
A/C is this code doing what you think needs done?

Why do anything in main void loop() if there is not a heat demand?

Reading flows before pumps are started?

I'm not a fan of "blocking delays" without checking for error conditions during custom delay.

Lots of comments need to be added to explain: what is being done & why.

I added this in code.
//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
Code running when no heat demand is due to the main point of this sketch Being a controlled startup and shutdown of the heat pump, shutdown takes 5 mins after demand for heat goes false.

Flows don't need to be read when pumps are not running and I have an idea to bake reading flow sensor reading non blocking. The reason it uses blocking code whilst reading flow sensors is that it uses interrupts and if the processor was doing something very time sensetive , the timing would be screwed up by an interrupt.(software serial, i2, etc)

By the time we get to GPHPC V1 most if not all of this code will be improved or replaced. Unless the controller is developed in public with input from many members, we will simply end up with many different controllers all with as completely different feature sets and different core code.
If you have a sketch you feel would be a better starting point for the project then please post it so we can use that instead.

Steve
Ormston is offline   Reply With Quote
The Following User Says Thank You to Ormston For This Useful Post:
buffalobillpatrick (08-15-14)
Old 08-15-14, 05:08 AM   #198
ICanHas
Banned
 
Join Date: Aug 2014
Location: US
Posts: 150
Thanks: 7
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by jeff5may View Post
As far as safety is concerned, I would never completely trust an embedded device for anything critical. The rig you put this in should have its own fail-safe built into it as a cardinal rule. If it absolutely must work or else, you should probably go get something that has passed multiple testing methods and has a diploma already. This one might not solve all of your problems, and may end up causing new problems instead.
I'm with you completely. Embedded systems use software codes which adds a whole new layer of vulnerability to external attacks, as well as egregious codes hidden in place by the developer in order to protect royalty revenue by acting out when copyright protection is triggered. So, unhappy independent thermostat code developer can include a malware for open source hardware that can hide something like ignore all safeties, and run the gas valve, turn off the fan and keep going until the house burns down as a revenge for pirating it.

Someone proposed such an attack as a copyright protection scheme...
Quote:
I think that making it look deceptively simple to copy but with a hidden trap that takes a long time to show up (like the MAC address reverting I mentioned earlier) would keep the pirates from putting much effort into making the copy, thus increasing the chance they'll ship flawed copies.
ICanHas is offline   Reply With Quote
Old 08-15-14, 08:27 AM   #199
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 ICanHas View Post
I'm with you completely. Embedded systems use software codes which adds a whole new layer of vulnerability to external attacks, as well as egregious codes hidden in place by the developer in order to protect royalty revenue by acting out when copyright protection is triggered. So, unhappy independent thermostat code developer can include a malware for open source hardware that can hide something like ignore all safeties, and run the gas valve, turn off the fan and keep going until the house burns down as a revenge for pirating it.

Someone proposed such an attack as a copyright protection scheme...
ICanHas,

Your post is not germane to our efforts here.

Please help someone else.

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...

Last edited by AC_Hacker; 08-15-14 at 08:49 AM..
AC_Hacker is offline   Reply With Quote
The Following User Says Thank You to AC_Hacker For This Useful Post:
buffalobillpatrick (08-15-14)
Old 08-15-14, 08:48 AM   #200
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
By the time we get to GPHPC V1 most if not all of this code will be improved or replaced. Unless the controller is developed in public with input from many members, we will simply end up with many different controllers all with as completely different feature sets and different core code.
If you have a sketch you feel would be a better starting point for the project then please post it so we can use that instead.
I think this is a very important point. We not only have hardware and software involved, we also have egos in the mix here.

Questions about methods and approaches are necessary in this process.

We are all on the same team, and are ultimately interested in the same outcome. Thus the need to tread lightly, and respectfully as we proceed.

* * *

Lastly, and I was hoping that it would not be necessary to say this, but we must be on guard against attempts by others, to deflect this project.

Sincerely,

-AC_Hacker

__________________
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-15-14)
Reply


Thread Tools
Display Modes

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 08:19 AM.


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