EcoRenovator  

Go Back   EcoRenovator > Improvements > Renovations & New Construction
Advanced Search
 


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


Reply
 
Thread Tools Display Modes
Old 09-23-12, 10:52 PM   #21
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default

Quote:
Originally Posted by opiesche View Post
Another quick update: After building a temperature logger with a Raspberry Pi, a couple of digital temperature sensors, a bit of wire and a few dozen lines of Python code, I now have proper temperature data to share!
Sounds like you also have a respectable project to share... and don't forget the photos and the Python code!

Best,

-AC

__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 09-24-12, 01:04 AM   #22
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

As requested

Adventures in home improvement: Temperature Logging

I'll update this with some more pictures and information, and finally code, this week. Just to show how simple it really was, here's the script that reads the sensors and outputs the values to a .csv file. I'll eventually make this prettier and more flexible as well (right now it's hardcoded for my particular sensors and setup).


Code:
#!/usr/bin/python

import os
import datetime

def extract_temp(filename):
        temp = 0.0
        lines = open(filename, 'r').readlines()
        line = lines[1]
        tempstr = line[29:34]
        temp = float(tempstr)
        temp = temp/1000.0
        return temp


# read the sensors and stick their output to a temporary file
os.system("cat /sys/bus/w1/devices/w1_bus_master1/28-000003742037/w1_slave > /tmp/curtemp1.txt")
os.system("cat /sys/bus/w1/devices/w1_bus_master1/28-0000040df025/w1_slave > /tmp/curtemp2.txt")

# grab the temperature only from the file (there's other data in the sensor output)
temp1 = extract_temp("/tmp/curtemp1.txt")
temp2 = extract_temp("/tmp/curtemp2.txt")

# now log to file with timestamp
date_str = str(datetime.datetime.today())[0:10]
time_str = str(datetime.datetime.now())[11:19]

strn = time_str+", "+str(temp1)+", "+str(temp2)

filename = "/home/raspbian/"+date_str+".csv"
with open(filename, "a") as outfile:
        outfile.write( strn+"\r\n" )

print strn
I'll keep tinkering and adding to this. The source code and build instructions will likely end up on github when I'm done.
The cool thing about doing this with the Raspberry Pi is, that it's network accessible (I grab the plot images from a webserver running on it) and that I can program it remotely via SSH. It can sit in its current location running (at about 1W, by the way!), and I can tweak it, tune it, and grab the data and plots from it without ever touching the physical machine

Last edited by opiesche; 09-24-12 at 01:22 AM..
opiesche is offline   Reply With Quote
Old 09-24-12, 02:13 AM   #23
Vlad
Apprentice EcoRenovator
 
Join Date: Aug 2010
Location: Windsor ON Canada
Posts: 229
Thanks: 4
Thanked 30 Times in 22 Posts
Default

Quote:
Originally Posted by opiesche View Post
As requested

Adventures in home improvement: Temperature Logging

I'll update this with some more pictures and information, and finally code, this week. Just to show how simple it really was, here's the script that reads the sensors and outputs the values to a .csv file. I'll eventually make this prettier and more flexible as well (right now it's hardcoded for my particular sensors and setup).


Code:
#!/usr/bin/python

import os
import datetime

def extract_temp(filename):
        temp = 0.0
        lines = open(filename, 'r').readlines()
        line = lines[1]
        tempstr = line[29:34]
        temp = float(tempstr)
        temp = temp/1000.0
        return temp


# read the sensors and stick their output to a temporary file
os.system("cat /sys/bus/w1/devices/w1_bus_master1/28-000003742037/w1_slave > /tmp/curtemp1.txt")
os.system("cat /sys/bus/w1/devices/w1_bus_master1/28-0000040df025/w1_slave > /tmp/curtemp2.txt")

# grab the temperature only from the file (there's other data in the sensor output)
temp1 = extract_temp("/tmp/curtemp1.txt")
temp2 = extract_temp("/tmp/curtemp2.txt")

# now log to file with timestamp
date_str = str(datetime.datetime.today())[0:10]
time_str = str(datetime.datetime.now())[11:19]

strn = time_str+", "+str(temp1)+", "+str(temp2)

