Raspberry Pi Zero - ds18b20 Temperature Monitoring

Like I want some cost-effective temperature monitor system in place for small business: So I’m about to hire a code from Upwork for the python script. So I would like to monitor the temperatures of the following,

  • Freezer (temperature= will be minus 18c range) +

  • Coolroom (temperature= will be 2c range)

  • Blast freezer (temperature= will be minus 40c range)

  • Production room (temperature= will be 6c range)

Where I’m stuck with the wiring stage. In total, the wiring will be 39 metres. I need your guys advice on the wiring part

  • So there will be temperature sensors for each room, so 4x temperature sensors which comes with 4.7k resistor https://core-electronics.com.au/waterproof-ds18b20-digital-temperature-sensor-extras.html

  • The wire, recently purchased 4 Core Shielded Data Cable https://www.wiltronics.com.au/product/588/4core-shielded-data-cable-m/

  • I think the main problem is that there will be existing 440v cables powering the refrigeration units. So the project wiring will run alongside with the 440v cables around 8 metres.

  • The wiring circuit will start from furthest sensor and the wiring circuit will end on the raspberry pi

  • Will feed the wiring into RIGID CONDUIT PVC to protect the wiring and have the noise reduced.

  • We will go with 1-Wire Communication Protocol, as the DS18B20 uses a strict 1-Wire communication protocol to insure data integrity. I was found & recommended these two webpages regarding to understand the wiring part.



So my questions are;

  • I was recommended to use terminal blocks for joining the wirings together for the circuit. How should I join the wires together?

  • What should I do with the drain wire which the green arrow points out?

  • When the circuit reaches to raspberry pi zero what should do with gnd wire?

NOTE can’t have the project wireless, due to poor wifi connectivity at my work.


Hi Huseyin,

You should be able to connect all four sensors to a single digital input pin on your Pi Zero.
Your main goal should be to minimise the cable lengths as much as practical. Making sure to tie all the ground leads together, all the positive sensor leads to either 3.3 or 5 V DC, and connecting a 4.7K resistor between each sensors output pin and the positive rail (3.3 or 5V DC).

My colleague James has recommended me a great explainer on 1-wire systems here:

With the resistors also needing to be connected you may be best getting bootlace ferrules to terminate the wires with the resistor, then screwing those into the screw terminals to make sure you get a secure fit that won’t creep out. The bootlaces are available here and there is a crimping tool that goes with them.

There was a great discussion on terminating wires with screw terminals very recently on this forum post. I can’t recommend it enough.

I’m not sure on this one, I’ll need more information or to do a bit more reading.

The ground wire that is connected to all of the sensors should also be tied to the same ground the Pi Zero uses, we want a common ground to avoid weird ground loops and other stray signals being induced and causing floating voltage weirdness.


H Huseyin

The drain wire shown in the pic in the link connects all the way along the aluminium shields of the cable. It provides a connection system that can be soldered to (soldering to aluminium is very difficult). This should be grounded AT ONE END ONLY. and under no circumstances should it be used as a common return for signal circuits. Particularly in your situation which appears to be industrial.

I assume you mean the signal ground or common for the sensors. I think connect to common ground of the Pi zero. Do not confuse with the ground (drain) wire of the cable. This is CHASSIS ground. They may all connect together somewhere but this is irrelevant.

Rigid PVC conduit will not do anything toward reducing noise. That is what the screen on the cable does. As mentioned above the drain wire is grounded at one end only.

NOT in the same conduit I hope. I think that may be a bit illegal and very risky anyway.

Read through the post linked in Trent’s reply. I was the author of those replies concerning wiring practises and outlined reasons for using bootlace ferrules etc.
Cheers Bob


Hi Trent

The drain wire is the connection point for the cable screens. Without this it would be a bit hard to terminate the screens due in part to the difficulty in soldering aluminiumin the general workplace (it can be done).
Cheers Bob


Ah ha! Thanks Bob, that makes a lot of sense.