Shop OBEX P1 Docs P2 Docs Learn Events
Long range 1-wire network support — Parallax Forums

Long range 1-wire network support

Michael ChengMichael Cheng Posts: 3
edited 2010-06-27 08:45 in BASIC Stamp
I am going to build a monitoring system consists of 50 1-wire devices (DS18B20 and DS2450). A bench scale trial using few 1-wire device works well. However, the system become very unstable as number of devices increased to >12. The devices seems failed to be reset by the owout command. I guess it related to the limited pull down capability of the BS2P controller.

Some literature suggest using a 2n7000 MOSFET in the 1-wire interface (see below). However, I am not sure how to make appropriate coding with reference to the suggested schemetic.·

I would be very grateful if anyone can suggest a solution to scale up the 1-wire network (both codings or improvements in the BS2P/1-wire interface are welcomed)

Thank you.


Maxim. 2001. Guidelines for Reliable 1-Wire Networks. http://pdfserv.maxim-ic.com/en/an/AN148.pdf
895 x 429 - 28K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-23 15:55
    Are your 1-wire devices clustered in groups or widely-distributed individually? If clustered, do you (or can you) have power available at the cluster locations?

    -Phil
  • Michael ChengMichael Cheng Posts: 3
    edited 2008-06-24 01:20
    The network consist of 2 clusters of about·are 30ft from the controller.· Each cluster has 50 1-wire devices with their own power supply by the CAT5 cable.
  • FranklinFranklin Posts: 4,747
    edited 2008-06-24 01:24
    Check out issue 205 and 206 (Aug, Sep) of Circuit Cellar. There is an article on 1-wire and how to make it rugged using hardware and software.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-24 01:58
    You might consider separate Stamps as 1-wire controllers at the cluster hubs. Each Stamp (BS2p, -2pe, etc. ) could easily poll 4 devices per pin ( x 13 pins = 52 possible devices) and communicate with your main controller via a serial link (RS422, RS485).

    -Phil
  • Michael ChengMichael Cheng Posts: 3
    edited 2008-06-24 14:11
    Thanks Phil and Stephen for your prompt reply.

    I have tried Phil's solution and found that each BS2pe pin can support up to 24 DS18B20 sensors. My problem is solved at this stage. A CAT 5 cable can convey signals from 6 BS2p pins (plus·2 wires for Vdd and Gnd).

    Beside, with reference to the literatures suggested by Stephen, the diminishing reliability of large scale or long range 1-wire net is related to the wire capacitance.· Others suggested the limited pull down capability as the cause of sending the reset pulse by BS2P.·

    Here are some solutions (although failed) I tried these days:

    1.·A 2N7000 EFT is connected to a Bs2pe pin (which is the same as my first post).· I tired reseting the 1-wire DQ with PULSOUT command.· A positive pulse pulled the wire down owing to the reversed polarity of the EFT.· The reset pulse·was followed by a "OWOUT pin, %0000 [noparse][[/noparse]SkipROM,......] command. Slave's reply is received by another Bs2p pin.

    2.·The diode side of a·4N25 optocoupler connected to a BS2pe pin. An attempted is made to trigger slaves to reset by triggering the transistor with a pulse in the diode.

    However, two solution failed to deliver a comand to the 1-wire devices but I am doubt about the cause.

    Besides DS18B20, I notices there are some suggestions of using other 1-wire sensors (such as DS2450 A/D and DS2760 Li Bat).· I would like to make this chance to invite discussion regarding the solution to cope with medium to large scale 1-wire network by BS2p.· Your comments and suggestions are highly appreciated.



    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-06-21 12:57
    This application note might help quite a bit. (see file attached)

    The alternative and specific fix for temperature measuring 1-wire devices (DS1820, DS18B20, DS18s20, DS1920, DS1822 and more) is to have both a weak pull up in the form of a 4.7K resistor and a strong pullup in the form of a BSS84 PMOSfet driven by a separate I/O pin primarily for calculation of the temperature.

    I have a DS9097E reader for iButtons that can also be used with telephone wire to read 1-wire networks. Unfortunately, the Windows software isn't working with polling temperature devices (it used to, but something has changed). I suspect that I really need the more expensive DS9097U and likely the DB25 version that can use an outboard power supply.

    The advantage with having one of these devices is that you can test your entire network on a Windows PC and independent of your microprocessor. Then you have the advantage of knowing where the problems lie - either the network is no good or the microcontroller code is not right.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan

    Post Edited (Loopy Byteloose) : 6/27/2010 8:49:51 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2010-06-21 17:23
    I would lean towards a larger value for the weak pullup, or only have ONE pullup on a master. However over a large distance the distribution of pullups is probably going to be better.

    Anyway, basically that 1k pullup over 12 units 'appears' to be a 83 Ohm resistor to any one of the 2n7000 MOSFET's trying to pull it down. (about 60mA to your 5V supply)

    If you increase the resistance to a 4.7k pullup, that 83 Ohms increases to 392 and the pulldown current lowers from 60mA to 13mA...

    Depending on how many units you have distributed, I would probably try to keep the pulldown current somewhere between 10mA and 20mA

    So, for 50 units, you want about 15k resistors for the pullup.


    5V / 15mA = 333.33 Ohms


    1 / ( 1 / R X 50 units ) = 333.3 Ohms

    or

    333.33 Ohms X 50 units = R = 16,667 Ohms ==> rounding 15k

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 6/21/2010 5:53:36 PM GMT
  • PrettybirdPrettybird Posts: 269
    edited 2010-06-21 18:46
    Just an idea. Would optical cable work?
    Remember seeing a building with networking done all with optics.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2010-06-23 02:23
    There was a post a while ago in the Sandbox about fiber comms that might have some application: http://forums.parallax.com/showthread.php?p=903294.

    Even if not, the projects outlined make good food for thought.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-06-27 08:45
    Mixing 1-wire and fiber optics seem rather absurd.

    The primary attractions of 1-wire are a low part count and to use modular connectors and a simple twisted pair to get a remote sensing network. If you run optical cable, you still have to provide electrical power and converters at each node at the far ends.

    With 1-wire, projects such as safe temperature sensing within a grain elevator become doable. In my case, I am trying to manage cooling a hog shed that is operating its fans by methane in Thailand. Being rural, the goal is to power the temperature control from the automotive 12v that supplies the cooling by burning methane. I can do much more than run a second 12v line to a remote sensor, the hog shed is not wired for 240VAC.

    After a lot of digging I have pretty much come to the conclusion that Dallas Semiconductor wants you to use their master chips for any really stable, long distance networks. They have an RS-232 to 1-wire, an I2C to 1-wire, and a USB to 1-wire interface chip that appear to support all the odd features required by different 1-wire chips. I did get the Circuit Cellar articles and they were not as much help as I hoped for.

    I do have a TINI motherboard with a TINIs400 processor and that has 1-wire supported by the DS2408b chip that is quite stable, it includes a RTC, a few RS232 ports, a LAN interface, and even CANbus. Of course, you not only have to buy the board, but you have to learn to program it is a subset of JAVA and a Unix-like OS - not exactly 'rapid deployment'.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Sign In or Register to comment.