Live data from Hacker News

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

github.com

41–50 of 239 posts

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

#41

Earlier quoted context omitted.

Chips have a higher value on a BOM, and as such have more financial incentives to be reverse-engineered and counterfeited. This is a bit more interesting since it's a sensor that has several operating parameters that "sort-of" send expected data back, but depending on the operational characteristics could need to be recalled entirely.

Especially if they are to be used for something like monitoring for excessive heat in some kit that could catch fire.

If this was used in a BMS with a lithium battery, a counterfeit sensor's behavior could result in the total loss of a device. Let's say the device's PCB is designed such that the sensor is connected to a rail that requires parasitic power, and you were unexpectedly shipped the D1 variant that outputs garbage data back to the onboard firmwre instead the proper temperature. Your company would have to recall every device in that manufacturing run at great expense, if it weren't caught early enough by QA.

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

#42
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...

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

#43
post #38

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?

As exmadscientist noted, these use the 1wire bus.

The general mechanism (to use 1 io pin as both an input and an output) though is to have the io-pin operate in "open collector" mode. Essentially: it assumes that there is something external "pulling up" the io _line_ (normally a resistor attached to the positive logic level), and all devices attached to the io-line only "pull down" (ie: output the 0 logic level, normally 0v) on their io-pin. The io-pins, thus, have 2 states: low (ie: 0v), and hi-z (high impedance, ie: not driving the output in any direction)

This ensures that no device on the io-line will directly push/pull against the level being driven by the other device (because all devices only drive 0v, and none drive the the logic 1 level, they rely on the pull up).

Then to allow communication to occur reasonably (without both ends pulling the io-line low all the time), buses like 1wire specify how the devices decide which one "wins" (ie: gets to transmit it's data), or which one goes first, or which one directs the other devices to "talk".

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

#44
post #38

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?

You only need one data wire for 1-Wire buses, but it's even better than that: you'll note that the page talks about a "parasitic power mode". This chip (and other 1-Wire devices) operates in a mode where you only need two wires: DQ and GND; it uses an internal capacitor to draw power from the data bus.

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

#45

Earlier quoted context omitted.

I'd never expect to find these in official products from trusted brands, but off-brand crap? Oh yeah. DIY kits? Absolutely. The parts drawer at the makerspace? One hundred percent. So much stuff on eBay is free shipping, that's huge when you only need a few dollars worth of stuff. If I could convince Digi-Key to lick a 55-cent stamp when I need ten of something, instead of charging me $7 for shipping, I'd have a lot…

There will be no licking of 55 cent stamps. US stamps have been 100% self-adhesive since 2016ish. The envelope is of course another matter.

Not to mention the obvious, but that glue isn't necessarily that great* for you either.

* allegedly of course.

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

#47
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.

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

#48
post #6

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?? 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 the…

Another professional EE here. I never expect random chips bought off AliExpress/eBay/Amazon/etc to work, much less be genuine. I do expect breakout modules and the like to work, though I don't expect them to contain genuine parts. (That implies I'd never source from these places when it's a critical function.) I'm always surprised when people expect grey-market crud to perform just as well as top-dollar stuff....

I do electronics as a hobby. I sometimes buy chips from very dubious shops in China for fun. Some of these sources are sketchy even by Taobao/Aliexpress standards. Then I decap the chip by boiling the package in acid and inspect the die under a microscope. More than half of them are genuine. I get some nice surprises because even the chips that I expect to be absolutely fake can turn out to be genuine.

So far I've seen a ton of fake audio op-amps.

For discrete parts like transistors things are much simpler. Just build a simple test rig and test a few parameters. If they fall within the specs they're probably good enough. Of course it's not worth it to do this for jellybeans like 2N3904, but when some parts get obsoleted without a replacement (or they're too pricey) there isn't much else a lone hobbyist can do.

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

#50
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.
Post reply on HN