Page 1 of 1

Refresh/update time on 1-wire network

PostPosted: Sun Jan 03, 2016 6:16 pm
by the__creature
What response time can one expect on a 1-wire network that consist of around 20 different sensor - miliseconds, seconds?

Are trying to find out if one can use magnetic sensor on the doors connected to 1-wire to turn the on light

Thanks

Re: Refresh/update time on 1-wire network

PostPosted: Tue Dec 15, 2020 1:27 pm
by KMTronic
Hi,

I in a hurry test read Scratchpad one DS18B20 1-wire sensor 20 times.

Here is code:
Code: Select all
for ( int a = 0; a < 19; a++) {
 
          present = ds.reset();
          ds.select(addr);   
          ds.write(0xBE);         // Read Scratchpad
          for ( i = 0; i < 9; i++) {           // we need 9 bytes
            data[i] = ds.read();
            Serial.print(data[i], HEX);
            Serial.print(" ");
          }
          Serial.println();
}       
Serial.println("----------------------------");


SerialMonitor show:
13:02:24.882 -> ----------------------------
13:02:24.882 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.882 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.916 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.916 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.916 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.950 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.950 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.950 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.984 -> 50 5 4B 46 7F FF C 10 1C
13:02:24.984 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.018 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.018 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.018 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.018 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.018 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.052 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.052 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.086 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.086 -> 50 5 4B 46 7F FF C 10 1C
13:02:25.119 -> ----------------------------


So for reading 20 sensors you need approximately 200-250 ms.

Regards
KMtronic