filename = "/home/raspbian/"+date_str+".csv"
with open(filename, "a") as outfile:
        outfile.write( strn+"\r\n" )

print strn
I'll keep tinkering and adding to this. The source code and build instructions will likely end up on github when I'm done.
The cool thing about doing this with the Raspberry Pi is, that it's network accessible (I grab the plot images from a webserver running on it) and that I can program it remotely via SSH. It can sit in its current location running (at about 1W, by the way!), and I can tweak it, tune it, and grab the data and plots from it without ever touching the physical machine
This useful post will get lost very soon. You should start separate thread with name like "automated control system, code..." or whatever you think it should be . It is a really a big deal for most people to get sophisticated control system especially one that you can control from your computer....

I found many not expensive mini boards on eBay but they all require some sort of programming.
Vlad is offline   Reply With Quote
Old 09-24-12, 02:39 AM   #24
Vlad
Apprentice EcoRenovator
 
Join Date: Aug 2010
Location: Windsor ON Canada
Posts: 229
Thanks: 4
Thanked 30 Times in 22 Posts
Default

Quote:
Originally Posted by opiesche View Post
Going a little further with this: say we more than double the heat loss for our coldest nights, to 4000BTU/h.
I've got 980 ft^2 of heated floor surface, that means I'll have to put at the most 4 BTU/h/ft^2 into the floor.

Each square foot of flooring contains on average 13 inches or so of tubing, at 1/2". The volume of a cylinder is pi*r^2*h, so 3.14*0.25*13 = 10 cubic inches or 0.163l of water.
At 1kg/l, that's 0.163kg or 0.35lb of water per square foot.

Water has a specific heat of roughly 1 BTU/ lbdeg (1 BTU for each pound of water that is 1 degree warmer than ambient). So, to get 4BTU out of 0.35lb of water, it'll have to be 4/0.35 = 11 degrees warmer than the ambient temperature. If I'm considering 70 degree ambient temp, I'll need the water to be at least 81 degrees to satisfy the highest heating demand - take losses into account, and the 85 degrees I was originally considering don't sound too far off

Again, I'd appreciate if someone could double check my math here.

Also, what does that mean for my water heater? I'm seeing that most of them rated somewhere between 30,000 and 60,000 BTU/h - seeing how my need should be around 4000-5000BTU/h, and taking the energy factor of 0.6 of most gas water heaters into account, I shouldn't need more than 7000BTU/h in gas input during the coldest outside temperatures.
My guess is, to prevent short cycling as Vlad and AC_Hacker mentioned, that I should go with the lowest rated water heater in terms of energy input, that I can find. The 75,000 BTU tankless I mentioned would definitely not be a good choice - a 35k BTU tank water heater would probably do the trick nicely. Any thoughts?

I think you put to much brain power to determine your heat demand. It doesn't really matter. If you have right controls you will only use just enough heat. Rest of heat will just be stored.

It is easy.

1. You should determine your highest temperature needed for your heating system. Let's assume you need 100F.

2. You have to check the lowest temperature your HWT can operate. Let's assume you will use regular DHWT (non condensing one) and set its thermostat @ 120F.

3. Thermostat will cycle on/off 120F-140F or 120F-130F or something close to this.

4. Now you have your heat source @ 120F-130F. If your HWT capacity 50000BTU or more or less and you only need 5000BTU your HWT will just seat and do nothing. If suddenly you need 40000BTU your HWT will start/stop more often.

I can't build my own control system so I used stock controls. I used taco 2 way mixing valve with outdoor sensor.
http://www.pexsupply.com/Taco-I050C2...Valve-w-Sensor
It allows to modulate floor loop temperature according to outside temperature. The colder outside the warmer loop water.

Also I added variable speed control for main circulating pump.
http://www.pexsupply.com/Tekmar-157-...peed-7955000-p
I put one temperature sensor on supply and one on return at manifold. I set 5F TD between supply-return.

Now mixing valve determines loop temperature according to outside temperature but often if you cook or outside cold but sunny day you don't need much heat. In this case TD will go down(if heat is not needed hot water can't loose it's temperature and return temperature goes up this lowers TD) and pump control will slow it down to keep TD @5F. If pump works at lowest set speed for set amount of time pump control will stop it for 5 min and restart it after.This is new cycle.

This 2 systems allow precisely control heat demand for house. It doesn't matter if my HWT is 40000BTU or 75000BTU my system allows to take just enough heat.

Last edited by Vlad; 09-24-12 at 03:11 AM..
Vlad is offline   Reply With Quote
Old 09-24-12, 09:02 AM   #25
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default

Quote:
Originally Posted by Vlad View Post
I think you put to much brain power to determine your heat demand. It doesn't really matter. If you have right controls you will only use just enough heat. Rest of heat will just be stored.
Vlad,

Thanks for posting your approach to heat sizing, your method is really appropriate and can only come from much experience... this is a very valuable insight.

But, at the same time, I think that opiesche is really on to something here... He is trying to determine the total thermal response characteristic of his house, which could be expressed in a simple mathematical expression... this could have utility far beyond just heating his house against the winter cold.

Best,

-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 09-24-12, 11:10 AM   #26
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
Default

Quote:
Originally Posted by opiesche View Post
Another quick update: After building a temperature logger with a Raspberry Pi, a couple of digital temperature sensors, a bit of wire and a few dozen lines of Python code, I now have proper temperature data to share!
I have a similar project underway, for which I was planning to use an Arduino datalogger I got HERE.

On the plus side, it can store oodles of data and best yet, it works right out of the box. On the minus side, it doesn't talk to Ethernet... bummer.

I'm stringing 1-wire temp sensors in every room of the house. I don't heat the entire house, so I'm trying to get information on how the heat affects unheated areas as it passes on to its final destination... the great heat-sink in the sky.

I have five sensors functioning, but still have three sensors to hook up, which will include outdoor temp logging.

Right now, I'm using the CAI board that Xringer discovered, which has some interesting features (web server, email sender, alarms, some programmability, humidity reading ability) and it just may ultimately do the trick.

But I am closely following what you are doing here, with your logger.

What exactly are you using to plot your data? I've been using Excel... it's powerful, but requires a lot of intervention just to get simple plots. Life should be less difficult.

Best,

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

Last edited by AC_Hacker; 09-24-12 at 11:12 AM..
AC_Hacker is offline   Reply With Quote
Old 09-24-12, 01:01 PM   #27
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by Vlad View Post
This useful post will get lost very soon. You should start separate thread with name like "automated control system, code..." or whatever you think it should be . It is a really a big deal for most people to get sophisticated control system especially one that you can control from your computer....

I found many not expensive mini boards on eBay but they all require some sort of programming.

Good point! I'll start a new post for this as soon as I've got everything in a usable state
opiesche is offline   Reply With Quote
Old 09-24-12, 01:10 PM   #28
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by Vlad View Post
I think you put to much brain power to determine your heat demand. It doesn't really matter. If you have right controls you will only use just enough heat. Rest of heat will just be stored.

It is easy.
...
4. Now you have your heat source @ 120F-130F. If your HWT capacity 50000BTU or more or less and you only need 5000BTU your HWT will just seat and do nothing. If suddenly you need 40000BTU your HWT will start/stop more often.
...

I see what you're saying - clearly, any system will only use as much heat as it needs based on turning on or off the circulator; what I'm getting at with the calculations is to figure out how much heat I'm going to need in the first place to properly size the heater. If I have a 75k BTU water heater with only 5k BTU of heating demand, the water heater is much more likely to switch on and off all the time (short cycle), as it inputs much more heat than is needed to reheat the water back to target temperature.
The most ideal setup would be a heater that uses exactly the amount of gas needed to heat the water to target temperature. Of course, all water heaters are either on or off in terms of firing, so the higher the rating of the water heater, the more likely it is to short cycle.

For example a 75k BTU water heater with 5k BTU/h of heat loss, will turn on and off so frequently that it'll only be on a little more than 6% or so of the time. This presents a problem because of the mentioned efficiency loss through short cycling, so choosing a water heater with a rating as little as possible over the demand should increase efficiency (and save money).
Am I making sense?
opiesche is offline   Reply With Quote
Old 09-24-12, 01:45 PM   #29
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by AC_Hacker View Post
Vlad,
He is trying to determine the total thermal response characteristic of his house, which could be expressed in a simple mathematical expression... this could have utility far beyond just heating his house against the winter cold.
Yes, I'm hoping this will prove useful for other things - like I've already seen that I should install some radiant heat barrier in my attic to reduce summer heat gain

