Refresh/update time on 1-wire network

Forum about 1-Wire devices.
Post Reply
the__creature
Starting Member
Starting Member
Posts: 2
Joined: Wed Dec 02, 2015 10:53 pm

Refresh/update time on 1-wire network

Post 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
KMTronic
Starting Member
Starting Member
Posts: 1
Joined: Tue Dec 15, 2020 1:02 pm

Re: Refresh/update time on 1-wire network

Post 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
Post Reply

Return to “1-Wire Forum”