The DS18B20 is a digital temperature sensor that communicates through the One-Wire protocol. Like the DS2401 that we looked at earlier, it is housed in a three-pin TO92 package and can be read out using just one pin (plus ground). It’s made and sold by Maxim Integrated, although still labelled “DALLAS” on the package. Introduced in 1999, the DS18B20 was the successor to the DS1820 and provided a higher resolution (up to twelve bits, instead of the DS1820’s nine).
This part has become wildly popular over the past few years, because it is reasonably cheap, quite accurate, and very easy to use with microcontrollers. It is widely available online, but its popularity has, unfortunately, also given rise to an industry of fake DS18B20s. Although they usually work, there is no guarantee that they meet the specs listed in Maxim’s datasheet.
These fake chips are made by small semiconductor companies that have designed a drop-in replacement for the Maxim part, copying the exact functionality. There’s nothing wrong with second-sourcing a part like that (it’s how many semiconductor companies started in the first place), but marking them with the Dallas brand and selling them as if they’re genuine Maxim parts is of course illegal. Most likely it’s not the manufacturers that apply the fake label, but shady companies that buy large stacks of second-source chips, re-label them and sell them as if they’re the real thing.
The DS2401 is a chip that Maxim sells as a “Silicon Serial Number”. That’s pretty much what it is: a chip that contains a serial number which you can read out using a digital interface. This is useful if you’re producing a large number of identical devices but you want to give each one a unique number so you can track each individual device. This chip contains 64 bits of information, consisting of one eight-bit number indicating the chip family (for the DS2401 it’s 01), a 48-bit serial number, and an eight-bit checksum to verify the number is correct. Maxim guarantees that no two DS2401s will have the same serial number, so in theory they can produce 248 = 281,474,976,710,656 of these chips before they run out of numbers.
The DS2401 has a One-Wire interface, which is a clever serial interface designed by Dallas Semiconductor. It has one ground and one active wire, which doubles as data and power supply. The chip gets its power from this wire, and contains an on-board capacitor to store charge so it can keep working even if the data line is “low” for a certain amount of time.
The One-Wire interface is quite easy to use, and it takes just a few lines of Arduino code to read out the serial number from the DS2401. I bought three of these chips, which turned out to have serial numbers 00001D04714B, 00001D04763D and 00001D0498E7. As you can see they’re not exactly consecutive, but since they came as loose chips in a bag there’s no way of keeping them in the right order anyway.