Multiple DS18B20 with Photon

From the "side-track" by @Ric :

I want to thank all of you again for the many useful contributions to help me reach my goal(s) in controlling this system.
I'm confident that this "dream" is coming through... :rainbow:
Could never do this alone with my limited experience in C/C++!

STATUS of the project:

For simulating the situation, I created 2 buses:

Bus1: 6x waterproof sensors connected in "star" and with a long UTP cable between
Bus2: 2x TO-92 sensors on the breadboard

Right now, I feel the excellent work done by @Ric gives me (almost) everything I need.
I have just tested his combination of 3 files (above) and it (almost) works flawlessly.

It gives us the following great features:

  1. It's very simple and light software: Low memory usage I suppose.
    It keeps all the work behind the screens in an external file. Results:
    => Makes especially the main file (.ino) very simple and light
    => Easy to keep focus on the most important part: Controlling the pumps, valves and heating systems with simpler IF/CASE functions.

  2. It does not need another complex external library, (except for "OneWire.h")
    Remark: The library introduced by @MORA is of course great, but as discussed it has strong and weak points not fully compatible with what we want to achieve: It is great in discovering all sensors automatically, but the disadvantage is linked: If one sensor gets disconnected, others take his place... We're never sure we are reading a particular sensor. Another weak point is the complex assembling needed to get one floating variable.

  3. It addresses the sensors directly with their fixed HEX "ROM code": Always sure which one it is!

  4. It stores all results of readings in one array per bus of sensors, but in the loop() I can address all sensors with their "Nickname", as if I were using separate global floating variables. That is most familiar for me.

At this moment, I have only one problem remaining with Ric's software. Or is it in my hardware?

One of the buses gives all temperature values correctly while the second bus gives strange values.
This is the output in serial monitor:

D1 BUS: T1 = 22.2 T2 = 22.0 T3 = 22.1 T4 = 24.2 T5 = 22.2 T6 = 22.0
D2 BUS: T7 = 3.0 T8 = 3.0

I or @Ric may come back later after trying out a few more things. Maybe it's something trivial...

PS: The accuracy of these sensors that I will be using mainly with water is indeed in another league compared to the DHT22 sensors I am using for the airco & ventilation system. But both are adequate for their purposes. Very happy!!!

:+1: :older_man: