It looks like the OpenTherm gateway is sensitive to noise and wiring lengths. All my attempts to move the gateway upstairs, next to the boiler/heater, failed. Somehow, this:
THERMOSTAT <=> GATEWAY <=> 10 m wire <=> HEATER
… is not the same as this!
THERMOSTAT <=> 10 m wire <=> GATEWAY <=> HEATER
The OpenTherm documentation (PDF) specifically allows up to 50 meters of untwisted wiring, but I’m clearly running into some issue here.
Time to drag the scope downstairs and hook it up between gateway and heater:
The yellow trace is the voltage between the two wires, while the blue trace is the current through those wires. I used a 1 Ω resistor and measured the voltage drop, but had to switch to the most sensitive scale (since I’m using the standard x10 probe), hence all that noise.
Still, you can see the magic of the way the OpenTherm protocol works:
- in rest, there’s 6V between the wires and about 6 mA of current flowing (a 1 kΩ load)
- this is used by the thermostat to power itself (by keeping a capacitor charged)
- when the thermostat sends data, it briefly reduces its current draw
- since the boiler (or gateway) is feeding a constant current, this makes voltage go up
- that voltage change is then detected and decoded by the boiler / gateway
- about 40 ms later, the boiler / gateway then sends a reply
- it does this by briefly forcing more current down the wire
- this in turn can be detected by the thermostat, which then decodes that reply
- there’s a small residual ripple, as the thermostat tries to maintain its 7V idle level
I was going to perform the same measurement on the other side of the gateway, i.e. the connection to the thermostat, but for some reason the gateway really doesn’t like me touching anything or connecting any wires to it (let alone a grounded scope probe). Maybe some noise is picked up and feeding back into one of the PIC’s I/O pins, and completely throwing it off. Luckily, the whole gateway always resets properly when left alone again.
I also sometimes see the thermostat indicating a fault (even just by touching the wire with the scope probe) – so it seems to be getting some power, but it’s definitely not happy.
Maybe the gateway’s output circuit is too sensitive, due to some high-impedance parts in the circuit? That would explain why even just using some long wires two floors down prevents the gateway from working.
Hm, not good – especially since I only wish to monitor the wire, not control it…
Update – these problems are caused by a floating ground. More on this once I get it all sorted out. With many thanks to Schelte Bron for dropping by and helping analyse this!