from Hacker News

Your DS18B20 temperature sensor is likely a fake, counterfeit, clone

by 0x402DF854 on 7/13/20, 12:09 AM with 230 comments

  • by kregasaurusrex on 7/13/20, 1:46 AM

    Trust in hardware supply chains when manufactring a PCB for a product can be quite fragile: when one component operates outside of spec, the entire device could be rendered useless. In the case of the DS18B20, the author states in the 'Warning' section that the primary way of determining counterfeit sensors is to check the ROM output compared to a known format. When counterfeit parts like this are added, it creates vulnerabilities in the entire system due to the ability for a bad actor to leverage this vulnerability and cause one part in an entire system to fail.

    For example, the company FTDI snuck in code that was in a series of Windows updates that was able to detect counterfeit FTDI and brick them via software to send back all 0's.[0][1] This anti-consumer behavior on behalf of comapnies can a be a headache for end-users and programmers alike.

    [0] https://hackaday.com/2014/10/22/watch-that-windows-update-ft...

    [1] https://hackaday.com/2016/02/01/ftdi-drivers-break-fake-chip...

  • by as-j on 7/13/20, 12:44 AM

    This affects temperature sensors/parts bought from un-official distributors like ebay or AliExpress, not digikey, farnel, etc. Perhaps I've been too lucky in my career and practiced EE for work, but who would you ever go to ebay instead of digikey?? <mind blown>

    Digikey certainly has a premium, but their speciality is small numbers/cut tape/etc and they have a small order size which makes them ok for hobby work, and I've used them for small production runs when I didn't want to end up with a ton of excess materials.

    Makes you wonder what other junk is out there, and what purchasing guy figured he'd save $10 and get it from ebay...?

  • by tzs on 7/13/20, 3:07 AM

    I've got one genuine one that I bought from Sparkfun near the end of 2015 and 10 more I got from Amazon in the middle of last year.

    I haven't gotten around to doing anything with the 10, but the genuine one has been hooked up to an RPi for a while, which is controlling a space heater.

    That was still using a solderless breadboard, so it was an easy matter to swap in the 10 one by one and check if they were genuine. As was probably to be expected, they are all counterfeit.

    They all seemed to be fairly consistent with each other and with the genuine one, although it turns out that these things are really sensitive to body heat--just holding one pinched between two fingers while slightly spreading the leads to fit the breadboard would heat it up 2-3 C. This made comparing different ones a bit confusing.

    The genuine one seems to cool back down to room temperature noticeably faster than the counterfeits. I wonder if the genuine ones take more care to ensure that the die is not too insulated from the outside world so it will be more responsive?

    Anyway, since I'm still using a solderless breadboard, and then things are designed to chain, it was not hard to rig it up so all 11 are hooked up at once [1]. (And yes, the resister is hooked up correctly. It is just a really bad angle in the photo that makes it look like it is off by one).

    I've got a program running now that checks them all periodically and logs all the readings. Here are results after it has been running about 20 minutes:

      22.437 [22.375, 22.25, 22.187, 22.312, 22.375, 22.187, 22.25, 22.25, 22.375, 22.25]
    
    The first one is the genuine one, and the array are the counterfeits.

    [1] https://imgur.com/a/jPBTrvJ

  • by Teknoman117 on 7/13/20, 2:26 AM

    There's so much fake stuff on eBay in the IC world. As someone who was looking to get into the retro electronics hobby, I'm bumped into a ton of fakes on eBay. I'm amazed that there are sellers in China who find it worth their while to fake "ancient" chips like the Intel 286 and Motorola 68040 and 68060. In the former case, they took lower speed parts and rebadged them as higher speed components and in the latter case, some are downright fakes that don't function.
  • by lnsru on 7/13/20, 10:51 AM

    Once I was working for a company having single Motorola 68K based design. They were selling their ancient design without changes for decades. Motorola 68K disappeared from market, they moved to Coldfire, but then peripheral chips got obsolete. It was a big problem. Junior boss started buying everything he could find in Chinese Internet stores. Everything was fake!!! Sometimes parts were empty shells, no silicon inside, some parts were rebadged modern parts, some parts had silicon inside, but weren’t functional. Solution was found using some shady brokers. They delivered parts at 50x price. Ancient real time clocks were bought for 100$ a piece. It was still better than not delivering products to final customers. Re-Design was started porting the design to Xilinx ZynQ, but I left. Lesson number 1: no Aliexpress parts in final products! Lesson number 2: obsolescence of parts is a big deal, it comes more often than one is prepared for. Lesson number 3: even for hobbyist Digikey or Mouser is a place to go. Free shipping to Germany buying for at least 50€. All parts worked as expected.
  • by 0x402DF854 on 7/13/20, 1:58 AM

    I've bought ~100 of these sensors from ali and ebay and 9/10 had troubles reporting temperatures in passive mode reliably. However simply repeating requests until sensor reports a valid value (!=+85C and !=-127C) works fine. Rarely I've seen sensors not working in passive mode at all.

    Still, I always recommend running an extra +VDC wire (3 wires vs 2 wires isn't a big inconvenience). When running large 1-wire buses (>100m long, dozens of sensors each), a dedicated power line is always a must.

    Another funny use for these sensors is a source of nonce/id. Weirdly, every single DS18B20 I've bought had a unique ROM address, even when I got large batches. I still PTSD about that batch of PCIE network cards with identical MAC addresses...

  • by jerkstate on 7/13/20, 12:38 AM

    Wow, I am pretty sure I had some of these, parasitic power would NOT work, I had it on a scope and everything. What a pain in the butt that was! Why not just give these mostly cloned parts their own honest name and part number?
  • by panitaxx on 7/13/20, 3:02 AM

    I buy from AliExpress and eBay not because of the shipping fee but because most of the time digikey/mouser doesn't sell hobbyist friendly form factors (like breakout boards) and some of this ic come in really tiny package (like tssop) which for an amateur are difficult to solder. Sometimes they need a resistor or a capacitor or a transistor easier to buy a board with everything on it that you stick to another board and that's it.
  • by ChrisMarshallNY on 7/13/20, 1:18 AM

    Counterfeit chips are a huge problem, these days.

    I suspect that a significant number of Bluetooth chips are fake; even in very expensive kit.

    I got tired of having expensive headsets croak after less than a year, while my cheap 20-dollar exercise headsets lasted for four years.

  • by unnouinceput on 7/13/20, 3:56 AM

    I don't get it. Why bother faking something that is very cheap to make genuine? I mean you pay peanuts for real deal, and you want to make something even cheaper then that?...why? Where is the profit?
  • by sfgweilr4f on 7/13/20, 2:14 AM

    I buy all sorts of fine parts off ebay/aliexpress. A lot from China. No issues so far. All work within expectations. But I'd never base a product on any of them. Nor go fine tolerance / high expectation either. Not without very high trust. There is such a thing as a savvy* buyer who has a suspicious and not naive mind.

    Then again, hardware is a hobby for me. My level of "buyer beware" means a slew of parts cannot be purchased from ebay so maybe that is a factor?

    I can't fathom anyone using ebay for serious products that would be sold to a supported customer with any kind of actual warranty. The mind boggles. I have, however, dabbled with alixpress and found speaking Chinese useful to the extent I made a short run of my own gadgets with humble success. No I'm not a hardware company. Just had an issue that needed a gadget so I made it happen.

    * No flash memory or any similar memory devices. No FTDI gadgetry. No battery of any kind. Nothing that involves oddball power supplies. I parts bin any power supply "ebay-direct-from-China" as I don't trust any of them.

  • by esaym on 7/13/20, 4:18 AM

    >If the ROM does not follow the pattern 28-xx-xx-xx-xx-00-00-xx then the DS18B20 sensor is a clone

    Darn, my sensor from usbtemp.com has 28 FF EC C5 21 17 04 99

  • by ggm on 7/13/20, 1:14 AM

    Ethics aside, are they accurate enough for e.g. home brewing or fishtank usage, compared to parellax reading error on a traditional mercury/alcohol thermometer?
  • by 6nf on 7/13/20, 1:51 AM

    Off topic but... how do you do IO on a chip that only has 3 pins? I assume you need one pin for V+ and one pin for Ground and then there's only one pin left for both I and O?
  • by rootsudo on 7/13/20, 3:18 AM

    Same as most USB to serial adapters, Prolific (PL2303) and FTDI FT232RL.

    What's fun is one of them updated a driver, which bricks counterfeits.

    https://hackaday.com/2016/02/01/ftdi-drivers-break-fake-chip...

  • by andi999 on 7/13/20, 1:11 AM

    I am a bit disappointed about that a lot of his claims how to identify clones are referenced with [5] own research. I mean doesnt one need confirmation from the IP holder?
  • by panpanna on 7/13/20, 6:17 AM

    Well, the original components costs 1-2 dollar when bought directly from Dallas but you can buy 10 PCBs (with additional supporting components) for $3 on AliExpress. It was extremely obvious to everyone that these were fakes.

    But... while I fully understand the ethical issues, there is also an interesting engineering challenge here were you can sometimes get your design to work even with crappy fake components.

    Btw, if you think this is bad, try ordering some jfets from China...

  • by Avamander on 7/13/20, 2:40 PM

    There's the same issue with nRF24L01+ radios that are very widespread. Unfortunately, the fakes also have errata and cause problems when people try to use them.
  • by Faaak on 7/13/20, 5:44 AM

    Not an excuse, but when you compare the relative simplicity of these sensors compared to their retail price 2$+, I can see why they would be cloned
  • by VLM on 7/13/20, 12:57 PM

    In the old days if you wanted sweepings from the factory floor you shopped at Radio Shack. Usually worked well enough anyway. Just like ebay or amazon today, usually.

    I've had worse luck with assemblies than components; switching supply modules from ebay / amazon don't come with decoupling caps or RFI inductors or RFI chokes.

  • by amelius on 7/13/20, 10:01 AM

    Only slightly related but why do manufacturers have so much trouble printing the type and or value of the component onto the package? Often it's not even readable with a magnifying glass unless the lighting is from exactly the right direction.
  • by amadeuspzs on 7/13/20, 2:50 PM

    I just ordered a bunch of these, yesterday, from Farnell.

    I've received fake electronics from 3rd party Amazon sellers and eBay.

    For testing a PoC I will buy knowing there is a risk it's likely fake - but once I've validated a design I'll go to Farnell.

  • by Fej on 7/13/20, 5:22 AM

    I have one of these, purchased from Adafruit - they're not an authorized distributor but they're certainly reputable. My unit works fine but I haven't tested it yet... anyone else bought from them?
  • by LyndsySimon on 7/13/20, 12:35 AM

    Anyone have an idea what these are used in? I originally thought they might be used for 3D printing, but that doesn’t seem to be the case - except, perhaps for chamber temperature.
  • by edf13 on 7/13/20, 7:43 AM

    Any cached version of this page since Github is down?
  • by djmips on 7/13/20, 5:04 AM

    These acerbic comments make me feel like on Hackaday instead of Hacker News.