After purchasing many DS18B20 sensors and probes on ebay I can assure you that price is a useless indicator for quality.
Let me address the question in the title of this thread: Which one of these DS18B20 temperature sensors is fake?
Fortunately, you can find out for yourself: you cannot proof that a part is authentic but if it behaves differently from an authentic, Maxim-produced DS18B20 then it is certainly a fake.
After looking at some hundreds of DS18B20 and comparing them to chips that are known to be produced by Maxim Integrated I concluded that the manufacturers of counterfeit DS18B20 do not bother to conceal the fact that they're counterfeit. They just try to make them look and act authentic enough to be able to sell them.
Based on that conjecture, try this:
- Does the part have a ROM code that matches the pattern
28-xx-xx-xx-xx-00-00-xx? If not, then it is not Maxim-produced. (Manufacturers of counterfeit parts seem to go to some length to make sure the ROM codes of their chips do not collide with the ROM codes of Maxim's or other producers' chips.)
- In the scratchpad register, look at byte 6 (reserved and value not specified in current datasheets. It reads
0x0c right after power-up and before the first temperature conversion -- if it doesn't even read
0x0c right after power-up then your part is definitely a fake). If this byte does not change following
44h temperature conversion commands even though the temperature reading changes then your DS18B20 is not produced by Maxim. (Background: Byte 6 is used in the DS18S20 to get 12-bit temperature resolution, and the DS18B20 and DS18S20 share the same circuit to the maximum extent possible, see detailed description in Maxim Application Note 4377.)
- There are many other ways to tell, e.g. you can look for implementation bugs, implementation detail (e.g. the amount of time it takes to actually perform a temperature conversion), or response to undocumented function codes. I've summarized a bunch of differences I came across here: https://github.com/cpetrich/counterfeit_DS18B20
- Ask Maxim tech support if the combination of date code and batch code printed on the chip exists in their database.