I have been monitoring the temperature in my house using 1-wire sensors for some time. The easy way is to get a T-Sense and a LinkTH from iButtonLink. That would set you back $70 plus $15 per additional temperature sensor.
There is a cheaper option and that is to build the sensor adapter yourself and to base it on software that can send data on the 1-wire network with the require timings for the 1-wire protocol. Digitemp is a free application that can do this for Linux computers. This post is not about digitemp but rather about how to construct the hardware.
It only takes four diodes and a resistor and it is actually quite possible to make everything fit inside a D-Sub connector. The schematics is shown above. Note that only four of the nine pins on the connector are wired and to avoid any misunderstandings those four pins are 2 (RXD), 3 (TXD), 4 (DTR) and 5 (GND).
One note about how to connect the sensor. The ground and signal pins should of course be connected with the corresponding pins from the serial port according to the schematics above. In addition to that, Vdd must not be allowed to float so it should be connected to signal ground.
Here is a bill of materials for this construction. The article numbers are from Elfa, a Swedish distributor. The total cost for a sensor with a three meter cable runs at 137 SEK which amounts to roughly €12 (tax not included).
|6.2V Zener diode 1N5234
|D2 & D3
|Schottky diode 1N5818
|3.9V Zener diode 1N5228
|D-Sub 9 poles female soldered
|Cable LiHCH 2×0.25mm2
|Heat-shrinkable tubing 4.8mm