View Full Version : One Wire Devices - How to...

November 11th, 2006, 07:08 AM
Hi All,

I have been asked a few times via, email, pm, im, and every other concevable means how to use and set up a 1-Wire device network, so here you go, rather than repeating myself and wearing out my keyboard I decided to put a short "how to" together here.

These notes are really a compilation of stuff on the net, my experience, and what both myself and Marcel have said before, here, other forums and in my case at work.

1-Wire devices a very simple to use. They, do have a few problems thou, which are easily overcome.

The advantages of these devices are that
They have simple wiring, either 2 or 3 conductors in a cable.
They have a unique serial number in each device, meaning that they can all share the same wiring bus.
They are cheap and widely used.You can find the original 1-Wire plugin thread by Marcel here (http://www.promixis.com/forums/showthread.php?t=12458&highlight=wire) and my device manager here (http://www.promixis.com/forums/showthread.php?t=14518&highlight=wire), which can be downloaded here (http://www.promixis.com/download.php?ID=976)

It would be advisable if you also ready this guide from Dallas on Reliable Networks (http://www.maxim-ic.com/appnotes.cfm/appnote_number/148). There is also a nice light intro here (http://www.btinternet.com/%7Ejon00/onewireintro.shtml), you may also find it interesting to see what Jon has been doing monitoring his electricity. He inspired me to do the same, you can have a glimpse of that here (http://www.promixis.com/forums/showthread.php?t=12830&highlight=graphs).

You are going to need to do several things to enable you to use 1-Wire devices with Girder 4 or Girder 5.
PC Connection Device i.e. DS9097U (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2983) or the USB equivalent DS9490 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3834) type device.
Marcels Driver availble via the link above or via his website (http://home.vianetworks.nl/users/mhwlng/)
1-Wire Drivers for windows available from here (http://www.maxim-ic.com/products/ibutton/software/tmex/index.cfm) or you can download the file directly here (http://files.dalsemi.com/auto_id/licensed/install_1_wire_drivers_v400.msi)
Optionally for temperature sensors, my device manager, link is above.Currently, using the 1-Wire driver you are able to talk to the following devices.
DS1820 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3021), DS18S20 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2815), DS18B20 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2812) and DS1920 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2818) Temperature Devices
DS2406 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2907) IO Devices, Example circuit can be found here (http://www.hobby-boards.com/catalog/product_info.php?cPath=24&products_id=1504).
DS2408 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3818) IO Devices, Example circuit can be found here (http://www.hobby-boards.com/catalog/links/lcd2-r1/LCD%20Driver%20v2.0%20Schematic.pdf).
DS2423 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2912) Counter Device, Example circuit can be found here (http://www.hobby-boards.com/catalog/product_info.php?cPath=23&products_id=42).
DS2890 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2934) Digital potentiometer
DS2450 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2921) 4 Channel Analogue Digital Converter, Example circuit can be found here (http://www.hobby-boards.com/catalog/product_info.php?cPath=24&products_id=1524).What this means is that we can sense temperatures, check device statuses via IO such as switches or relays, control devices such as relays or leds, count values, such as flashes (my electricity meter), or switch actuations, control an analogue voltage such as volume, or read an analogue voltage, such as pressure.

Once you have the above devices are fairly easy to talk to via simple lua actions or using the automatic polling of the Device Manager. Eventually I will interface it with Girders standard Device Manager, which is being developed by Rob.

In order to get the status of a device or set a device you should use the lua as discribed in the first post of Marcels driver thread. As a basic example, to display the temperature of a given device.

local DeviceID = "FE000800554DD510"
print(OneWire.GetTemperature(DeviceID))If you already have CAT5 or CAT6 wiring installed in your place you are ready to go as far as infrastructure is concerned, I have some DS18B20 devices directly installed in RJ45 plugs which I can but in any RJ45 socket in the wall.

I am currently using a connection scheme derived from this (http://www.hobby-boards.com/catalog/howto_wiring_diagram.php) and this (http://www.midondesign.com/Documents/1-Wire%20RJ-12%20wiring%20standard.pdf), what this means is that my wiring is universally compatable with RJ11/12/45 connections, and Dallas standard wiring. See the attached excel spreadsheet that shows my scheme.

It would be recommended that if you have several devices located all over the place with long cable runs that you use, three wires. i.e. +5V, Data and GND. That way you should minimise miss read device interrogations.

If you are only using a couple of devices or experimenting you can get away with using parasitic powered devices, i.e. Data and GND only. I have actually used speaker wire at one stage!

The devices are very timing sensitive in terms of polling, etc. So if you are having a lot of problems with devices "Failing to Convert". It is likely to be a connection problem, or if you are on "Two Wire" configuration too many devices on the bus all converting at the same time (i.e. High Current Draw) or a cable run being to long. In that case it is best to just add a 5 volt psu to the bus, perhaps at your node zero. It may also prove helpful to add a pull up resistor, size of which depends on number of devices etc.

With regard to devices. Might I suggest you check out Hobby Boards (http://www.hobby-boards.com/1wireboards/1-wire_boards.html), AAG Electronica (http://www.aagelectronica.com/), there are various other companies too. Alot of options are availble, for mounting including premounted "probes"

Here is an example of a Biro Probe!

If you have any comments or want to know more let me know I will update this post to reflect.

December 10th, 2006, 06:12 AM
Hi Dan,

just f.y.i.

I found that the latest dallas semiconductor 4.00 onewire drivers cause a blue screen in vista (rtm)....

luckily there's a workaround : I updated the first post in the original plugin thread...

If you are already in the situation where vista blue screens (like me :mad: ) just insert the vista cd, select repair, then select dos prompt and rename/remove windows\system32\drivers\ds1410d.sys....


December 10th, 2006, 06:50 AM
Thanks Marcel,

I am actually steering clear of vista for a while! I want to let the water settle before I dip my toe in!

December 10th, 2006, 09:17 AM
Dan, is this something we can include in the standard G install?

December 10th, 2006, 09:52 AM
If you wanted yes, I don't think enough people appricate 1-wire.

I guess Marcel would probably be ok with it as the core plugin is his, Marcel?

I did the dm which you are welcome too. The DM currently only does onewire temperature devices.

June 5th, 2007, 05:52 PM
Not sure how I missed this thread when I searched 1 wire... but thanks

Mike any chance someone could follow up if Dan is busy to finish this so that you can also do digital I/O, ect with DM? Maybe move it over to CM for G5.

I think as more people see the value of Girder5 for home automation that this will be a huge asset.

There is a Hobby Boards section on the Cocoontech forum that has their presence and I am sure we can get him to come here to answer questions also if there is an interest.