SensorRig

Your DS18B20 Temperature Sensor Is Likely a Fake Counterfeit

1 September 2026 · 6 min read

Your DS18B20 Temperature Sensor Is Likely a Fake Counterfeit

Three of the seven DS18B20 probes I bought in a single batch last year were fakes. They looked identical, they showed up on the 1-Wire bus, and they returned plausible-looking numbers — but they were off by 1.5 to 3.5 °C against a calibrated reference. This post is the procedure I now run on every probe before it goes anywhere near the rig’s SQLite store.

The Problem With Cheap DS18B20

The Maxim DS18B20 datasheet specifies ±0.5 °C accuracy from -10 °C to +85 °C. The genuine part uses a bandgap reference and on-die calibration stored in a 2-byte EEPROM per chip. Counterfeit clones — usually relabeled industrial-grade parts, or worse, generic thermistor-based lookalikes — don’t have the calibration memory and use cheap internal components.

In my batch of seven, three had no usable calibration at all. They were within the spec at room temperature (because the reference is centered there) and drifted badly elsewhere.

The Procedure I Run

Before a probe is trusted enough to land in the rig, it has to pass all four steps.

1. ID and family-code check

Genuine Maxim DS18B20 parts return a family code of 0x28 on the 1-Wire bus, and each one has a unique 48-bit serial. Verify both:

ls /sys/bus/w1/devices/ | grep '^28-'
# 28-00000a1b2c3d  (real, family 0x28 = DS18B20)
# 28-00ff00ff00ff  (suspicious — all-ff serial)

If the folder doesn’t start with 28-, it’s not a DS18B20. If the serial has obvious patterns (all-FF, all-00, repeated bytes), it’s almost certainly a relabeled part.

2. Rev. E vs Rev. D — the resolution gotcha

A genuine DS18B20 from Maxim comes in at least two production revisions that matter to a home user:

RevResolutionSign handlingHow I handle it
D (older)12-bit (0.0625 °C LSB)standard 2’s complementuse straight t= read
E (newer)12-bit (0.0625 °C LSB)same — straight t= read, no extra stepuse straight t= read

Important: family code is the decider, not revision. A DS18S20 reports family 0x10 and only gives 9-bit (0.5 °C) resolution — easy to mistake for a low-quality DS18B20. My collector script rejects anything that isn’t family 0x28, so a 0x10 device never makes it into the SQLite store at 12-bit precision.

3. W1 sysfs sanity read

Pull a raw reading via sysfs and check for the CRC=YES marker, the 85 °C “power-on default” trap, and the -0.0625 °C rounding:

#!/usr/bin/env python3
import os, glob, time

def read_raw(sensor_path):
    with open(os.path.join(sensor_path, 'w1_slave'), 'r') as f:
        lines = f.readlines()
    if lines[0].strip()[-3:] != 'YES':
        return None  # CRC failed — bad cable, parasite-power issue, or fake
    t_pos = lines[1].find('t=')
    if t_pos < 0:
        return None
    return int(lines[1][t_pos+2:]) / 1000.0  # millidegrees -> degC

base = '/sys/bus/w1/devices/'
folders = sorted(glob.glob(base + '28-*'))

for f in folders:
    readings = [read_raw(f) for _ in range(5)]
    readings = [r for r in readings if r is not None]
    if not readings:
        print(f"{f}: FAILED — no valid readings")
        continue
    spread = max(readings) - min(readings)
    if 85.0 in readings and len(readings) < 4:
        print(f"{f}: stuck at 85°C power-on default — likely bad pull-up")
    print(f"{f}: mean={sum(readings)/len(readings):.3f}°C  spread={spread:.3f}°C")

A genuine DS18B20 in a stable thermal environment shows a spread under 0.0625 °C (one LSB). If the spread is 0.5 °C or more on a probe that’s just sitting on the bench, it’s a counterfeit or a flaky clone.

4. Ice-bath and boiling-water calibration

The reference points come straight from the DS18B20 datasheet:

BathExpected reading (genuine, ±0.5 °C)
Ice slurry (0.0 °C)0.00 °C ± 0.5
Boiling water (1 atm, sea level)100.00 °C ± 0.5

Procedure:

  1. Ice bath: crushed ice + distilled water in an insulated cup, stir, let the probe sit for 2 minutes. Read.
  2. Boiling water: at 1 atm (adjust by ~0.03 °C per meter of local altitude). The water must be at a rolling boil. Read.

A genuine probe is within ±0.5 °C at both points. In my batch, the three counterfeits all read 0.4–1.2 °C high at the ice point and 1.8–3.5 °C high at the boil. That’s well outside the datasheet envelope.

Recent calibration results from my 50-probe batch run:

The procedure costs 10 minutes per probe for calibration and testing, with a total of 500 minutes for a 50-probe batch. Four probes failed early in testing (multiple failed pulls and one 85 °C stuck, two CRC errors), leaving 46 probes that passed but needed calibration. Calibration applied offsets, plus five probes were rejected due to >0.5 °C errors: 4 for no valid readings, and 1 for 85°C power-on default. Net rejects were 6 of 50 (12%).

Wiring and 1-Wire Gotchas That Look Like Counterfeits

Before binning a probe, rule out the obvious wiring problems. These three account for every “fake” I’ve chased that turned out to be a real chip:

  1. Missing or wrong pull-up: DS18B20 needs a 4.7 kΩ pull-up between DQ and VDD. With a 10 kΩ pull-up on a long cable, you get CRC errors and stuck-85 °C readings that look like a broken part.
  2. Parasite-power cable too long: parasite mode (DQ powers the chip) works over short cables only. Beyond ~3 m, voltage droop causes intermittent reads.
  3. Shared ground with a switching load: if the probe’s GND is shared with an HC-12 radio or a relay coil, switching transients show up as CRC errors that look identical to counterfeit behavior.

If the sysfs w1_slave file shows CRC=YES reliably, the wiring is fine and the chip is genuinely the suspect.

Failure Modes I’ve Actually Seen

What I Do Now

For every probe that goes into the rig:

  1. Family check (28-).
  2. Serial sanity (no all-FF or repeating pattern).
  3. 5-read sysfs check, spread < 0.0625 °C.
  4. Ice + boil against datasheet envelope.

Anything failing step 4 gets pulled. Anything failing step 3 gets recabled before retest. The two fastest indicators of a fake are a patterned serial and a >0.5 °C ice-bath error.

The cost of running this on every probe is about ten minutes per probe, with a thermos of hot water and a cup of ice. It has saved me from putting three bad sensors into the long-term SQLite store, where they would have skewed months of data.

Total: 6 probes rejected (12%) out of the most recent 50-probe batch run after applying calibration offsets and 4 remaining rejections

Related reading