Computing stuff tied to the physical world

Tackling OpenTherm

In Hardware on Nov 18, 2012 at 00:01

Another project I’ve been meaning to tackle for a very long time is to monitor the central heating and warm water system. Maybe – just as with electricity – knowing more about what’s going on will help us reduce our fairly substantial natural gas bill here at JeeLabs.

The gas heater is from Vaillant and it’s connected to a Honeywell ChronoTherm – this is a “modulating” thermostat which automatically chooses its set-points based on the time of day and the day of the week. It all works really well.

The heater upstairs and the thermostat in the living room are connected by a two-wire low-voltage connection, using the OpenTherm protocol. There’s not that much “open” about this protocol, but people have hacked their way in and have discovered all the basic information being exchanged between these units.

A while back, I got a free PCB (thx, Lennart!) of a circuit by Schelte Bron, called the OpenTherm Gateway, and since all the required components were listed and easily available from Conrad, I decided to give it a go. Here’s the whole thing assembled:

DSC 4244

The documentation is very well done: schematics, parts list, troubleshooting, and more.

This is a “gateway” in that it sits between the heater and the thermostat, so it can not only listen in on the conversation but actually take over. Things you can do with it is to adjust the set-point (i.e. desired room temperature), feed in the temperature from an outside sensor, set the ChronoTherm’s clock, and probably more. I’m only interested in monitoring this stuff for now, i.e. reading what is being exchanged.

The gateway is based on an 8-bit PIC controller, and has some funky electronics to do its thing – because the way these signals are encoded is pretty clever: there are only two wires, yet the heater actually powers the thermostat through them, and supports bidirectional I/O (hint: it uses voltage and current modulation).

One little gotcha is that this gateway brings out its interface as an RS232-compatible serial port. And to my surprise, I found out that I don’t even have any laptops to read out these +/- 12V level signals anymore!

So the next task was to get things back into “normal” logic levels. Simple, although it’s a bit of a hack: remove the on-board MAX232 level converter chip, and insert wires to bring out the original 5V logic levels instead:

DSC 4250

(bare wire + green clip = GND, read wire + yellow clip = RX, white wire + white clip = TX)

Step two: hook it up to a USB-BUB, set to handle 5V logic levels:

DSC 4251

Step three: plug the USB cable into my laptop to pick up the data coming in at 9600 baud.

As you can see, this has wires dangling all over – just to check that the gateway works:

  OpenTherm Gateway 3.2
  T80190000
  B40193900
  T10010A00
  BD0010A00
  T80000200
  B40000200
  ...

Yeay, looks like we’re getting something! Coming up next: making sense of this data…

  1. Nice.

    I’m working on something similar at the moment. I took Schelte Bron’s schematics, and am now working on a PCB to connect it to either a JeeNode, an Olimexino-STM32 (which has similar connections as the arduino), or a Launchpad.

    I replaced the transformer with a connector for a 24VDC adapter though, I don’t like having mains power on my PCB ;-)

    It’s still a long way to go, but it would be nice to be able to both read and control my new gas heater ;-).

    • All sorts of new activities around OT, it seems! I’ve been contemplating making a wireless OT listener, self-powered – i.e. just insert between boiler and thermostat. Not sure about control – it’s relatively low on my (almost infinite) to-do list and could not easily be done without external power, I suspect.

  2. Interesting!! I spent 4 years on the opentherm technical committee, working for Glow-worm/Vaillant in the UK, Give me a couple of days and I’ll see what information I can get hold of. From memory the protocol is a simple 8 bit number as a ID and 2 sets of 8 bit numbers for control. One set from controller to boiler the other set as a response from boiler to control;er, ID’s 0, 1 are the most important, these set the control bits ID0 and ID1 sets your set point for your heating. ID 25 is Flow temp I think, but I’m working from memory, send me a message with your e-mail and I’ll see what I can find.

    Pete

    • Thx – yes, I’ve seen his site. Would be a good alternative for encoding/decoding what the PIC does in Schelte’s OT Gateway.

      PS. My setup is not working reliably yet (frequent thermostat resets), it might be an electrical problem.

  3. The stat is self powered, I don’t know if you’ve seen it yet, but the Boiler uses current to act as a data line and the stat uses voltage. So there is always a power source for the stat. I’d guess that is its resetting you may be holding the line low during monitoring which is could be causing the stat to reset. Has it ever reset when it was just the boiler and stat directly connected?

    Pete

    • No – works flawlessly direct on boiler. The gateway completely isolates the two current loops, and has its own power supply to do so. I can get it to reset even by just touching the link to the thermostat, so I suspect it’s either broken or has a very sensitive output circuit. Note that there’s no grounding in the gateway.

  4. I have been busy, although at low priority, with a self-powered version, which would wirelessly transmit every minute or so. I have a semi working prototype, the only problem is keeping the consumption of the JeeNode low, until enough energy has been harvested to boot it and get it in steady state. Same problem as the low power harvesting solutions of a few months ago. I have still to try to implement those in a JeeNode around here, to see if it then works. I think there is easily enough power on the line for that, around 5mA continuous. Not sure about a self powered listening only node, as that might significantly change the voltage levels on the line for the thermostat to still work. I reckon that “self-powered” must replace the thermostat completely.

    I am very curious to see what comes out of JCW’s labs!

    (I am the jaagpad.blogspot.com guy – there might be some circuit and code updates coming soon)

    • Hey Alex, nice to hear from you again. Note that sending out a wireless packet takes very little energy – even a 100 µF cap should be large enough to sustain one short blip per second. There may be a few challenges to get it all going, but the 5 mA power-budget should be sufficient.

      Haven’t made up my mind about the listen-only node yet. Maybe it’s not of much use to anyone, in which case I’d just build a one-off for myself. Or maybe I can get the gateway to work robustly after all – that would be the simplest way out, since it has already been built and hooked up.

      A much harder problem would be a self-powered gateway – that would need to include an efficient boost converter, I expect!

  5. You appear to have the same thermostat I do. I haven’t had any problems with it resetting spontaneously.

    Regarding making sense of the data: The otmonitor application on my site does just that. It’s a starpack and I doubt anybody knows more about that than you!

    • Hello Schelte! Yeah, I’m trying to find a way to nail down this problem. Am just guessing it’s resetting, since manual overrides seem to be lost after a few hours. As for Starpacks… coming up!

  6. In case anyone is interested in an OpenTherm Gateway PCB: I’m currently organizing a group buy (in rounds of 10 PCBs) on Domoticaforum Europe:

    http://www.domoticaforum.eu/viewtopic.php?f=15&t=7848&start=0

    Delivery takes approx. 4 weeks as they are made to order whenever a round fills up. Price is EUR 6,50 ex. shipping.

    If you are sure that you want one, register at Domoticaforum Europe and leave a reply to that topic (or a PM if you are allowed to).

  7. That shouldn’t be too hard to determine if you have some logs covering such an event. Feel free to contact me directly if you would like me to help you investigate.

Comments are closed.