Most of the i2c temperature sensing chips out there are SMT devices (like the one above). Not too easy for hobbyists like myself to deal with.
Since accuracy is not a big issue for central heating systems (at least not mine!) I decided to switch to using the Zilog XP These are microcontrollers which just happen to have temperature sensing built-in. With 8k flash, 1k ram, and internal 5MHz oscillator and C programmable they are very easy to use.
I looked on the net for i2c slave code, and found several implementations but didn't really like any of them. They seemed overly complicated for what I want. Instead I decided to implement my own - just advanced enough to talk to the linux i2c driver. It was necessary to put in a substantial clock delay for the i2c driver in order to communicate with my contraption:
insmod i2c-gpio-custom bus0=0,20,21,200
200 is the delay in uS. This is required because the i2c slave software works by polling. If it were re-implemented using interrupts it would be substantially faster.
The temperature sensing circuit is quite easy to make on stripboard:
The two pull-up resistors on the left are required by the Zilog Smart Cable for programming the device. The two on the right are the i2c pull-up resistors. I've added a reed-relay to take the place of the thermostatic switch that currently controls the heating, although the software doesn't allow linux to control it - yet.
I added screw terminals to my router using the tried-and-trusted method of Aralditing a terminal block to the board:
Note that I've seperated the temperature sensing module and router for good reason: The ADM5120P processor generates a substantial amount of heat and would influence the readings. The Z8 Encore XP microcontroller also generates heat that affects the readings, however it's normally cold to the touch even at 5MHz so I believe it won't be too much of a problem.