Arduino based thermostat
As of today I am the proud owner of an Arduino Duemilanove:D Woohoo!
One of the things I'd like to do with it is to replace our thermostat. Not that the one we have is bad (it's saved us a LOT on heating bills since I installed it 3 or 4 years ago), but there are a few things I'd like to change. Some of these things are available in more expensive models, others could be worked around with a second or third t-stat, but I'd like to keep it simple and cheap, plus I like the challenge:) I'm sure that I'm not the only one who would like to have a thermostat tailored to her/his house and individual heating&cooling needs, so I started this thread so that we could all pitch in our wants, ideas and expertise to get this project going. I'll start by describing what my t-stat does, then vaguely what I'd like it to do. I'd like others to do the same to give ideas about functions I may not have thought of. Any help with algorithms or even arduino code is very welcome. My thermostat has only two programmable temperatures - night and day - with resolution 0.25°C. The programs are broken into 24 one-hour intervals, and only three programs are user-adjustable. There are also a few programs hardwired into the unit (always day temp, always night temp, always above 7°C, etc.). The program we use most is day from '0900' to '2100', night from 2100 to 0900. If I want to change the temperature, for example the house will be empty between 1700 and 2000, then I can press the 'night' button and it will hold night temperature until the next change in the program's settings, or I can set the night temp for X hours, after which the t-stat resumes whichever temperature the program now calls for. This is better than a basic t-stat, manual or analog, but doesn't always allow me to fine tune it the way I want, so here is my wishlist:
Bonus question: I know that certain high-end thermostats measure outdoor temperature, but how is that information used while heating/cooling? EDIT: This just crossed my mind for something more advanced: A sensor to monitor whether the sun is shining, then adjust the set on-time accordingly. Also, measure humidity and adjust heating/cooling to perceived temperature (heat index). |
Woo, cool project! Congrats on being an arduino owner. They're SUCH nifty devices.
It does sound like your thermostat is a bit limited compared to the ones I've seen. The ones I've seen/used are either a 5-2, 5-1-1, or 7 day thermostats. With the 5-2 you have one program for the weekdays and one for the weekend. The 5-1-1 gives you a program for the weekdays, one for Saturday and one for Sunday. The 7 day gives you a different program for every day of the week (and usually includes some way to copy to make programming easier/faster). Each program has four time points which can be adjusted in 15 minute incriments. At these points you select what temperature you want the house to be and thats what it aims for. That is the basics of it. If you wish to override the programming you can easily just push the up/down arrow buttons to adjust the temperature. It'll stay at that temperature until the next time point. If you wish to hold that temperature indefinitely you push a 'hold' button and it keeps that temperature until you push the hold button again. Some thermostats will allow you to adjust how much sway in temperature it'll allow. Most are set I believe to 1F. So, if you have a room set to 70F, the furnace/boiler will kick on at 69F and increase the temperature to 71F. You can adjust it to increase this temperature sway to reduce short cycling of the furnace/boiler. I think the outside sensor is more so for heat pump applications and/or hydronic floors that have a high thermal mass. Both of these heating systems take time to get heat into the house and if there is a sudden drop in outside temperature the thermostat can kick the heating system on before the house temperature actually starts to drop. A photoresistor would be a cheap and easy way to see if the sun is shining on the house. You could allow another degree or two drop if there is a strong sun and you know it'll start heating up the house without the furnace perhaps. I know that would work nice for something like my attic heat fan. I'll definitely have to think more about this though. Its a very cool project. |
I believe my thermostat uses the outside temperature to decide when to switch from the heat pump to the electric furnace.
I use the outside temperature measurement to decide when to light the fire. |
outdoor temp sensor
Other systems that use an outdoor temp sensor, use that sensor to adjust how hot the boiler runs. My system has a few zone thermostats and one on the boiler itself. I could replace the thermostat on the boiler with one that auto adjusts based on outside temp.
The colder it is out side, the faster the house loses heat, the hotter the boiler runs. |
Quote:
Something that came to mind today is to adjust the set room temperature as a funtion of outdoor temperature. During the coldest days, when day/night temps would be as low as -20°C/-30°C (-4°F/-22°F), the boiler would be on almost nonstop struggling to reach the set daytime temperature of 18°C/64°F, so I'd manually set the nighttime temp (16°C/61°F) for 24h to allow the system to turn off every now and then. Since the radiators never had time to really cool off, then there was lots of radiant heat to make up for the cooler air temp, so it wasn't too uncomfortable. The "thermoduinostat" could be programmed to automatically lower the daytime (and maybe nighttime) temperature to ease the thermal loss when it's really cold. |
Any updates on this? I think its a very interesting project.
|
Quote:
|
After a year of having too many more important things to do, here is an update.
- I gave up fiddling with analog and switched to digital (DS18B20) temperature sensors. - I'm still experimenting with the humidity sensors. - I got a shift register to be able to control it with buttons, but so far I'm still changing parameters via USB. - The LCD has been acting up lately, at present only the top row is displayed. - I got a relay and found out that it requires more current than should go through the Arduino, so I got another relay, this time a solid state one. - A month ago I finally got some time to write some simple code to keep the room temperature within 0.5°C of 17°C. In short, it checks the temp every 5 seconds and if it is below 17°-0.5°C (resp. above 17°+0.5°C) for 4 consecutive readings it (resp. de-)activates the relay. - It is hooked up in parallel with the normal room thermostat, with the latter set to a slightly lower temperature. The room t-stat is supposed to be a backup in case the Arduino t-stat fails, but also keeps a lower temp when I need it (I disconnect the Arduino t-stat then). - I have a clock function working well, but I still haven't implemented any programmable temperature changes. Any hints on how to do it? |
Woohoo I'm happy to see some progress here. :)
Quote:
|
I was thinking about some general ideas, eg which data types to use and how to implement them. Algorithms, not code letter-by-letter. Like should I make a table with 4 elements (4 times when the temp can be changed) and each table element will hold info of the time of change and the new temp. Or maybe records/structs/pointers/etc., which would allow the number of time changes to be variable? I'd also like a neat function which will tell me how long until the next temperature change, or at least if that time is < or > than 30 minutes, for example.
But I'll happily share the code I already have:) In pieces anyway, since the whole program is really messy at the moment: lots of unneeded stuff which hasn't been removed yet;) First, the clock function. It adds 1 second for every 1000ms that have passed since the previous call. If a second has been added, then the function returns value 1, else 0. This is not my idea, I got it from here. Code:
#define MAX_MILLIS_VALUE 34359738 Code:
#include <LiquidCrystal.h> |
All times are GMT -5. The time now is 01:23 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger