The standard 1 wire temp sensor wiring diagram for a DS18B20 requires exactly three connections to a microcontroller: VDD to a 3.3V positive rail, GND to the common ground, and DQ (data) to a GPIO pin, bridged by a 4.7kΩ pull-up resistor tied to the 3.3V rail. Unlike I2C or SPI, the 1-Wire protocol uses an open-drain architecture, meaning the sensor can only pull the data line low; it relies on that external pull-up resistor to bring the line high. If you omit the 4.7kΩ resistor, the data line will float, and your ESP32 or Arduino will read garbage data or throw a 'No devices found' error.

This guide walks through the physical terminal mapping, traces the circuit node-by-node from the power source to the sensor, and details exactly how to verify your wiring with a multimeter before you apply power to your microcontroller.

Terminal Pinout and Diagram Symbol Mapping

When looking at a standard schematic for a 1-Wire bus, you will see a microcontroller block, a sensor block (often drawn as a cylinder or a TO-92 transistor outline), and a zigzag resistor symbol. The most common physical package for the DS18B20 is the TO-92, which looks exactly like a standard 2N2222 transistor. Holding the TO-92 package with the flat face toward you and the pins pointing down, the pins are numbered 1 to 3 from left to right.

Bench Warning: If you wire a TO-92 DS18B20 backward (swapping Pin 1 and Pin 3), you are reverse-biasing the internal silicon. The chip will not output data, and the epoxy package will rapidly heat up to over 60°C within seconds. If your sensor feels hot to the touch immediately after powering the breadboard, disconnect it immediately; prolonged reverse polarity will permanently destroy the internal die.
Physical Pin (TO-92) Function Schematic Symbol Voltage State (Idle) Multimeter Verification Target
Pin 1 (Left) GND (Ground) Standard earth/chassis ground symbol (three descending horizontal lines) 0.0V Read < 0.5Ω to MCU GND pin
Pin 2 (Center) DQ (Data In/Out) Single line with a 4.7kΩ zigzag resistor branching to VDD ~3.2V - 3.3V (Pulled High) Read ~3.3V DC when bus is idle
Pin 3 (Right) VDD (Power Supply) Positive voltage rail marker (often an upward arrow or 'VCC' label) 3.3V (or 5.0V if using 5V logic) Read 3.28V - 3.35V DC relative to GND
N/A (Bus Component) Pull-up Resistor 4.7kΩ zigzag symbol connecting DQ line to VDD rail Passes ~0.7mA when line is pulled low Read 4.6kΩ - 4.8kΩ out of circuit

For a deeper look at the electrical characteristics and timing diagrams of the 1-Wire protocol, refer to the official Analog Devices DS18B20 datasheet. The datasheet confirms that while the sensor can operate from 3.0V to 5.5V, matching your pull-up voltage to your microcontroller's logic level (3.3V for ESP32, 5V for standard Arduino Uno) prevents logic threshold mismatches.

Node-by-Node Wiring Trace: Source to Load

A schematic is only useful if you can trace the physical current and logic paths on your workbench. Below is the exact node-by-node trace for wiring a DS18B20 to an ESP32 DevKit v1 using a standard 3.3V logic rail. We are using GPIO 4 for the data line, as it is a standard input/output pin without boot-strapping conflicts.

Node 1: The Power Source (ESP32 3V3 Pin)
Current originates at the ESP32's onboard 3.3V voltage regulator output. A jumper wire routes from the '3V3' pin on the dev board to the positive (red) power rail of the breadboard. This rail establishes the reference voltage for both the sensor's internal logic and the pull-up resistor.

Node 2: The Pull-Up Resistor Bridge
A 4.7kΩ through-hole resistor is inserted with one leg in the positive (3.3V) breadboard rail and the other leg in a shared central node (let's call it Row 10). This resistor is the defining feature of the 1 wire temp sensor wiring diagram. Because the DS18B20 uses an open-drain output, it contains an internal MOSFET that can connect the DQ pin to ground, but it has no internal mechanism to drive the pin high. The 4.7kΩ resistor provides the necessary weak pull-up to return the line to 3.3V when the MOSFET turns off.

Node 3: The Data Line (DQ / GPIO 4)
A jumper wire connects ESP32 GPIO 4 to Row 10. A second jumper wire connects Row 10 to Pin 2 (the center pin) of the DS18B20. Row 10 is now the shared 1-Wire bus node. When the ESP32 sends a read command, it toggles GPIO 4 low, then releases it to float high via the 4.7kΩ resistor. The DS18B20 then pulls the shared Row 10 node low in precise microsecond intervals to transmit its 64-bit ROM and 12-bit temperature data.

Node 4: Sensor Power (VDD)
A jumper wire routes from the positive (3.3V) breadboard rail directly to Pin 3 (right pin) of the DS18B20. This powers the sensor's internal ADC and logic circuitry in 'External Power Mode'.

Node 5: The Ground Return Path
Finally, the ground path is established. A jumper wire connects the ESP32 'GND' pin to the negative (blue/black) breadboard rail. A second jumper connects this negative rail to Pin 1 (left pin) of the DS18B20. This completes the circuit, providing the return path for the ~1mA operating current and establishing the 0V reference for the 3.3V logic signals. For detailed ESP32 pin constraints, always verify against the Espressif GPIO API reference to ensure your chosen pin isn't reserved for internal flash memory.

Breadboard Execution and Multimeter Verification

Before you upload your Arduino IDE or ESP-IDF code, you must verify the physical layer. Debugging 1-Wire issues in software is a waste of time if the hardware bus is floating. Set your multimeter to DC Voltage (20V range) and continuity mode, then follow this sequence.

  1. Verify the Power Rails (Power Off): With the ESP32 unplugged, set your meter to continuity (beep mode). Place the black probe on the breadboard's negative rail and the red probe on Pin 1 of the DS18B20. You should read < 1.0Ω. Move the red probe to the ESP32 GND pin; it should also read < 1.0Ω. This confirms a solid ground path.
  2. Verify the Pull-Up Resistor (Power Off): Keep the meter in continuity/resistance mode. Place probes across the two legs of the 4.7kΩ resistor on the breadboard. You should read between 4.6kΩ and 4.8kΩ (accounting for standard 5% tolerance and meter lead resistance). If you read infinite (OL), the resistor is unseated. If you read near 0Ω, you have a breadboard short.
  3. Verify VDD and DQ Idle Voltage (Power On): Plug in the ESP32 and upload a blank sketch (or one that sets GPIO 4 to INPUT_PULLUP). Set your meter to DC Voltage. Place the black probe on the negative rail. Touch the red probe to Pin 3 (VDD). You must read between 3.28V and 3.35V. Move the red probe to Pin 2 (DQ). You should also read ~3.3V. If DQ reads 0V, your pull-up resistor is missing or your GPIO is mistakenly configured as a LOW output.
  4. Verify the Data Line Under Load (Power On, Code Running): Upload a standard DallasTemperature library example sketch. Keep your red probe on Pin 2 (DQ). You will likely see the voltage flicker on your meter display, dropping momentarily below 3V as the sensor pulls the line low to transmit data. This confirms the open-drain communication is physically occurring.
Oscilloscope Tip: If your multimeter reads 3.3V but your code still fails, the rise time of the bus might be too slow due to excessive capacitance from long wires. An oscilloscope will reveal if the square waves look like 'shark fins'. If they do, lower the pull-up resistor to 3.3kΩ or 2.2kΩ to source more current and charge the parasitic capacitance faster.

External Power vs. Parasitic Power Mode

The wiring diagram traced above assumes External Power Mode, which is the recommended configuration for 95% of hobbyist and industrial projects. However, the DS18B20 datasheet outlines a second configuration: Parasitic Power Mode. Understanding the difference prevents catastrophic bus failures when you modify a circuit.

Feature External Power Mode (Standard) Parasitic Power Mode
VDD Pin (Pin 3) Connection Connected to 3.3V or 5V rail Tied directly to GND
Power Source for Sensor Dedicated VDD pin Harvested from the DQ line via internal diode
Required Pull-Up Resistor 4.7kΩ (standard) 4.7kΩ, but MCU GPIO must be able to source strong high current during temp conversions
Maximum Temperature Range Full range (-55°C to +125°C) Limited; fails above 100°C due to insufficient harvested current
Wiring Complexity 3 wires (VCC, GND, DQ) 2 wires (GND, DQ)

In Parasitic Power Mode, the sensor powers its internal circuitry by charging an internal capacitor through the DQ line while the bus is idle. When a temperature conversion is initiated, the sensor requires a burst of current (up to 1.5mA) that it cannot pull from its tiny internal capacitor alone. The microcontroller's GPIO must actively drive the DQ line HIGH (push-pull mode, not just relying on the 4.7kΩ pull-up) for the 750ms duration of the conversion to supply this current.

Because most ESP32 and Arduino hobbyist setups have ample 3.3V/5V pins available, Parasitic Mode introduces unnecessary software complexity and limits your upper temperature threshold. Stick to the 3-wire External Power diagram traced in this guide unless you are building a remote probe where running a third physical wire is mechanically impossible.