JohnsUPS
Posts: 5
Joined: Fri Jul 06, 2018 2:13 am

Re: DS18B20 Max Distance

Mon Oct 08, 2018 11:10 pm

Just an update to my earlier post about the data center temperature monitor. The monitor has been installed, and everything is working perfectly. I wanted to share some of the installation details, as this installation technique is now proven to work in an electrically noisy environment and should be applicable to many other temperature sensor projects.

The final installation used five sensors spread out along the length of a CAT 6 cable running through the data center. The cable as installed is 369 feet from the first sensor to the DS2482-100 driver chip on the interface board. The first four sensors are spaced about 30 feet apart, and the fifth is about 50 feet from the fourth. Each sensor has a 10uf tantalum SMD capacitor between Vcc and Gnd at the sensor.

All of the sensors are wired in parallel and are NOT being used in parasitic mode. Along the length of the cable run, there were five RJ45 keystones punched down. The RJ45 receptacles in the middle were installed without cutting the wire. About 3-4" section of insulation was carefully removed, then the wires spread out and punched down (I just followed the 568B wiring pattern on the keystone), essentially tapping the cable along its length. Each keystone was then installed into a single port biscuit block and labeled. This took some time, but was worth the effort.

The sensor assemblies consisted of a short piece of CAT 6 cable about ~5" long (could easily be longer) with a RJ45 plug crimped on the end, also following the 568B standard. Modularity makes it easy to replace sensors if necessary, as they just plug right in. Each sensor was wired as follows: org+org/wht connected together and soldered to the VCC pin, blu+blu/wht connected together soldered to the data pin and grn+grn/wht+brn+brn/wht all connected together and soldered to the GND pin. The capacitor was soldered very close to the body of the sensor. Liberal use of heat shrink tubing finished the job. At the monitor box end, the cable pairs were connected together the same way the sensor pigtails were wired.

So, if someone encounters a distance issue (and common category type cable is being used), first check to see what wires are being used and how they are connected. Capacitance on the data line is a bad thing. There is significant capacitance between the twisted pairs, so don't connect the data line to just one side of a twisted pair. Connecting the pairs as I have outlined above by connecting them together will minimize the inter-electrode capacitance (of course feel free to choose your own colors for Vcc, Gnd and Data :D ) Next, what is the voltage swing on the wire? If you are using the common pull-up on GPIO pin technique, don't expect to go hundreds of feet. This is good for code development, but bad for the Pi, as it exposes the pin to the outside world and only has a 3.3v swing. Use a driver chip - not only will your Pi thank you, but you will surely wind up with a much more robust/reliable circuit. Power the chip from 5v and use a level shifter on the I2C. This will get you an almost 5v data swing on the line and will go much farther. Better the chip die than the Pi.
Cheers.....

Return to “Interfacing (DSI, CSI, I2C, etc.)”