Tuesday, July 16, 2013

Central Heating - Decoding

After staring some time at the logic capture of my central heating, I was able to decode the way data is encoded by the unit.

The smallest unit in the capture is 6.80ms. It takes 4 units to make up 1 bit/symbol, not exactly a high speed bus. There are 3 different patterns that show up in the cap:

 MARK MARK  SPACE SPACE
 MARK SPACE SPACE SPACE
 MARK SPACE MARK  SPACE

The transmission has 56 of these patterns, followed by a silence period. This means that each transmission totals 7 bytes. I used the arduino to decode this sequence and output the result on the serial. The MARK SPACE MARK SPACE pattern is decoded as a set bit, while the other 2 decode to a 0 bit. I have no clue as to why there's 2 patterns to indicated a zero, ie. MARK MARK SPACE SPACE and a MARK SPACE SPACE SPACE, maybe it has something to do with providing the remote unit enough power to load up it's internal capacitor, since that unit is completely powered from the 2 wire bus.

I found that to debug the timing of the code, it's quite useful to use an extra IO pin on the arduino, hooked up the the 2nd channel of the oscilloscope and then toggling the line when something goes wrong. By displaying both the CV signal and the debug channel signal on the scope, it was quite easy to see where the code lost track of the signal.

After some fiddling, this is what I got out of the signal: 

26 66 74 24 02 7B 0A    0010_0110 0110_0110 0111_0100 0010_0100 0000_0010 0111_1011 0000_1010  
60 66 75 FF FF 00 20    0110_0000 0110_0110 0111_0101 1111_1111 1111_1111 0000_0000 0010_0000  
26 06 77 FF FF 00 20    0010_0110 0000_0110 0111_0111 1111_1111 1111_1111 0000_0000 0010_0000  
60 FF 76 25 02 78 0A    0110_0000 1111_1111 0111_0110 0010_0101 0000_0010 0111_1000 0000_1010  


The communication gives 4 sets of 7 bytes, then repeats. Now it was time to play with the heating and see which values changed...

No comments: