8 ms·
I've been running homemade HVAC control for 12 years now. A few points: 1. Have "can't fail" safeties. In my case, that's the existing thermostat in parallel
by MarkusWandel 6y ago
I've been running homemade HVAC control for 12 years now. A few points:
1. Have "can't fail" safeties. In my case, that's the existing thermostat in parallel with the relay (so that the house can't freeze up if my system fails) and a second extra thermostat in series with it (so that if it fails stuck on, things won't overheat too badly). The second safety thermostat can be out of the way, like in the basement.
2. Assuming you live in a northern area and have a furnace that's less than a decade old, it may well be a two-stage (i.e. high and low heat mode) one set up for autostaging (run on low for 5 minutes, then fire up full blast) because the installers were too lazy to fish the extra wire to run a proper 2-stage thermostat. My homemade system has a 0.3 degree Celsius difference between the low and high stage cut-in, plus some hysteresis to avoid short cycling, and it keeps the temperature wonderfully stable (within 0.2 degrees of the set point) with the furnace only ever switching to high if you turn up the temperature (on the very most brutally cold winter days it might run almost continuously on low). At least here in Canada, installers have to leave the technical manual with the furnace, so you know which DIP switch or jumper to change to disable autostaging.
3. Mechanical thermostats have something called an "anticipator" which slightly warms the sensing element as the furnace runs, so it tends to turn off below the set point. This is to avoid overshoot. Digital thermostats do it in software by pulse width modulating the furnace enable as the temperature nears the set point. In my case it's completely unnecessary to code this up - I guess the thermostat location is just perfect - but if you do get overshoot, just simulate it in software.
4. AC units can be damaged by short-cycling and sure enough an early version of my system had a bug that caused this. Luckily I noticed right away. Now it's full of safeties like minimum run and rest times and probably much more conservative than a real thermostat. Longer AC run times are better for dehumidification anyway. I also enforce minimum run times on the furnace.
- frenchie4111 6y agoGreat tips! I am already doing the parallel with current thermostat (I don't trust my system at all). I will look into the other things as well, maybe I'll add them in my v2.
- ghaff 6y ago>Have "can't fail" safeties. This is one reason why I've never gotten anything more complex than a simple Honeywell programmable thermostat. I haven't felt a real need but I also just don't trust "smart" thermostats not to fail off in the winter which can be a really serious event if you're not around (and I normally travel a lot). There are other failure modes for heating of course but I absolutely don't want to introduce another one for no good reason. (I don't have AC.)
- Normal_gaussian 6y agoThis is my bugbear. All my smart systems are 'who cares'. I really want security, heating, and cooking to be smart as I have specific use cases but I don't have the time to Engineer the systems how I want them. Its particularly annoying as I have all the skills!
- jjeaff 6y agoI have found that regular smart wifi thermostats like those also made by honeywell fail just fine. I had a wifi honeywell for several years and eventually the wifi portion died. But the rest continued to function just fine. If whatever you have does die in the dead of winter, you can always remove the thermostat and short the common and heat wires together.
- MarkusWandel 6y agoYou can get an old school mechanical thermostat as a backup. I've suffered a total frozen house disaster in a past place - most of the plumbing wrecked - because of a heat failure during the Christmas break (gas valve in that case though; a mechanical thermostat wouldn't have helped). That's what started the obsession with remote temperature monitoring - I was into DS18B20s before they were cool - and from there it was only a little bit more hacking to just take control as well (so I can control it over the internet the way I like it - ssh!)
- ghaff 6y agoI have a couple different temperature monitors. Of course, doesn't necessarily do a lot of good unless I can get someone to do something. And that may not be possible if they're not around or if there's not anything they reasonably can do. As in your example. But I did get an alarm on a trip a couple years ago and texted a neighbor and she was able to tell me the power went out but it was going to be back soon. Of course, backup generator is an option but it's expensive to do right and unsupervised.
- upofadown 6y ago>Have "can't fail" safeties. I am lucky enough to have a couple of mercury thermostats for this purpose but I don't think I can get any more of those at this point. New "mechanical" thermostats tend to be actually electronic, some with a embedded battery that will eventually go dead.
- MarkusWandel 6y agoTry thrift stores / Craigslist / Kijiji / garage sales (after COVID anyway) and of course secondhand building supply stores like (here in Canada) Habitat for Humanity Re-stores. Those things are everywhere. Bonus points for finding a round Honeywell. Another trick that works (I used that to get a replacement panel for a no longer made garage door) is just call up the outfits that install them and offer them a reasonable sum for a "pull".
- labawi 6y agoWe had issues with uneven heating and large temperature swings, so I fixed it with simple (though case-specific) logic: while True: if temperature < set_point: heat for 15min wait for 15min Works wonders, consistently, even with differing types of radiators and no need for fancy PID/control loops. Measured temperature is a 5-min median, otherwise nothing fancy, except a bit of safeties¹. Didn't bother with accessible controls - temperature adjustment of cca 2-3K can be made by raising/lowering the temperature probe. ¹ Contains a secondary probe, in a different room for safety. Doesn't heat if any probe above it's maximum setpoint, 50% duty cycle is not too bad and there usually is someone present. Median is considered valid only if data is available for each minute.
- MarkusWandel 6y agoHydronic heating systems (i.e. hot water and radiators) are a whole different ballgame from warm air - much slower to respond. But the beauty of homemade is that you can just come up with an algorithm that works for your house, by trial and error!
- war1025 6y agoIs the wait supposed to apply both to the if and else? Or does it really busy wait for the temperature to drop? Seems like that would be really inefficient, but maybe that's common practice in embedded software stuff.
- CyberDildonics 6y agoI don't think that's the actual program
- war1025 6y agoWell, yes. That seems obvious. I guess I was more wondering if running in a busy loop like that was a thing people did on embedded hardware since from my very minor experience with Arduino it is basically just a big while loop.
- war1025 6y agoThought this was a really interesting comment. Looked at your profile, which led to your website, which had a page about your family, which said you had a brother named Matthias, which tickled something in my head. Clicked on the rather dated link and saw a familiar face. I don't really follow the woodgears website that much, but I've heard it mentioned here several times. Anyway, I thought that was a neat connection to make. What inspired you to build your own thermostat? What sort of hardware is involved in that?
- MarkusWandel 6y agoIt's changed over the years. Currently it's an Arduino Mega2560 with custom stuff to talk to the 1-wire sensors (not just bit banged) and the ubiquitous 8 relay board for output. But the actual thermostat logic is on my main Linux server machine. Yes, if my server crashes my heat goes down, I'll fix that some day, but it never does crash so it's run like this for 12 years. The original setup used owfs for input and output, but it was never completely stable that way. Why? Because my bog standard 7-day programmable thermostat did not have the "turn the heat up in two weeks just before I come back" functionality. Back in 2008, if internet programmable thermostats even existed, they had the same suckage - only works via proprietary cloud stuff. Yech. I just want "turn up the heat", and I want it my way. The web interface is a HTML form with a single input box that says "Temperature". Programmable thermostat stuff is crontab entries.
- analog31 6y agoIndeed, and it's worth noting that a solid state or mechanical relay can fail in either the On or Off position, so you have to consider both possibilities.
- lmilcin 6y agoMore safety: always have physical NC relay in series with SSR for any AC application. SSRs are super fun and useful. They are quiet, can be switched 100 times a second if you want more than just on/off control for your heating element and they won't wear out. But they also leak current keeping the equipment under AC voltage even if not powered and have nasty fault mode where they just fuse and conduct as a very efficient short. The physical relay fixes both problems. I typically have current sense on SSR output so that my controller can compare output from SSR with what was supposed to happen and signal fault if the SSR becomes a very good jumper. So the SSR is only ever connected when the controller decides it should.