I have used DS18B20 temperature sensors many times and understand that they can be daisy chained on the same data pin. Could two different sensors be connected in the same manner?

For instance, could I use the same data pin to read data from both a DS18B20 and a DS2417? Would there be any limitations concerning either the hardware or the code aspect?

Taking a look at the example code on arduino.cc:

if ( addr[0] == 0x10) {
      Serial.print("Device is a DS18S20 family device.\n");
  else if ( addr[0] == 0x28) {
      Serial.print("Device is a DS18B20 family device.\n");
  else {
      Serial.print("Device family is not recognized: 0x");

It is clear that there is at least some tolerance for different devices, however the DS18B20 and DS18S20 are both temperature sensors and aren't all that different


1 Answer 1


There seems to be no difference in the protocol for the various chips, and generally one wire protocols allow you to mix and match. The one wire protocol here basically has a way of cycling between the devices. Other devices ignore all communications until a certain pulse is sent, which switches to the next device. With this in mind, it seems logical that daisy-chaining different ICs will work as well, since there is only a small point in time where there is more than one IC truly involved in the communication. And at that point the protocol has nothing to do with the specific device, it's just a matter of a reset pulse.

Besides, the picture here makes it abundantly clear that the 1 Wire protocol allows one to chain different devices:

enter image description here

  • 1
    \$\begingroup\$ +1, good answer. The 1-Wire protocol is by Dallas Semiconductor Corp. \$\endgroup\$ Apr 13, 2013 at 4:27
  • \$\begingroup\$ @AnindoGhosh: Hm. I thought that was a different 1WP, but you seem to be correct :) \$\endgroup\$ Apr 13, 2013 at 5:17

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .