Long range 1-wire network support
Michael Cheng
Posts: 3
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
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
Comments
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
-Phil
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.
·
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
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
Remember seeing a building with networking done all with optics.
Even if not, the projects outlined make good food for thought.
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