A while back I bought two DS18B20 for half price, and today I bought another one for double the price. The part number on the cheaper one is printed while on the expensive one it's laser etched:
On the left is the expensive one.
Even though the price was double, the readings that I'm getting using Arduino are the same:
Sensor1 is the expensive one. While the temperature on mercury thermometer was 23.9-ish degrees.
So what's the difference? Why is the build quality and price different but the temperature readings are the same?
Best Answer
There isn't any good way to know. As Elliot Alderson rightly points out, both could be legitimate, or both could be fake.
Here is a nice presentation from Xtreme Semiconductor, a company that specializes in detecting counterfeit parts. Slides 20-31 show some examples of the tricks people pull when making counterfeit parts. Some are easy to detect with the unaided eye, others require advanced tricks like X-ray or opening up the part, as shown in the same slide set. Probably not something you're looking to do here.
tl;dr Just because the parts look different and were priced differently doesn't necessarily mean that one is good and/or one is fake. Put the part through rigorous testing, or just buy a new part from a trusted source.