DS18B20 PCB Design Guide: Footprint, Pinout, and Alternatives
1-Wire digital temperature sensor; heavily counterfeited.
The DS18B20 is the default digital temperature sensor for anything that isn't on an I2C bus: a 3-pin TO-92 that measures −55 to +125 °C, holds ±0.5 °C from −10 to +85 °C, and talks over Maxim's 1-Wire protocol on a single data pin. Every device carries a factory-lasered 64-bit ROM code, so dozens of sensors can share one wire — the reason it dominates multi-point sensing like aquariums, fermenters, and heating systems. It began life as a Maxim Integrated part and is now sold and documented under Analog Devices.
Its popularity has a dark side: the DS18B20 is one of the most counterfeited components in the hobby supply chain. The loose TO-92s and pre-made waterproof probes on marketplace listings are overwhelmingly clones, and they misbehave in exactly the corners the datasheet guarantees — parasite power, accuracy at temperature extremes, and register behavior. If the reading matters, buy from an authorized distributor.
Beyond provenance, DS18B20 problems on real boards come down to four wiring and firmware decisions: the DQ pull-up value, bus topology on long cables, parasite versus powered supply, and handling the 750 ms conversion time without blocking. Each is covered below.
What breaks boards
Assume marketplace parts are counterfeit until proven otherwise
Clones dominate the loose-part and waterproof-probe supply. They often report plausible temperatures at room ambient but deviate from the genuine part in parasite-power mode, in accuracy toward the −55 and +125 °C extremes, and in undocumented scratchpad/register behavior — some fail outright on parasite power. Community fake-detection scripts identify clones by probing those undocumented registers. For anything beyond a toy, source from authorized Analog Devices distributors and run a detection check on incoming stock.
4.7 kΩ on DQ is the baseline pull-up — long cables need more thought
The datasheet calls for an external pull-up of approximately 5 kΩ on the 1-Wire bus, and its application circuits show 4.7 kΩ. That value is right for short runs; on long cables the added capacitance slows the rising edge, and the standard fix is a lower pull-up value. Just as important is topology: wire sensors as a linear daisy-chain, not a star — star branches create reflections that show up as intermittent CRC errors.
Parasite power is clever but fragile — power the VDD pin if you can
In parasite mode the sensor steals power from the DQ line, but during a temperature conversion it needs more current than a resistor pull-up can deliver, so the datasheet circuit adds a MOSFET to hard-pull DQ high during conversions. That extra part, plus the timing discipline it demands and the fact that clones handle parasite mode worst, makes the powered 3-wire connection the better default. Wire VDD (3.0–5.5 V), and save parasite mode for retrofits where only two conductors exist.
A 12-bit conversion takes 750 ms — don't block on it
Maximum conversion time is 750 ms at 12-bit resolution (93.75 / 187.5 / 375 ms at 9/10/11 bits). Firmware that issues Convert T and spin-waits freezes its main loop for most of a second per sensor. Start the conversion, carry on, and read the scratchpad after the interval has elapsed — with multiple sensors, broadcast the convert command so they all convert simultaneously. Dropping to 9-bit (0.5 °C steps) cuts the wait eightfold when resolution doesn't matter.
Multi-drop means ROM-code management in firmware
Each DS18B20 has a unique 64-bit ROM code, and addressing on a shared bus is done by that code. Your firmware must enumerate the bus (the 1-Wire search algorithm) and then persist the mapping of code to physical location — after a sensor swap, the new device has a new address and your "boiler outlet" reading silently becomes some other probe unless the mapping is updated. Design the config store and a re-enumeration path up front.
Key specifications
| Parameter | Value | Source |
|---|---|---|
| Measurement range | −55 °C to +125 °C measurement range | DS18B20 datasheet 19-7487 Rev 6, Benefits and Features / DC Electrical Characteristics |
| Accuracy | ±0.5 °C max from −10 °C to +85 °C (±1 °C from −30 to +100 °C, ±2 °C from −55 to +125 °C; 3-sigma limits, Note 3) | DS18B20 datasheet 19-7487 Rev 6, DC Electrical Characteristics, Thermometer Error (tERR) |
| Resolution / conversion time | 9/10/11/12 bits; max conversion time 93.75 / 187.5 / 375 / 750 ms respectively | DS18B20 datasheet 19-7487 Rev 6, AC Electrical Characteristics, tCONV |
| VDD range | 3.0 V to 5.5 V (both local power and parasite power; VPU 3.0 V to 5.5 V parasite / 3.0 V to VDD local) | DS18B20 datasheet 19-7487 Rev 6, DC Electrical Characteristics |
| 1-Wire pull-up | External pull-up of approximately 5 kΩ required on the 1-Wire bus; datasheet application circuits show 4.7 kΩ | DS18B20 datasheet 19-7487 Rev 6, Hardware Configuration section ('external pullup resistor of approximately 5kΩ') and Figures 3/5/6 (4.7 kΩ) |
| Package options | 3-pin TO-92 (DS18B20), 8-pin SO 150 mil (DS18B20Z), 8-pin µSOP (DS18B20U) | DS18B20 datasheet 19-7487 Rev 6, page 1 and Ordering Information |
Verified against the manufacturer datasheet on 2026-07-09. Confirm the current revision before production use.
Alternatives
- MAX31820 — the cheaper sibling, but with real cuts: supply is 3.0–3.7 V only (it cannot run at 5 V) and the ±0.5 °C band is just +10 to +45 °C versus the DS18B20's −10 to +85 °C, with ±2 °C over the full range.
- SHT31 — adds relative humidity and better accuracy over I2C — but I2C is not designed for long cable runs, so it doesn't replace the DS18B20 for remote probes.
- TMP36 — analog output: no protocol and no addressing, so one ADC pin per sensor, and the millivolt-level signal is noisier over distance.
Common questions
- What pull-up resistor does the DS18B20 need?
- An external pull-up of approximately 5 kΩ on the DQ line — the datasheet's application circuits show 4.7 kΩ, which is the standard choice. On long cable runs, cable capacitance slows the bus edges and a lower pull-up value plus a daisy-chain (not star) topology keeps CRC errors away.
- Should I use DS18B20 parasite power or a separate supply?
- Prefer the powered 3-wire connection: VDD accepts 3.0 to 5.5 V and it just works. Parasite mode needs a MOSFET strong pull-up during conversions and stricter timing, and counterfeit parts misbehave in parasite mode more than anywhere else. Reserve it for two-conductor retrofits.
- How long does a DS18B20 conversion take?
- Up to 750 ms at the default 12-bit resolution; 9, 10, and 11 bits take at most 93.75, 187.5, and 375 ms. Start the conversion and read the result later instead of blocking, and broadcast the convert command so multiple sensors convert at once.
- How do I detect a fake DS18B20?
- Clones dominate loose parts and waterproof probes, and they deviate from the datasheet in parasite-power behavior, accuracy away from room temperature, and undocumented register behavior — which is exactly what community fake-detection scripts probe for. The reliable fix is buying through authorized Analog Devices distributors.