Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Multiple temperature sensors - best way to do it

I’ve recently decided to monitor my air source heat pump, inspired by the guides here and John’s temperature sensing article.

For now, I’ve bought:

  • 1 emonPi
  • 6 x temperature sensors
  • 1 x breakout box
  • 1 x pulse counter
  • 50m of 4 pair telephone cable, so that I can extend the length of some of the temperature sensors

I have a rather complicated UFH system with various mixers (which probably shouldn’t be there) and buffer tanks. I think there are actually 12 temperatures I’d like to monitor eventually, but for now I’ll start off with 6.

My question is what are the options to go from 6 to 12 sensors? I understand the RJ45 breakout boards can be connected together, so I could wire up 12 to the one pi, but the firmware of the pi is limited to 6 sensors so it wouldn’t actually work. Is this right?

Is it a good idea to try and modify the firmware? I am a newbie so if this is non-trivial then probably not.

If I have to buy new hardware, what would you suggest? Buying another emonPi and RJ45 breakout board? Or should I be looking at multiple emonTx’s instead of the Pi?

I am asking these questions now because it will influence which 6 sensors I start off monitoring and the cable lengths.

Thanks

Is this right? - yes and no.
The easy answer to the wiring question is breakout boards aren’t the best idea. With 12 sensors, you will be less likely to run into problems if you daisy-chain the sensors, rather than wiring them all back to a single point in “star” configuration. There’s a little more about this in the ‘Learn’ section, and a lot more in these topics DS18B20 reliability considerations - #7 by pb66 and Ds18b20 and emonTX3CM firmware - post 78 in particular.
Your 4-pair telephone cable should be fine - choose the cores to use based on what PB has written (the first link above).

You don’t mention if you’re using the emonPi for monitoring power. If you are, and you swap to the emonPiCM software, then 12 sensors have never been tested and most probably will not work - because a huge amount of time (comparatively) is taken while each sensor sends its data. If you use software that’s the default today, then with minor changes (which we can steer you through) the emonPi should be OK.

If you are doing power monitoring with your emonPi and need the Continuous Monitoring software, then I’d be sorely tempted to suggest a Raspberry Pi (not even an emonPi or emonBase) dedicated solely to servicing the temperature sensors, and that can sit on your LAN and send the temperatures to the emonPi for logging or whatever. Unfortunately, there’s not as I recall any standard software for the RPi to do that.

I don’t know if there’s anything that works if you want to connect the 1-wire bus directly to the RPi, but if you use a DS9490R 1-wire to USB interface then owfs can present the 1-wire devices as part of the filesystem, so reading the temperatures reduces to just reading the relevant files and all that’s really required is a script to read the relevant files and, say, publish the values via MQTT. I have a perl script that does exactly this for my weather station sensors.

I don’t know if it’s addressed in the linked posts, but my experience is that as the number of 1-wire devices and/or bus length increases, using parasitic power becomes much less reliable. Years ago I bought a 1-wire hub/power-injector that I use with the weather station (I have an AAG anemometer and wind vane with a temperature sensor, humidity sensor plus temperature sensor, solar radiation sensor plus temperature sensor and an air pressure sensor with a temperature sensor, though most of the combined temperature sensors aren’t that accurate so I also have a few bare DS18B20s that I average the data from to get an actual temperature reading). I’ve no idea if it’s still available, but assuming the necessary components are still available then I’m fairly sure I have a circuit diagram for it.

James

1 Like

IMHO the cheapest and simplest way is to use an ESP8266 (I use the Wemos D1 Mini) and Tasmota or ESPHome. There is a limit on the max number of sensors per 8266 (software limit is read time).

If using a Pi, you could use a PiZero.

I have a piece of breadboard and solder connectors to it and then crimp the other connector to the sensor. They can easily be swapped in/out as necessary then and only one set of connectors on the ESP board; I solder connectors to these as well. Again swap in/out easily.

Tasmota/ESPHome just work for almost any sensor you can buy. No OS fiddling, no OS updates etc. If you are using HomeAssistant, ESPHome is even easier.

Thanks for all the replies.

For now, I’m going to forget about extra sensors and concentrate on installing the 6 sensors that I already have. I am a complete beginner to the emonPi project and system and have no electronics background or experience.

For background, I bought a soldering iron and heat shrink specifically for this project - never used one before! - and am just about comfortable now after watching some youtube videos on how to extend the temperature sensor wires.

Thanks for the suggestion about daisy chaining, rather than connecting everything in a star.

This is a mock-up of how I was originally intending to connect the 6 in star fashion:
6sensors-star

This is a mock-up of how I could use two daisy chains to reduce the total amount of cable, inspired by your suggestion:
6sensors-2daisy-chains

Forgive the basic questions:

  • Should the layout shown in the daisy chain mock-up work ok? There are two daisy chains because of the different physical locations of each group.
  • Given the cable lengths shown in the star mock-up, do you still think a daisy chain connection would be better, or is that only relevant with longer runs and/or more sensors?
  • If you recommend the daisy chain connection, I need to figure out how to join the three wires together in a waterproof way. I don’t think I can solder and heat shrink three wires together can I? What would be a simple way for a novice like me?
  • When I’m connecting the cable from the sensor to the telephone cable extension, should I join a single wire from the sensor to a pair in the telephone cable (eg. connect the red sensor wire to the orange and white-orange wires in the telephone cable, and then connect the orange and white-orange cables to the breakout board) or connect one wire to one wire, ignoring the coloured pairs?

There’s a danger in that arrangement of having the worst of both worlds. Perhaps I need to explain the problem.
The data to and from the sensors is digital, in the form of pulses. These travel in cables at a finite speed, lets say about 1 foot per nanosecond. When they come to the end of the cable, unless a very specific condition is met (the cable is terminated in its characteristic impedance), the pulse gets reflected. Let’s say t6 is sending its data. When the first pulse gets to the junction, some will go into the emonPi and be recorded, some will go the other way towards t2, get to the end and be reflected back, and reach the emonPi weaker, but it will still get there. There it interferes with later pulses from t6 that are just arriving at the emonPi. That’s what causes the problems. You might get away with what you’ve drawn, but then again you might not. If feasible, just one cable looped around all the sensors (all 12) would likely be better. There are a number of methods of lowering the possibility of reflections causing trouble, this https://pdfserv.maximintegrated.com/en/an/AN148.pdf has a lot of information but it’s quite technical. A point to bear in mind: Maxim assumes you are driving the bus in the optimal way at the controller end. The emonPi is not like that, all it has is a plain pull-up resistor.

I don’t see why not. You’ll probably need to have the adhesive-lined type of heat-shrink to get a good waterproof seal. The glue melts as the sleeve shrinks and forms a very good seal. You could easily twist and solder 3 wires together (cut ends all pointing the same way), slip the glued sleeve over everything and shrink it, then while the glue is still molten, crimp the open end flat while the glue hardens to seal it. Note the spur to the sensor should be as short as possible.

https://uk.rs-online.com/web/c/cables-wires/cable-accessories-ties-tools/heat-shrink-cold-shrink-sleeves/?searchTerm=heat-shrink%20adhesive%20lined

That’s already answered here: DS18B20 reliability considerations - #7 by pb66

When you do that, stagger the cuts in the wires. Like so:

-----------------------*-----------
-----------------*-----------------
-----------*-----------------------

Helps to avoid a big lump at one spot in the wiring.