18B20 and cable length


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: 18B20 and cable length

    Quote Originally Posted by towlerg View Post
    FWIW the data sheet says 4k7

    George
    George, thanks for the advice. I made the mistake and installe dthe wrong value resistors. 4K7 is indeed the correct value, but I had to wait until today to try it out as I was using the habistat controller to run the reptile incubator and had to wait for the eggs to hatch. Now that's over I have changed the resistor for a 4K7 and the sensor is working fine over the cable length and the controller has been running fine all day


  2. #2
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: 18B20 and cable length

    It's great that you've got it going, Malcolm. The datasheet talks about 5K as sort of a maximum value, optimal for a single device but there are all sorts of conditions where you'd want it smaller. If you are running in parasitic mode with a long lead, if you have multiple 1-wire devices on the same bus, if you are running at lower voltages (say 3.3 V), you will find you need to lower that value. The datasheet has an example circuit for effectively lowering the value to near zero while the device takes it's reading. Bottom line is that there isn't a single best value.
    So if you have 1 device on the bus, running at 5V, not in parasitic mode, 4.7K is perfect. If you have a different configuration, and you have troubles, try lowering the resistor to 2.2 K. Larger values like 10 K are unlikely to ever work, as you discovered.
    There's a lot of discussion online about these devices including a couple application notes that talk about these exceptions.

  3. #3
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: 18B20 and cable length

    Thanks for the additional info Charlie. Yes I'm running at 5v and each sensor is on it's own pin on the PIC.

    The controller was installed at the weekend. It sits on a stack of three vivariums, with the fouth being a large 160cm x 50cm x 50xm the other side of the room. The cabling for heater, light and two sensors are routed in trunking over the door and along the skirting board to the unit



    I've updated the schematic and PCB drawings to use 4K7 resistors... Where I got 10K value from I don't know !

Similar Threads

  1. LCD cable length?
    By Art in forum General
    Replies: 27
    Last Post: - 14th February 2012, 15:35
  2. Max cable length?
    By Fredrick in forum Serial
    Replies: 8
    Last Post: - 2nd July 2010, 20:37
  3. DS1820 Max Cable length ?
    By dccch in forum General
    Replies: 2
    Last Post: - 24th January 2008, 07:44
  4. Measure cable length with a PIC?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th July 2007, 18:45
  5. Cable Length Between Micros
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st June 2006, 14:29

Members who have read this thread : 0

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