Main Site Documentation

Retrieving serial number from I2C device


Has anyone attempted to retrieve the serial # from a DS18S20 I2C device? I don’t want to reinvent the wheel especially when there is better code out there.


DS18S20 is NOT a I2C device but a OneWire device.
Code can be found here: and

Look here for how to get the address (serial#):

Note that the only difference between a DS18S20 and a DS18B20 is the resolution.



I looked at that code and there is not a method for retrieving the serial number.


This will print the address:

while (ow.Search_GetNextDevice(OW_address)
       for (i=0;i<8;i++) debug.print(OW_address[i]+":");


Thank you.That is much cleaner than the code that I wrote.