Long 1-wire bus


+ Reply to Thread
Results 1 to 10 of 10

Thread: Long 1-wire bus

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807

    Default Long 1-wire bus

    I would like to implement a 1-wire network for up to 8 temperature sensors (18B20) and with up to 50 meters long cable.

    Besides lowering the pull-up resistor, any other ideas to make the bus more robust and reliable please?

    Seems 1-wire does not like long UTP cables.

    Ioannis

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Never used any 1-wire devices but internet seems to suggest that the maximum cable lenght is anywhere between 100m and 300m, or even 500m with a master supporting active pullup so your 50m seems doable.

    Are the 8 sensors distributed along the 50m length cable or are they connected with stubs (of any considerable length)? If stubs are used adding a series resistor to each stub will help with reflections caused by the impedance mismatch but will also have a negative effect on noise immunity. (I got all that from this Analog Devices article: https://www.analog.com/en/technical-...-networks.html )

    Have you actually tried this and noticed any issues or are you just concerned about possible problems?

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Thanks Henrik.

    The network of sensors will be different in every case. The end user will have 1 up to 8 max of these sensors.

    They are connected in mixed ways, some with stubs of short length, others directly on the cable. I insisted on seperate line for the power and not use a parasitic power. After all, a UTP cable can support that.

    At short distances it works just fine. Longer cables have some times error in the communication and lowering the pull-up, sure helps a lot.

    I have read that article by Analog about active pull-ups. The problem, for me, is to write a routine that will do all of the signal handling, plus the 1-wire protocol, since OWIN and OWOUT do not support such a circuit.

    Ioannis

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    How do you distribute the power and signal across the pairs in the UTP-cable?
    I mean, do you have one pair for power & ground and then a single wire for the data and if so, what do you do with the other wire of that pair?

    I'd probably start with it grounded but I don't KNOW that's the best way.
    Perhaps using BOTH wires in a pair for the signal?
    Or run power and signal in one pair and both wires in another pair for ground.
    Maby a capacitor across power and ground at the far end of the cable?
    If the error(s) doesn't occur TOO often perhaps a simple retry is enough?

    Just tossing ideas up in the air, perhaps one or more helps, I don't know :-)

    I understand the "trickyness" in making this rugged if the bus topology is to be decided by the end user. I think you need to specify like max 50m length, each sensor connected to the main trunk by max 50cm - or whatever. Set that up with margin and test.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Hi, Ioannis

    Have a look to Maxim AN 148 and AN244 ...

    Best regards
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Henrik:

    I use one pair for the +5V, two pairs as ground and one pair as ground and signal.

    I cannot be very strict on the precise topology the user will make.

    You are right about different setup on the cables. Maybe some other configuration work better. It would be best though that we have a specific one for all networks.

    Alain:
    I did read all these AN and datasheets. The main trick to have long cable is to replace the passive pull up with active one, but this needs to come up with a routine, maybe in assembly, to control all the necessary timing for the pull-upo/pull-down and the 1-wire communication. This cannot be done with the commands OWIN and OWOUT and I am not that good anymore in assembly as I used to be 30 years ago, when I started with PIC controllers.

    Ioannis
    Last edited by Ioannis; - 8th August 2023 at 19:53.

  7. #7
    Join Date
    Jul 2018
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Hi Ioannis !

    The longest line for a ds18b20 in my heating is about 35 meters.
    The sensor line to my oven ( it is a small water-bearing oven which is in my living room ) is a Ymm 4x1.5mm˛ cable, because of the line resistance. Attempts with a network cable failed miserably for me.
    I chose the smallest pullup resistance according to the data sheet. It is a 1k resistor.
    My setup is working now for 4 years without any problems

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    I was testing with telephone 4 wire cable initially and then with CAT-5 UTP cable.

    As I have 2 pairs (and a half..) for power and one wire out of 8 for data, I thought I am OK and never thought wire resistance would be a problem.

    Thanks for your input. Will see if thicker cable is better.

    Ioannis

  9. #9
    Join Date
    Jul 2018
    Posts
    8


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Do not underestimate the voltage drop over long lines.
    Also you should not use the parasitic mode. ( 2 lines ) . T
    his causes more problems than it is useful.

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Long 1-wire bus

    Usually one thinks that thin cables will not be a problem since the current is really low, but you are right. It is more than the current. It is also the capacitance along with the voltage drop that all together will contribute in the system fail.

    Ioannis

Similar Threads

  1. Long ago thre was a variable named "long"
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd November 2017, 19:42
  2. Replies: 0
    Last Post: - 21st October 2011, 01:33
  3. Long Lines for 1-wire iButton DS1992
    By Bosse in forum Serial
    Replies: 4
    Last Post: - 22nd April 2010, 13:09
  4. How can I use multiple DS1820 s on same 1-wire bus???
    By obaskirt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th June 2005, 03:27
  5. I2C Bus (max wire lenght)
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 24th November 2004, 22:15

Members who have read this thread : 13

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts