|
|
![]() |
Introduction to 1-Wire networks
Hardware Each 1-wire device has a unique 16 bit address. When connected to a 1-wire bus, it is polled to obtain data from the sensor. This polling is derived normally from the interface between the bus and the PC. Depending on the sensor, there are two ways to power a 1-wire device: 1) Parasitic 2) External In parasitic power mode, the 5V required to supply the device is obtained from the DQ (data) wire. In this configuration, only two wires are required. It is important that when using this mode, you should connect the sensor's Vdd pin to its ground pin. In external power mode, a 3rd wire is used to supply 5V directly to each sensor and is recommended for large networks. Two of the most used 1-wire devices in home automation are the DS1820 Family for temperature and the DS2405 Family for input/outputs. DS1820 Family The DS1820 is the most common 1-wire temperature sensor used for home automation. Maxim (Dallas semiconductors) have recently stopped manufacture of this device but the DS18S20 is a direct replacement with better stability & accuracy. This also is becoming obsolete, being replaced with the DS18B20 which has programmable 9-12 bit output data resolution.
DS2405 Family This is a programmable input/output device which has limitless possibilities for home automation. This can be polled to detect something like a contact change or with minimal extra components, to drive a relay.
Data sheets for these two devices are available from the document library
on my home automation server. When running a 1-wire bus, Dallas recommend that you use unshielded CAT5 cabling for the bus. However if you have few sensors and short runs, telephone cable will work just as well. Do not use shielded cable as the capacitance increase will upset the network.
If you intend to have a large 1-wire network, it is important that you
design the network correctly, otherwise you will have problems with
timing/reflection issues and loss of data. For very small networks, it is
possible to connect each sensor in a star or radial arrangement. This means
that each sensor is connected via its own cable back to a central point and
then connected to the 1-wire to serial adaptor. However, it is strongly
recommend that you connect each sensor to a single continuous cable which
loops from sensor to sensor in turn (daisy chain). This will reduce
potential mis-reads due to reflections in the cable. Each sensor should have
a maximum of 50mm (2") of cable connected off the main highway. Even using
this method, connecting more than 10-15 sensors will still cause problems
due to loading of the data bus. To minimise this effect, always place a
100-120 ohm resistor in the data leg of each sensor before connecting to the
network. The choice of 1-wire to PC adaptors will also affect the
reliability of the network. As serial ports are now not so popular with motherboard manufacturers, the DS9490R addresses this problem by providing a USB interface or the S4 USB to 1-Wire interface.. Other interfaces include the HA7Net which provides a Ethernet to 1-Wire
interface These pins are actually in the same positions (so you can plug a RJ11 in a RJ12 socket) for both connectors but the RJ12 has six pins whereas the RJ11 only has four. RJ45 (standard network connectors) are the latest method to connect 1-wire devices: Pin 1 (White/Green) - Power return or ground (Cable colours assume the T568A network wiring standard)
S4 1-wire to USB converter
HA7Net
1-wire to Ethernet converter
HA7E
1-wire to serial converter One of the problems with these adaptors is that the critical timing
required by the bus is derived by the PC drivers and can put heavy load on
the CPU. As an alternative, Midon design have produced the TEMP08 which
takes the load off the PC by providing all the timing within its hardware
and just passing the information to the serial port when required. They also
produce a LOG08 which has built in logging facilities (even when the PC is
off) BUT does not support the reading of the DS2405 switches.
If you only wish to use 1-wire temperature sensors, then Quaser
electronics produce a kit that supports four DS18S20 sensors for interface to
a serial port. This company will also supply the DS18S20 sensors if required.
(This section describes interfacing with Homeseer's Home automation software only) Providing you have a DS9097U, 'THE LINK' or a DS9490R, the easiest way to check your network is to download the ibutton viewer and drivers. This will give you visual indication that all sensors have been detected and provide any necessary data readings from the sensor. If you only have a TEMP08 then you can check 1-wire functionality using a terminal program. There are several software solutions available for Homeseer users to read the 1-wire data. Michael McSharry has written the McsTemperature plugin which can read from all hardware devices mentioned. This is available via the Homeseer updater. He has also
written a xAP plugin for use with a DS9097U/DS9490 which can integrate with
any xAP application or plugin. This includes Homeseer, Misterhouse etc or
standalone via xAP desktop. |