1

I have bought DS18B20 with RJ45 port on its end. It is dumb idea to connect it directly to the Ethernet port on the Pi? I did so, tried reading the temperature (http://www.reuk.co.uk/DS18B20-Temperature-Sensor-with-Raspberry-Pi.htm) but I cannot see the sensor in the w1/devices..

So do I need some 1-Wire interface with Ethernet port as a middleware? Or would it be better idea to cut of the RJ45 and connect the sensor wia GPIO?

Thanks If something is not clear I'll be happy to provide more info. I am kind of a beginer in this stuff.

EDIT: So I cut off the RJ45 and discovered that my sensor has 4 wires (http://rpishop.cz/862-thickbox_default/1wire-teplotni-senzor-ruzne-delky.jpg). So far I tried both data wires separately as in the above mentioned tutorial, but the sensor does not appear to be registered correctly:

 ls -l /sys/bus/w1/devices/
total 0
lrwxrwxrwx 1 root root 0 Jun  5 20:35 00-400000000000 -> ../../../devices/w1_bus_master1/00-400000000000
lrwxrwxrwx 1 root root 0 Jun  5 20:35 00-800000000000 -> ../../../devices/w1_bus_master1/00-800000000000
lrwxrwxrwx 1 root root 0 Jun  5 20:33 w1_bus_master1 -> ../../../devices/w1_bus_master1

As a pull-up resistor I've used two 18K in parallel.

5

Connecting the DS18B20 to the Ethernet port would either not work or the effort to make it work (even if it was possible) would be excessive for someone starting out with a Raspberry Pi.

As you state, cut off the RJ45 and connect the sensor with the black wire to ground, the red wire to the 3V3 pin and the blue or yellow (some are blue and some are yellow) wire to the GPIO4 pin. A resistor between the value of 4.7k Ohms to 10k Ohms needs to be connected between the 3V3 and GPIO4 pins to act as a ‘pull-up’ resistor.

enter image description here

If you can, it's handy to use dupont connectors on the ends of the wires to make it easy to connect them to appropriate GPIO headers.

enter image description here

I have published a few extra details of connecting a DS18B20 here if you need extra reference.

  • Thanks, but I somehow got this sensor with 4 wires (see rpishop.cz/862-thickbox_default/…) there are two data wires. – Filip Jun 5 '16 at 15:00
  • OK. That's unusual. I haven't come across a DS18B20 with four wires before. Are you sure it's a DS18B20? Are there any external markings or do you know where it came from? – d3noob Jun 5 '16 at 19:32
  • I hope it is correct sensor :D I've bought it in an e-shop which specializes on RPi and accessories - rpishop.cz/raspberry-pi-prislusenstvi/… (it's Czech lang) Also, on the cable is this gibberish text: HYBV 4X1/0.5 YD/T840-1996 Google found nothing – Filip Jun 5 '16 at 20:03
  • OK. There is a documentation link on that page which leads you to this unipi.technology/wiki/1Wire_topology It looks like the sensor that you have is designed to interface with this unipi.technology. Have a read and see if it makes sense. – d3noob Jun 5 '16 at 20:13
  • 1
    so the new sensor with ONLY 3 WIRES :D finally arrived and everything works. – Filip Jun 17 '16 at 18:49
1

If it is a DS18B20 it would probably be simplest just to cut off the RJ45 plug and use the stripped wires.

Software and (terse) instructions at http://abyz.me.uk/rpi/pigpio/examples.html#Misc_DS18B20_py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.