Measuring temperatures…

Absolute beginner - here. I’m going to try to see if I can monitor flow and external temperatures for my system. For historical and space reasons all of my meters, my heat battery and the heat pump controllers are all tucked away under my stairs. How long a cable can i run for the DS18B20 temperature sensors? Do I specify the length of each one at the checkout or is there an extender that I need to add to run the cable all the way to the outside of my house (probably 10 m or so once I’ve wiggled around under the carpet and along the skirting boards.


Welcome, Andrea, to the OEM forum.

Much has been written here about the DS18B20 sensor, so you have a lot of reading to do.

First, a very full explanation of the One-wire System -
First published at   is now available at 1 Wire Design Guide v1.0 | PDF | Inductance | Cable

Wiring DS18B20 sensors: DS18B20 reliability considerations

Much about clone sensors & multi-drop: Ds18b20 and emonTX3CM firmware - post 78 in particular.

Temperature sensors don’t work:

There are two articles in the ‘Learn’ section here: Learn→Electricity Monitoring→Temperature

Maxim App Note re wiring: Guidelines for Reliable Long Line 1-Wire Networks | Analog Devices

1-Wire DS18B20 direct to RPi: Enable 1-Wire Interface on the Raspberry Pi - Raspberry Pi Spy

And we have a sketch for an emonTx (or Arduino) to read the sensor serial numbers - knowing those can be very useful.

I think your best approach will be to read as much of that as you can absorb, then come back with questions.

“The Shop” sensors come with a fixed length of cable - if you have more than a few sensors and they are all some distance away, you will be much better arranging your wiring as a proper “bus” or daisy-chain, rather than bringing all cables back separately to a central point.

Don’t worry about that, we all were, once. If you’re prepared to ask questions and learn, and follow up our suggestions, most people here will stay with you and provide all the support that’s practical. Except for the 2 owners (Glyn & Trystan) and Gwil, we’re all volunteers. The one thing we don’t do is 1 to 1 phone calls (or whatever) - it’s all on the forum.

Do you already have any OEM kit or doing it all right now?

If you get one of these emonPi / emonTx RJ45 to Terminal Block Breakout for DS18B20 - Shop | OpenEnergyMonitor you can connect all the sensors to it and then run a normal network cable to wherever the EmonPi/EmonTX is.

Are you sure about that reference? I think that particular post was about pt1000s (my bad for going off topic at the time).

I think it shouldn’t have the “/6” on the end. Thanks.
(I’ve changed my “fount of all knowledge” text file. :smiley: )

Thanks for pulling all of this info into one place. Incredibly helpful.

Could you update your post with the latest link?

Having found out that I should daisy-chain a few my sensors together, rather than running a separate cable for each, I’ve come across a very simple question which I can’t find an answer to. How do I actually connect the temperature sensors at various points along the length of the cat5e/cat6 cable? Is any cable connector fine or should I be aiming to include a breakout board at each point?

I’m planning to put:

  • 2 sensors at the heat pump (for air temp in/out) - this will be a standalone run, with external cat5e/6 cable, back to the main breakout board
  • 2 sensors for the flow/return from buffer to radiators - these are about 5-8m from the emonPi, and first set in my long daisy chain
  • 2 sensors on the hot water cylinder, which is at the end of the long run - probably a further 10m

The heat pump flow/return is measured via the heat meter so separate system.

That’s it for now, although I’m sure I’ll have more questions once I get stuck into it.

Have you obtained written permission from the copyright owners to upload and republish their paper?
It’s published here: 1 Wire Design Guide v1.0 | PDF | Inductance | Cable

You should aim to maintain each of the twisted pairs for as long as possible, i.e. make the minimum change to the physical lay of the cable. The spur to the sensor should be as short as possible.
You shouldn’t have two “long” spur cables on the same bus.

Thanks for the reply. This matches my findings. My question is more basic though, I will have a single, long cat 5e/6 cable running all the way from the emonPi breakout board, past the point I want to take the first set of measurements and on to the hot water cylinder. How do I physically connect the sensors to the twisted pair in use? Presumably I’ll need to cut it then reconnect it with the sensor stub wires also in. Will any wire connectors do? The sensors are using a 1m cable, as supplied by OEM). Presumably this is the correct layout?

This is just the link I read the doc on, from your post in 1-Wire Design Guide. The link you’ve updated to works so that’s all good. Thanks!

What are the environmental conditions? Do you want the connection to be permanent, or screwed, or pluggable?
Do you need the full 1 m of cable - because the shorter that stub, the better, not just for that sensor, for all of them.

That’s almost a certainty.

2 sensors outdoors one/by the heat pump so subject to wind, rain, cold temperatures and so on. 2 sensors in an airing cupboard. 2 sensors in a ventilated loft, so quite variable in temperature between winter and summer.

The only reason I’d expect to separate these is if one needs replacing. Screwable or pluggable sound easiest to maintain, unless that’s going to limit the life of the outdoor one in which case happy to go permanent (so long as we’re not getting into soldering etc.).

Fair point. Probably not. I’ll try to cut these fairly short, once everything is in position.

Peronally, I always fit sensors with connectors so they can easily be replaced.

Strip of breadboard, sockets soldered on, each sensor then added and one cable going back to an ESP device in this case, running Tasmota. Max 6 sensors. All sensors have the same length cable and the plug crimped on. Sockets and crimps are very cheap from AliExpress.

I suggest, as you’ve ruled out soldering (which will be the most reliable long-term), in each location a plastic box to provide mechanical protection (indoors) or mechanical and weather protection (outdoors).

In that box either a screwed “chocolate block” connector (least preferred), or a couple of terminal blocks on a small piece of stripboard. As you’re using CAT5 cable, try to get the sort of terminal where the screw doesn’t directly clamp onto the wire, such as

For the outdoor box, it will be worth getting a weatherproof one and the correct size glands for the cable entry to ensure it stays water and insect-proof.

I’d put the main bus into one connector, and the spur into the second. I would not use 3 connectors.