Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

DS18B20 with ESP32-S3-DevKitC-1 — several probes on one pin

Read one or more DS18B20 waterproof probes on GPIO5 of an ESP32-S3-DevKitC-1 with a single 4.7 kΩ pull-up, each probe identified by its address.

Arduino C++Verified — core esp32 3.3.12, OneWire 2.3.8, 3 Nov 2026Compile-only

Community draft — report a mistake

DS18B20 probes are ideal for water tanks, solar water heaters and freezers. Because every probe has a unique 64-bit address, any number of them can share one pin.

On the S3-DevKitC-1 use GPIO5 for the bus with one 4.7 kΩ pull-up to 3V3. The sketch lists every probe it finds and its temperature every 2 s.

Wiring

ESP32-S3-DevKitC-1Only the pins used are shown · 3.3 V logicDS18B20 (1-Wire)4.7k → 3V33V35 · 5GNDGNDDQVDD
Also needed: 4.7 kΩ resistor.
Every connection
ESP32-S3-DevKitC-1DS18B20 (1-Wire)WireNotes
3V3VDDred
5DQyellow
3V3DQredVia 4.7 kΩ — One pull-up for the whole bus, however many probes.
GNDGNDblack

3.0–5.5 V part, 3.3 V board. Power it from your board's logic voltage (3.3 V on ESP32/Pico, 5 V on Uno) so DQ never goes above the GPIO limit. DQ needs a 4.7 kΩ pull-up to that same supply.

Board quirks

  • GPIO5 has no boot role. Keep 1-Wire pull-ups off the S3’s strapping pins (0, 3, 45, 46) — a pull-up on GPIO45 can select 1.8 V flash and stop the board booting.
  • Wire all probes in parallel (red to 3V3, black to GND, yellow to GPIO5). The sketch prints the last two bytes of each probe’s address so you can label them — tank top, tank bottom, and so on.
  • Over 5 m of cable, drop the pull-up to 2.2 kΩ and use twisted pair.

Code

ds18b20-esp32s3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// DS18B20 probes on an ESP32-S3-DevKitC-1 — reads every probe on the bus.
// VDD → 3V3, DQ → GPIO5 with a 4.7 kΩ pull-up to 3V3, GND → GND.
#include <OneWire.h>
#include <DallasTemperature.h>

constexpr uint8_t ONE_WIRE_PIN = 5;
OneWire oneWire(ONE_WIRE_PIN);
DallasTemperature sensors(&oneWire);

void setup() {
  Serial.begin(115200);
  sensors.begin();
  Serial.printf("DS18B20 on GPIO5 — %u sensor(s) found\n", sensors.getDeviceCount());
}

void loop() {
  sensors.requestTemperatures();
  uint8_t n = sensors.getDeviceCount();
  for (uint8_t i = 0; i < n; i++) {
    DeviceAddress addr;
    if (!sensors.getAddress(addr, i)) continue;
    float t = sensors.getTempC(addr);
    Serial.printf("Probe %u (…%02X%02X): %.2f °C\n", i, addr[6], addr[7], t);
  }
  if (n == 0) Serial.println("No sensor answered — check the 4.7 kΩ pull-up and DQ wire");
  delay(2000);
}

Library: DallasTemperature (Miles Burton (also install OneWire by Jim Studt / Paul Stoffregen)) — compiled with OneWire 2.3.8.

Expected serial output

Serial Monitor · 115200Output
DS18B20 on GPIO5 — 2 sensor(s) found
Probe 0 (…A1C3): 26.44 °C
Probe 1 (…07F2): 31.06 °C

Common errors

Reads −127 °C

Missing pull-up or broken DQ wire. Full fix.

Found fewer probes than connected

One probe has a bad joint, or the cable run is too long for 4.7 kΩ — try 2.2 kΩ.

↑↓ to move · Enter to open