The DS18B20 waterproof digital temperature sensor is a reliable and accurate probe designed for use with ESP32, ESP8266, Arduino and other microcontroller platforms. Housed in a stainless steel waterproof probe, it is ideal for temperature monitoring in wet, outdoor and demanding environments.
The sensor uses a 1-Wire interface, allowing multiple sensors to be connected to a single data pin, making it perfect for scalable monitoring projects.
DS18B20 Sensor Microcontroller
-------------------------------------
Red (VCC) ─────────► 3.3V / 5V
Black (GND)─────────► GND
Yellow (DATA)──────► GPIO Pin
|
4.7kΩ
|
VCC
Notes:
• 4.7kΩ pull-up resistor required on DATA line
• ESP32 / ESP8266 use 3.3 V logic
• Multiple sensors can share one GPIO pin
esphome:
name: ds18b20_sensor
platform: ESP32
board: esp32dev
wifi:
ssid: "YOUR_SSID"
password: "YOUR_PASSWORD"
logger:
api:
ota:
one_wire:
- platform: gpio
pin: 4
sensor:
- platform: dallas
address: 0x0000000000000001
name: "Temperature Sensor"
Note: Sensor address will differ – ESPHome will auto-detect it on first boot.
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 4
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
Serial.begin(115200);
sensors.begin();
}
void loop() {
sensors.requestTemperatures();
Serial.print("Temperature: ");
Serial.print(sensors.getTempCByIndex(0));
Serial.println(" °C");
delay(1000);
}
Note: Requires OneWire and DallasTemperature libraries.
Order now — a dependable and accurate temperature sensor for ESP32, ESP8266, Arduino and smart monitoring projects.