As for the heat loss calculations I'm doing, these are primarily about

-sizing my heater properly to get the best efficiency I can

-find out what water temperatures I'll need to reduce experimentation

-find out what flow rates I'll need (I'm still working on that) with a given water temperature, so I can pick the right circulation pump

-make the system smart enough to turn on and off the pump at the right times, maximizing efficiency and keeping temperatures comfortable

The last point goes further than just setting parameters and forgetting - the controller should be able to adjust to changing exterior temperatures because it knows the relationship between heat loss and temperature difference (which follows a simple equation I'll be able to generate from the heat loss data once I've got a few days worth).
It can also learn the delay of the system when it turns on the pump, and make a decision based on that information to turn the pump on sooner or later - that timing will change with different i/e temperatures and current heat loss, and if it does it right, efficiency of the system can be further increased (the later I can start turning on the pump, the later the water heater will need to fire, further reducing short cycles of the heater).


Once I've got all the data and formulas right (I can verify them on my own system), I'm hoping to put everything into an SD card image for the Raspberry Pi for people to use and extend. Then anyone could solder a few wires together, leave a small box running for a couple of weeks, input a few values (floor area, heating loop density, air volume, etc) into a web site, and have the software spit out a range for flow rates and water temperatures to pick the right heaters and circulation pumps - all for less than 50 bucks in parts
opiesche is offline   Reply With Quote
Old 09-24-12, 02:05 PM   #30
opiesche
Helper EcoRenovator
 
Join Date: Jul 2012
Location: Rohnert Park, CA
Posts: 99
Thanks: 4
Thanked 14 Times in 9 Posts
Default

Quote:
Originally Posted by AC_Hacker View Post
I have a similar project underway, for which I was planning to use an Arduino datalogger I got HERE.

On the plus side, it can store oodles of data and best yet, it works right out of the box. On the minus side, it doesn't talk to Ethernet... bummer.

I'm stringing 1-wire temp sensors in every room of the house. I don't heat the entire house, so I'm trying to get information on how the heat affects unheated areas as it passes on to its final destination... the great heat-sink in the sky.

Right now, I'm using the CAI board that Xringer discovered, which has some interesting features (web server, email sender, alarms, some programmability, humidity reading ability) and it just may ultimately do the trick.

But I am closely following what you are doing here, with your logger.

What exactly are you using to plot your data? I've been using Excel... it's powerful, but requires a lot of intervention just to get simple plots. Life should be less difficult.
-AC
Very interesting - I was thinking about using an Arduino, but the ease of setting up and programming the Pi (and the fact that it goes for $35) has completely sold me on it. I'm usually more of a C++ guy as far as programming goes (software engineer by trade), but being able to quickly whip something like this up in Python and take advantage of its facilities to easily wrangle data from text has some real perks.

For plotting, I use MatPlotLib (matplotlib: python plotting — Matplotlib 1.1.1 documentation), a really full featured Python library. With it and a couple other pieces of freely available code, I can read data from .csv files into arrays that can then be directly used to generate a plot and save it to an image file. The code for this is really simple, as you'll soon see. The images are saved directly to the web server directory, from where I can grab them from any web connected machine (the plot images in this thread are pulled live from the Pi's web server).

As for the data amount, it's really less than it seems. The .csv files for each day are only about 6kBytes in size, the .PNG images about 55k. With a cheap 4GByte SD card in the Pi, I could store 100 years of data and still have room to spare.

I'd like to put additional sensors on it as well (at least one upstairs, one downstairs, and one outside), and will have to experiment a little with the maximum wire length. I'm using the DS18B20 sensor (also Dallas 1-wire) - do you have any idea how long the wires can be before you start getting problems with signal degradation?

opiesche is offline   Reply With Quote
Reply


Tags
diy, flooring, heating, hydronic, radiant

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 03:00 AM.


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