+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Full Member level 4
    Points: 3,424, Level: 13
    Achievements:
    7 years registered

    Join Date
    Jul 2007
    Posts
    212
    Helped
    1 / 1
    Points
    3,424
    Level
    13

    ds18b20 cable length issue (but not typical)

    Guys,
    I'm writing here with a different situations... Yes! DS18b20 and the cable length with pull-up resistor and timing and etc is a well discussed and there are plenty of info there. I'm in a position where I can not change the circuit that much to be frank. I have an option of changing the pull-up for either 2.2k or 4.7k. Means if i finally fix on 2.2k, then will that help me to run a cable 15m using regular cat5/ cat6? [DATA and GND in twisted pair]. so this is my option 1, but also I want to know for option 2:

    Option 2: is there any other way to transmit the data to long distance of such, say 20m max.??

    My current scenario is like I have a PLC circuit (custom made Arduino based, but already mass produced, with 4.7k) that has 3 ports for 3 individual sensors (all are almost around, nearby). I can either run the cable for sensors directly to the PLC or I can add a middle-something like a repeater who will send me the data. [I have a plan of using a nano to concatenate at least 2 (mandatory sensor) sensors and send via UART (not RS232, as that is also a kind of limitation) to the PLC (since i can change the code somehow to read the software serial over those ports.) But if there is a way of NOT using UART but a direct approach, I will prefer that.

    Help is a highly appreciated...

    Mishu~

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 74,927, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,195
    Helped
    3463 / 3463
    Points
    74,927
    Level
    66

    Re: ds18b20 cable length issue (but not typical)

    Hi,

    CAT5 / CAT6 calls for RS485/RS422.
    And I assume you have free pairs for power supply...
    So you can make an active differential interface.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  3. #3
    Full Member level 5
    Points: 1,276, Level: 8

    Join Date
    Jan 2019
    Posts
    258
    Helped
    50 / 50
    Points
    1,276
    Level
    8

    Re: ds18b20 cable length issue (but not typical)

    how much can you really change (or not change) the circuit? can you use a three wire interface?

    as i read the documentation

    https://cdn-shop.adafruit.com/datasheets/DS18B20.pdf

    you can use a three wire connection - +Vdd to the same power as your uP, GND to the same
    common and your uP and the third wire with the data. See figure 5.

    i expect (without proof) you can get 20 m this way.

    i remember reading the Dallas semiconductor book (yes a real data book)
    about 1 wire communication. really cool.

    but cool takes a backseat to getting the job done



    •   AltAdvertisement

        
       

  4. #4
    Full Member level 4
    Points: 3,424, Level: 13
    Achievements:
    7 years registered

    Join Date
    Jul 2007
    Posts
    212
    Helped
    1 / 1
    Points
    3,424
    Level
    13

    Re: ds18b20 cable length issue (but not typical)

    Quote Originally Posted by wwfeldman View Post
    how much can you really change (or not change) the circuit? can you use a three wire interface?

    you can use a three wire connection - +Vdd to the same power as your uP, GND to the same
    common and your uP and the third wire with the data. See figure 5.

    i expect (without proof) you can get 20 m this way.
    Here is the ans:

    The device was mass produced with my design. Arduino based, and it has 3 ports for 3 ds18b2b. each port has 3 pins, VCC, Data, GND. [VCC and DATA is also having 4.7k pullup on the PCB]

    And no help practically, though I used CAT5E with BLUE White for GND, BLUE for RED. ORANGE WHITE+ORANGE for VCC.

    Mishu~

    - - - Updated - - -

    Quote Originally Posted by KlausST View Post
    So you can make an active differential interface.
    OK, interesting... that's what probably i'm looking for. I can hook the sensor with the interface (named as buffer/amplifier) and then a twisted pair (CAT5/6) can bring the signal 20m away from the origin and there will be the PLC with same. Now, there should be minimal parts count for this purpose, to be frank...

    Mishu~



  5. #5
    Advanced Member level 5
    Points: 13,173, Level: 27

    Join Date
    Apr 2014
    Posts
    2,041
    Helped
    832 / 832
    Points
    13,173
    Level
    27

    Re: ds18b20 cable length issue (but not typical)

    Have you seen this?
    Guidelines for Reliable Long Line 1-Wire Networks
    https://www.maximintegrated.com/en/a...dex.mvp/id/148



    •   AltAdvertisement

        
       

  6. #6
    Full Member level 4
    Points: 3,424, Level: 13
    Achievements:
    7 years registered

    Join Date
    Jul 2007
    Posts
    212
    Helped
    1 / 1
    Points
    3,424
    Level
    13

    Re: ds18b20 cable length issue (but not typical)

    Quote Originally Posted by volker@muehlhaus View Post
    Have you seen this?
    Guidelines for Reliable Long Line 1-Wire Networks
    https://www.maximintegrated.com/en/a...dex.mvp/id/148
    That part has done for several times... each says "it's possible" And finally it was possible (tested upto 10m)...

    I used CAT6 (cheap grade though) with Blue-White as GND, Blue as DATA. Oranges were tied together for VCC. This was no luck untill I remove the 4.7k from the PLC's PCB and did two things, and found success for both case...

    1) I added a 1k resistor as pull-up at sensor side (where I connected the CAT6 with sensor) and it was success.
    2) I removed the 1k from sensor side and added it in the PCB and also found success.

    Both of the success is for "so far upto now with ideal condition". Cable was 10m.

    Now I have 2 questions:

    1) Can i replace the 4.7k for all the hardwares (infact changing the primary design at all in other words) and add that 1k as pull-up in PCB for both short length and medium length cables?? (Means 3m - 20m)?

    2) Which is best? that pull-up resistor at sensor side or at PCB side??

    Mishu~



--[[ ]]--