DS18B20 Dallas Temperature Sensor

DS18B20 Dallas Temperature Sensor image

View on Amazon

Overview

The DS18B20 is a digital temperature sensor widely used in microcontroller-based applications. It communicates via the 1-Wire protocol, requiring only one data line (and ground) for communication. This sensor is known for its high accuracy, durability, and versatility, making it ideal for temperature measurement projects.

About DS18B20 Dallas Temperature Sensor

The DS18B20 is a high-accuracy digital temperature sensor that communicates using a 1-Wire protocol, requiring only a single data line for operation. It is widely used in industrial, weather monitoring, and IoT applications due to its broad temperature range and configurable resolution.

Key Features

  • High Accuracy – ±0.5°C in the -10°C to +85°C range.
  • Wide Operating Range – Measures from -55°C to +125°C.
  • 1-Wire Communication – Requires only one data line + ground, simplifying wiring.
  • Configurable Resolution9-bit to 12-bit selectable resolution.
  • Flexible Power Options – Supports normal & parasite power modes.
  • Compact & Easy to Integrate – Available in a TO-92 package for easy mounting.

🔗 Learn more about the DS18B20 sensor.

Where to Buy

Get Your DS18B20

DS18B20 Dallas Temperature Sensor

Starting from

$2 per unit

Amazon com
Amazon.com Ships worldwide
Amazon de
Amazon.de Ships to EU
Aliexpress
AliExpress Best value option

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specs

DS18B20 Specifications

Complete technical specification details for DS18B20 Dallas Temperature Sensor

📊 Technical Parameters

Interface 1-Wire
Accuracy ±0.5°C (from -10°C to +85°C)
Operating Range -55°C to +125°C
Voltage 3.0V to 5.5V (typical 3.3V)
Resolution 9-bit to 12-bit (user-configurable)
Conversion Time 93.75ms (12-bit resolution)
Communication Speed Up to 16.3 kbps
Power Modes Normal and Parasite Power Modes
Power Consumption 1mA active, <1µA idle
Package Type TO-92 (commonly used), also available in other packages
Unique Identifier 64-bit unique ROM code for multi-device systems
Pin Configuration

DS18B20 Pinout

The DS18B20 pinout includes three pins: GND (ground), DQ (1-Wire data line), and VDD (power supply). The sensor can operate in normal mode or parasite power mode.

Visual Pinout Diagram

Pinout Diagram Primary
DS18B20 Dallas Temperature Sensor pinout
3
Total Pins

Pin Types

Power
1

Quick Tips

Temperature

range: -55°C to +125°C,Accuracy: ±0.5°C from -10°C to +85°C,Configurable resolution: 9-bit to 12-bit (0.5°C to 0.0625°C)

Unique

64-bit address allows multiple sensors on one bus,Conversion time: 750ms at 12-bit resolution

Available

in TO-92, SO-8, and waterproof probe packages,Parasite power mode requires only 2 wires (DQ + GND)

Pin Descriptions

Pin NameTypeDescriptionNotes
1 Pin 1 (GND)
Ground

Ground connection

Connect to circuit ground

2 Pin 2 (DQ)
1-Wire Data

1-Wire data line and optional parasite power

Requires 4.7kΩ pull-up resistor to VDD

3 Pin 3 (VDD)
Power

Power supply (3.0V to 5.5V)

In parasite mode, connect to GND

Connection Guide

Wiring DS18B20 to ESP32

Connect the DS18B20 to your ESP32 via the 1-Wire protocol. A 4.7kΩ pull-up resistor is required between the DQ data line and VDD (3.3V or 5V). Multiple DS18B20 sensors can share the same data line.

Visual Wiring Diagram

Wiring Diagram Recommended
DS18B20 Dallas Temperature Sensor wiring with ESP32
3
Connections

Connection Status

Required
3

Protocol

1-Wire

Pin Connections

DS18B20 PinConnectionESP32 PinDescription
1 Pin 1 (GND) Required
GND

Ground connection

2 Pin 2 (DQ) Required
GPIO4

1-Wire data line (with 4.7kΩ pull-up)

3 Pin 3 (VDD) Required
3.3V

Power supply (or GND for parasite mode)

CRITICAL:

Add a 4.7kΩ pull-up resistor between DQ and VDD

Can

use 3.3V or 5V power supply (ESP32 is 3.3V)

Multiple

DS18B20 sensors can share the same DQ line

Each

sensor has a unique 64-bit ROM address

For

parasite power mode: connect VDD to GND, pull-up to 3.3V/5V

Waterproof

probe versions available for liquid temperature measurement

Recommended

wire length: up to 100 meters with proper cabling

Use

DallasTemperature library for Arduino/ESP32

Help & Support

DS18B20 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

DS18B20 Programming Examples

Ready-to-use code examples for different platforms and frameworks

Summary

Wrapping Up DS18B20

The ESP32 DS18B20 Dallas Temperature Sensor is a powerful environment sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

Best Practices

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Safety First

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.

Ready to Start Building?

Now that you have all the information you need, it's time to integrate the DS18B20 into your ESP32 project and bring your ideas to life!

Similar Options

Explore Alternative Sensors

Looking for alternatives to the DS18B20? Check out these similar sensors that might fit your project needs.

SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor

SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor

ENVIRONMENT I2C

The SHT21, HTU21, GY-21, and SI7021 sensors utilize I2C for reliable communication and provide calibrated, linearized temperature and...

View Details
BME680 Environmental Sensor

BME680 Environmental Sensor

ENVIRONMENT I2C,SPI

The BME680 is a versatile environmental sensor capable of measuring air quality (VOCs), temperature, humidity, and pressure. It supports I2C...

View Details
SHT31 / SHT31-D / GY-SHT31 / SI7021 Temperature and Humidity Sensor

SHT31 / SHT31-D / GY-SHT31 / SI7021 Temperature and Humidity Sensor

ENVIRONMENT I2C

The SHT31 series sensors utilize Sensirion's CMOSens® technology to deliver accurate, stable, and linear temperature and humidity data....

View Details