16 ms·
Your DS18B20 temperature sensor is likely a fake, counterfeit, clone
- LyndsySimon 6y agoAnyone 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.
- myself248 6y agoI just bought a bunch of cheap indoor/outdoor weather sensors, I'd imagine they might apply.
- xfitm3 6y agoMay I ask what you bought? I've been looking for something like this but everything I've found has been pricey.
- jerkstate 6y agoFor me, I was using them as environmental sensors for an aquaponic setup (water more often when it’s hotter)
- as-j 6y agoIndoor/outdoor temp sensors. Anything that needs a cheap temp sensor. Really handy since they just steal power from the bus (parasitic) so you don't need to run extra wires for power.
- hannibalhorn 6y agoI have several for homebrewing - monitoring mash, sparge, and fermentation temps.
- jcims 6y agoI have a bunch for a related process. I don’t need them to be super accurate but they should be consistent and repeatable and the ones i have definitely are that.
- toast0 6y agoI put together some low effort esp8266 temperature/humidity probes. I used DHT chips cause they were cheaper/bundled with a board, but the tutorials said the DS chips were better.
- dbrgn 6y agoI use a waterproofed version as a water temperature sensor (in the lake).
- jerkstate 6y agoWow, 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?
- nullc 6y ago> Why not just give these mostly cloned parts their own honest name and part number? Would you have bought it, at the same price, if they had?
- MaxBarraclough 6y agoTo put that another way: the reason they go the fraud route is to easily profit from the good reputation of an established brand.
- tripletao 6y agoBecause even if a part is marketed as compatible with a well-known part, most buyers won't add a new, allegedly compatible part to the AVL (approved vendor list) without some level of engineering review. This guards against the kinds of incompatibilities that the article notes. Depending on the buyer, that review might be "yeah, [vendor] seems legit, fine", or a complete test build and evaluation; but by marketing their part as a counterfeit instead of a second source, the vendor bypasses that hurdle entirely.
- userbinator 6y agoWhy not just give these mostly cloned parts their own honest name and part number? Judging by what the page says, they do --- but someone down the line from the manufacturer remarks them to DS18B20s.
- as-j 6y agoThis 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...?
- exmadscientist 6y agoAnother 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....
- tachyonbeam 6y agoI've bought hundreds of electronic parts on eBay and rarely had issues. I discovered LED strips were a thing by shopping on eBay, years ago, much before they were trendy, I was buying them at one fifth the cost American retailers were charging. Bought Arduino clones for a quarter the price of the "real" thing when I was a broke student. ATMega MCUs for a dollar a piece, free shipping. They worked perfectly fine. Could not have afforded them without eBay. I'm Canadian, and last I checked, the shipping costs to get parts from places like digikey was just ridiculous.
- exmadscientist 6y agoI didn't say they don't work, just that I don't expect them to work. The prices are such that you can, and should, buy three items from three different vendors and cross your fingers that one works. In professional engineering, where time is money, Digi-Key or Mouser is always more efficient, if they've got what you need. For personal stuff, where the value of your time is ~zero, the opposite can be true.
- andi999 6y agoI 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?
- fake-name 6y agoI mean, the entire article is basically documentation of that research. This isn't a peer-reviewed piece of work, it's a writeup of someone's fairly exhaustive research into a problem they encountered. I don't see why you'd need confirmation from another person that something you bought doesn't do what it's part number claims it should.
- andi999 6y agoMaybe I didnt read it carefully enough but to me he does not research it but just states it. I mean some (non counterfeit) production runs might not have the expected quality isnt this possible? If the rom signature is not garanteed by the ip holder than it still might be legit. Probably he is right though, but to me it reads like the conclusion is the premise. (Might be due to the writeup though) Edit: here is my bone: it says: how do I know? If the ROM does not follow the pattern 28-xx-xx-xx-xx-00-00-xx then the DS18B20 sensor is a clone [5]. And here I would have expected [5] to be the datasheet or something, but not 'own research'. The idea of citations is also to make your claims more verifiable. Now, if we look at the Datasheet: https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf it actually says:"The least significant 8 bits of the ROM code contain the DS18B20’s 1-Wire family code: 28h. The next 48 bits contain a unique serial number. The most significant 8 bits contain a cyclic redundancy check (CRC) byte that is calculated from the first 56 bits of the ROM code. A detailed explanation of the CRC bits is provided in the CRC Generation section." So the 28 is required. The '00-00' part is ust the higher bits of the unique serial number. I wouldnt be surprised if different factories get different higher bits.
- ggm 6y agoEthics aside, are they accurate enough for e.g. home brewing or fishtank usage, compared to parellax reading error on a traditional mercury/alcohol thermometer?
- asddubs 6y agodepends on what fake you get, based on the linked article. seems like for the most part yes
- ChrisMarshallNY 6y agoCounterfeit 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.
- kregasaurusrex 6y agoChips 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.
- ChrisMarshallNY 6y agoEspecially if they are to be used for something like monitoring for excessive heat in some kit that could catch fire.
- kregasaurusrex 6y agoIf 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.
- 0x402DF854 6y agoThis particular sensor isn't used in mass produced devices AFAIK. NTC thermistors are cheaper and easier to design for using cheap analog components. Reading DS18B20 is quite an exercise when it comes to $0.05 microcontrollers used in e.g. household appliances.
- kregasaurusrex 6y agoTrust 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-ftdi-drivers-are-killing-fake-chips/ https://hackaday.com/2014/10/22/watch-that-windows-update-ft... [1] https://hackaday.com/2016/02/01/ftdi-drivers-break-fake-chips-again/ https://hackaday.com/2016/02/01/ftdi-drivers-break-fake-chip...
- robomartin 6y ago> This anti-consumer behavior on behalf of companies I strongly disagree with this. I see no way to rationalize that a company should be responsible for ensuring that counterfeit devices work correctly by releasing drivers that are tolerant of them or do not stop them from functioning. FTDI's products are the combination of their hardware with their drivers. Both are required in order to delivery functionality and reliability to meet their specifications. Imagine your drivers are used in some sort of a critical application and a counterfeit device causes a failure that, in turn, causes harm to someone. An example might be a wired remote control for an industrial machine. It seems to met that bricking that device as soon as possible before harm is done is what we would want from a company that delivers a quality product. Another way to put it is: Let the counterfeiters engineer a real product and be responsible for their own drivers, quality and safety. The way to see clearly through some of these problems is to extend the definition towards extremes. Let's forget FTDI for a moment and generalize the problem to a microprocessor and a vendor-provided RTOS used to run the flight system of an airliner. This is a contrived hypothetical, forgive me for taking artistic license. Imagine counterfeit processor make it into the supply chain. Should the avionics OS do its best to work with every possible fake or should it brick it on power-up before that potentially dangerous aircraft gets off the ground? Another hypothetical could be one where we eliminate hardware completely. Imagine someone creates a fake Amazon, Facebook, NY Times or online brokerage site. Imagine proposing that the real companies would be anti-consumer if they created software that revealed the impostors. I could not imagine anyone who would propose they allow the fakes to continue to deceive consumers. From my perspective this isn't anti-consumer at all. It's as pro-consumer as you can get: You work hard to ensure quality, consistency, performance and reliability. The real anti-consumers are the counterfeit manufacturers. They, quite literally, could not care less. All they care about is tricking engineers and consumers into thinking they are designing and buying a quality product when, in reality, they might be dealing with dangerous junk.
- 6nf 6y agoOff 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?
- exmadscientist 6y agoDallas/Maxim usually likes their 1-Wire bus for that: https://en.wikipedia.org/wiki/1-Wire https://en.wikipedia.org/wiki/1-Wire The DS18B20 is, indeed, a 1-Wire device.
- codys 6y agoAs 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".
- pxx 6y agoYou 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.
- deleted 6y ago[deleted]
- 0x402DF854 6y agoI'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...
- metaphor 6y ago> However simply repeating requests until sensor reports a valid value (!=+85C and !=-127C) works fine. You know you're dealing with counterfeits and you know they're unreliable, but you've somehow convinced yourself that despite all the uncovered variance sitting on the table, if you keep poking long enough until the component returns some non-edge-case value, then it "works fine". I must have hopped on the sanity train quicker than I should have because it seems like I'm missing something critical in the narrative here.
- stickfigure 6y ago"If a straight line fit is required, only sample two points."
- 0x402DF854 6y agoYou are indeed missing something here :) Long 1-wire networks are notoriously unreliable [1]. Something that works fine today can stop working tomorrow. That doesn't mean that they shouldn't be used anywhere. They have their niche. If I want my heating system monitor to report temperatures once per hour and it takes me 5 tries and 10 seconds to read a sensor, I call it good enough. If monitor doesn't succeed after 20 retries, it sends an alert to replace the sensor (so far that only happened due to damaged wiring, not the sensor itself). It is possible (and quite fun) to build reliable systems using somewhat reliable components :) [1] https://www.maximintegrated.com/en/design/technical-documents/tutorials/1/148.html https://www.maximintegrated.com/en/design/technical-document...
- johnghanks 6y agowhy is this on github? has this guy not heard of literally any blogging platform ever?
- EricE 6y ago? Being on github didn't restrict me from reading it in the least. Not sure what the heck it being on github has to do with anything.
- fomine3 6y agoNot related to this case, but GitHub is a rare "social network" in western world that also available for mainland Chinese people.
- nojs 6y agoThat’s because it contains code rather than blog content - let’s keep it that way!
- numpad0 6y agoLiterally any blogging platform is worse than GitHub tho?
- jcfields 6y agoThe two .ino files in the repository are Arduino programs for testing the sensors. So it does contain 700-800 lines of code.
- sfgweilr4f 6y agoI 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.
- Teknoman117 6y agoThere'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.
- TazeTSchnitzel 6y agoA lot of chips are harvested (in horrifying conditions for the workers and the chips) from old electronics and then retopped.
- panitaxx 6y agoI 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.
- 0x402DF854 6y agoThat, or they slap huge markups for these otherwise unpopular products. Try to find a popular 16-bit ADS1115 ADC on digikey. They offer SMD 10X2QFN chip for $8, 10VSSOP for $10, assembled adafruit board for $22 (!!!) or DFRobot board for $15 (exact same board is half the price on ebay). In comparison, ADS1115 boards from aliexpress are $2.
- tzs 6y agoI'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 https://imgur.com/a/jPBTrvJ
- 0x402DF854 6y agoI remember reading somewhere that genuine ones have a sensing element anchored to the ground pin, so it might explain why it cools down faster when inserted into a breadboard
- vinhboy 6y agoVery cool analysis. Thanks for doing that and providing data. I also got one of these from eBay for my RPi a few years back. I haven't played with it in years but I remember being frustrated because the temperature reading did not match my home thermostat.
- rootsudo 6y agoSame 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-chips-again/ https://hackaday.com/2016/02/01/ftdi-drivers-break-fake-chip...
- panpanna 6y agoI sort of understand how the FTDI thing happened. They were charging an arm and a leg for an ancient IC, so China cloning it was really a no brainer. Thankfully, 1-2 companies came up with their own competing solutions which you now can buy for cents. If you are still using FTDI chips (fake or original) you might want to update your designs.
- unnouinceput 6y agoI 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?
- dejv 6y agoWell I guess when you invest in purchasing fab you want it utilized as much as possible, so you might want to add batch here and there when you dont have contract work.
- ajnin 6y agoFirst, when you make millions of a thing, then saving even fractions of a cent add up to a lot of money. Chinese manufacturers favor high volume, low margin products. Second, Maxim parts are not cheap, in fact they are among the most expensive in the IC industry. A single DS18B20+ goes for 3.47€ on Mouser right now. That's a juicy target for counterfeiters.
- unnouinceput 6y agoI don't know where you are, but in my country I paid the equivalent of 4 cents for DS18B20. I hook it up to my multipurpose Raspberry Pi and I use it to measure my room temperature. I bought 2 of them, for redundancy reasons when lockdown started. The other one is still in original package.
- esaym 6y ago>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
- djmips 6y agoThese acerbic comments make me feel like on Hackaday instead of Hacker News.
- Fej 6y agoI 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?
- Faaak 6y agoNot 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
- panpanna 6y agoWell, 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...
- classics2 6y agoPretty much every ic you buy from China was pulled off a scrap PCB by a 10 y/o girl squatting in a puddle of solder and burned wires using a torch. The chips are binned, straightened, tops sanded and black topped and marked with whatever sells best.
- edf13 6y agoAny cached version of this page since Github is down?
- amelius 6y agoOnly 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.
- lnsru 6y agoOnce 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.
- varispeed 6y agoHow is it even possible to sell products with these parts if you are unlikely going to get RoHS certificates? That's like asking to go bankrupt.
- lnsru 6y agoThese guys did other shady things balancing between unethical and criminal. I guess they would just deliver products with fake parts expecting to replaced them by redesigned ones in the future.
- VLM 6y agoIn 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.
- Avamander 6y agoThere'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.
- amadeuspzs 6y agoI 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.
- vilifiedtwin 6y agoPeople expect workers to be paid at least minimum wage, but they don't want to pay the price and buy from China... That is a pinnacle of hypocrisy in our world.