Fake DS18B20?

Hi,

I've seen some posts about fake DS18B20 sensors floating around. I've bought some sensors for cheap off eBay (Spanish seller). I think I paid around $2-$3 per piece.

I have 6 of these Spanish DS18B20s, and one locally sourced, from a reputable vendor. The Spanish ones "drop off" the 1-wire bus after a while (between 5 minutes up to some hours it seems), and do not show up again. If I disconnect the sensor for a few seconds, it will reappear once reconnected.

The sensors only seem to "drop off" when I actually query them for temperature a few times. They will stay on the bus (at least for a longer time) when I simply query their presence, but don't trigger temperature conversion.

My locally sourced sensor doesn't have the same "disappearing" issues.

I get some CRC errors from both my locally sourced sensor and the Spanish ones - but as mentioned, the issues are not permanent with the locally sourced ones.

Any ideas on how I can tell if the DS18B20s are bad, or if my wiring is simply bad?

At my disposal, I have a logic analyzer, but no scope. What I have seen so far is simply complete silence from the Spanish sensors after their "disappearance" on the bus.

FWIW, I'm using a Raspberry Pi 3, and am thus bit-banging 1-Wire through a GPIO-pin. I've connected 5V VDD to all sensors on my bus (I have a capacity of 5 sensors).

I bought all my DS18B20 sensors off ebay from Chinese vendors and never faced a problem with any of them.
I ve had them continuously in service for months .

When you compare your "reputable" sensors with the "fake" ones , are all other setup /software parameters identical?

This saves all the timing problems. In setup() after sensors.begin() add sensors.setWaitForConversion(false).
Then, in loop after sensors.requestTemperatures() you can call: sensors isConversionComplete()
which returns false until the conversion has completed. This allows you to run other process as needed while waiting for the conversion to complete. This code is non blocking and works very well for me. There is a lot of information on this web site for this. There are library dependencies so check: isConversionComplete is not implemented · Issue #12 · milesburton/Arduino-Temperature-Control-Library · GitHub.

As far as pi you will have to translate the code.

Good Luck and Have Fun! Gil

Hi,
Are you using pullup resistors on the data line?

A 4k7 resistor between data and +5V.

Tom... :slight_smile:

what are the ROM numbers of the sensors you suspect are fake?

Counterfeit DS18B20 show all kind of funky behavior that seems to be predictable based on the ROM (see examples here: GitHub - cpetrich/counterfeit_DS18B20: How to tell original from fake DS18B20 temperature sensors.).