deviceIndex — OneWire Library (DS18B20) September 15, 2011Posted by rik94566 in 1-wire, aquaponic automation, aquaponics, arduino, CEA, Controlled Environment Agriculture, DIY aquaponics, DS18B20, indoor aquaponics, indoor gardens, indoor growing, One-wire, sensor, Sensor Hub, Stainless Steel Temp Probe, Temperature Probe.
Tags: 1-wire, aquaponic automation, aquaponic crop, aquaponics, arduino, arduino sketch, automation, CEA, Controlled Environment Agriculture, DIY aquaponics, DS18B20, electronics, indoor aquaponics, indoors aquaponics, microcontroller, rik kretzinger, sensor, Temp Probe, Temperature Probe
Miles Burton developed the OneWire Library for use with DS18B20 IC’s.
From what I can tell, a major function in OneWire library is the “deviceIndex” . It looks to me that the “deviceIndex” sorts out which IC or in this case which probe get read and when. I have researched the “deviceIndex” on the internet to gain a better understanding of how it works. Well, bad news is that I could not find any information on it other than what comes in the sketch the Miles provides on his wiki page for Dallas Temperature Control Library.
It looks like to me that once the sketch starts up each probes HEX code (specific to each probe) gets read and assigned to a device number. When I added probes starting with PROBE-007 working up through PROBE-011 the device numbers were assigned to each new probe as I added them. Such as — DEVICE 0 – PROBE-007, then DEVICE 1 – PROBE-008 and so on…… This is all well and good until I made a few minor changes in the sketch and restarted the arduino. When all the probes were connected no longer would the probe numbers match the device numbers. I would have PROBE-007 reading from device2 or maybe even 3.
I think that for simple situations where you can live with random assignments of device numbers to probes this type sketch design might work. I am looking for each probe to be read consistently each and every time so I can know that the temp reading from the fish tank is always the reading from the fish tank. Important stuff to me and my fish. So this is another reason that I had to find a better way when it came to reading my temp probes.