Converting my "ancient" thermostat to a connected, HomeKit-enabled thermostat
Recently my girlfriend and I have decided that we want to buy our own house and we have started looking at houses too.
That's why I've shelved this project, because I can probably buy a solution that works out of the box once we have our own place (and hack on that).
For those interested in the EAGLE part I made based on the original PCB, look at my GitHub repo: itavero/eagle-parts.
Note that you can not really use this with the free version of CadSoft EAGLE, due to size limitations in the board editor.
Just a quick update on some of the work I got done on this project last week.
Before starting this project, I had never heard of latching relays, so I wasn't sure what would be the best way to control/drive them. I decided to read a few application notes (I could find just a few using Google), but they were pretty generic so I still didn't know which way to go. That's why I ended up following the traces on the original PCB of the Chronotherm thermostat and reverse engineering how they control the relay.
This is the part of the schematic that actually drives the relay. I'm not yet sure about the signal I called RELAY_EN? but I assume this was done to save power (only driving one PNP, instead of two, when the relay is not operated). As you can tell I replaced the components with modern, SMD components, where possible.
Next up on my to do list for this project is figuring out how the keypad matrix is used. For this I'm planning on desoldering the flat cable connector and replacing it with a pin header. That way I can put the flat cable connector on a breadboard and have my logic analyzer (a Logic Pirate) connected at the same time.
I opened up EAGLE and added a new package to one of my libraries, grabbed my caliper and started measuring. First I traced the outline of the board, so I could measure other positions relative to it. I ended up with the following "package".
Ofcourse, once I had drawn it, I printed it out on a 1:1 scale and compared it to the original PCB. After that I was pretty confident that the drawing was accurate enough to use.
I looked on PCBShopper.com (a price comparing site for PCB manufacturers, very useful!)) and noticed that, given the dimensions of the board, it was gonna cost me about €30 to €40 to get some boards made with these dimensions. Even though I had plenty of budget from Altran, it still felt like too much, just for a prototyping board that is destined to be replaced after I had analyzed the signals.
Another great thing about working for Altran, is that we have our own hackerspace, called the Altran Innovation Lab. It is a place ran by colleagues, especially created to work on your personal projects. The goal is to provide the employees with tools that they generally would not have at home and also to create a place where you can interact with your colleagues and learn from them. Besides some basic equipment like soldering stations, hot air stations, power supplies and measuring equipement (oscilloscope), we also have a laser cutter, 3D printer and a CNC mill. The CNC mill really sparked my interest because of this project. I remembered that when I was still going to the university, some students from other departments were milling their circuit boards.
I ordered some clad material and I started designing a single layer board, based on the drawing created earlier, with a large dual row pin header to which I could connect a flat cable. After some time struggling to get the traces just right and finding a place for the connector, I was satisfied with the design and the real work began.
By real work, I mean, getting from EAGLE to the CNC mill. None of my colleagues had done it before, so they could not really advise me. Most of them recommended me to use vCarve, because the Innovation Lab has a license for it and it works well with our CNC mill. Unfortunately performing a web search for EAGLE and vCarve, did not yield the results I was hoping for. I did find more people looking for an easy way to do this, but I did not find a real answer or guide on how this can be achieved.
I reckon almost a month has past now since I finished the design for the PCB. I've tried several options in EAGLE to export a vector image and later on import this in vCarve. Unfortunately the results in the preview generated by vCarve did not look promising at all. Most of the time the alignment of the different "layers" (traces, drills, outline) was off or parts had been imported in a weird way. I also tried FlatCAM, but I quickly got lost in that program too. Perhaps CNC milling is just not for me (yet)... ;)
Since I really want to move on with the project I recently decided to just order a PCB from a manufacturer. I will probably adjust my board a bit before ordering it. Hopefully I can design it so that I can mount a smaller PCB on it easily (instead of having another large and expensive PCB manufactured). I'm also thinking of already putting some of the components on the board, like the relay and some sensors.
First thing I did when I decided that this was going to be my next project, was look on Marktplaats (a very popular classified ads website in the Netherlands) too find the exact same thermostat as was already installed in the apartment. That way I would have a thermostat that I could tear apart and my girlfriend would still be able to regulate the heat in the apartment. A lot of people were offering the ChronoTherm III for sale, but most of them where too far away or were asking ridiculous prices (over €20 for an "ancient" piece of hardware). Luckily I found I guy that lived within 15 minutes from my home that would sell it for €5. Now that is more like it.
I opened up the thermostat to inspect its guts. It had a single-layer PCB in it with only through-hole components on it (as to be expected given the age of this thing).
In the picture above you see the back side of the PCB, with the proprietary chip manufactured by NEC for Honeywell and the LCD "zebra" connector just above it.
And here's a picture of the front of the PCB. Some battery clips on the bottom. Some screws that can be used to adjust some settings of the thermostat. Left to the screws and right to the green capacitor, you'll see the connector for the flat-cable that is connected to the buttons of the thermostat. On the left there is a yellow relay, that is connected to some of the metal tabs on the top, which provide a connection to the wall mount adapter.
I followed some connections on the board, but I quickly noticed that I was not going to be able to reverse engineer the system, just by looking at the connections. One of the reasons would be my limited hardware knowledge, another being the proprietary IC at the heart of the system and besides that I already noticed that both the buttons and the LCD where connected using some kind of multiplexing. I could safely make that conclusion given the fact that the thermostat has 15 buttons, yet the flat cable only has 8 connections. Same goes for the LCD, it has way more segments than there are connections on the zebra connector.
The question now was: how to continue? Well, I figured to recreate the PCB. And by recreating I mean, making a package in CadSoft EAGLE with the dimensions of the PCB, the different holes and cutouts in it and the external connections. I'll write about that in my next log.
I'm a software engineer working at Altran Intelligent Systems. I reckon Altran is best described as a consultancy firm, even though we do other stuff than plain old contracting/consultancy. My job allows me to see lots of different clients with different problems/challenges, which is definitely something I like. Altran also motivates its employees to get better at their job. Not just by allowing you to follow lots of trainings, workshops and conferences, but also by giving you a yearly budget to spent on your personal projects.
Some time ago, when I was still living at my parents, I had the idea of ripping the thermostat apart and redesigning the thing so I could control it remotely with my smartphone. Of course, since it was my parents home, I was a bit hesitant to do this and since I had tons of other ideas, this one got put in the fridge.
However, since January I'm living together with my girlfriend, so now I have my own thermostat to ruin. And, coincidentally, I also happen to be working for a client since October that is in the thermostat / home comfort business (they are pretty well-known for their round thermostats). Let's say, it wasn't hard to come up with a project that I'd want to spend my budget from Altran on this year.
Initially I thought of putting smart. radio-controlled, thermostatic radiator valves in the entire house. That way I could control the temperature per room and only turn my central heating system on whenever there was a demand in any of the rooms. But since my girlfriend and I are renting a place, I did not want to change too much. Unfortunately all the radiators had plain-old valves. Installing thermostatic radiator valves would mean changing part of the plumbing, which was way above my head and not what I was planning for.
So I went back to the original plan: rip the thermostat apart and give it some new guts. Actually, it was exactly like my original plan, because the apartment had the exact same thermostat as my parents had: a Honeywell ChronoTherm III.
I will update you through these project logs. I already started the project some time ago, but did not yet find the time to document my progress somewhere. The next few updates will probably be "flashbacks" of what I've already done so far.