Multiple DS18B20 with Photon

Thanks @ScruffR and @BulldogLowell for your tips!

Indeed, I am aware of the electronic vulnerability of the one-wire system: Manufacturer's site

Also, I knew some libraries use this CRC mechanism to filter out stray values.
It would be fantastic if this could be integrated in the final sketch I am using right now: LINK

You can see I joined this thread in march 2016 with very specific requirements for my projects:

  • Must allow MANY sensors (DS18B20 and DS18S20 versions mixed) on the same I/O pin (around 25...)
  • The sensors, with known hex addresses, should ALWAYS keep the same (double variable) NAME (= "hardwired" sensor addresses!) => So, no "searching" for sensors!

Many sketches with different libraries were tried but did not fulfill my wishes, until @ric developed a beautifully complete solution. That was simplified even more last weekend, and I really love it for the clarity, simplicity and reliability it offers.

The only 2 disadvantages of this sketch I see:

  • You must run another sketch to identify the sensor addresses before being able to use it "hardwired"
  • No CRC checking is used, to filter out stray values

So, if some of you see the possibility to add this CRC checking to this sketch, it would make it more reliable!

On top of that, you are right @BulldogLowell, I will try to add a filtering method, checking the "continuity" of the data along these lines:
I check temperatures every 10 seconds or so.
And the water temperature won't change quickly.
So, for each value, I must check if it is less than 1°C bigger or smaller than the previous value.
If yes, I will replace the variable with the new value.
If not, I will keep it the same.

Only, I'm not sure if I have already enough experience to develop that in a simple way...

:older_man: