Codey OnlineArduino & ESP32 component library › DS18B20 waterdichte probe temperatuursensor 1 m cable
DS18B20 waterdichte probe temperatuursensor 1 m cable
Sensors

DS18B20 waterdichte probe temperatuursensor 1 m cable

The DS18B20 is a digital temperature sensor in a waterproof probe housing with a 1 m cable. It communicates over the 1-Wire interface and is commonly used for measuring liquids, outdoor air, or other environments where the sensor needs protection from moisture.

Width: 22.1 mm

Pinout — DS18B20 waterdichte probe temperatuursensor 1 m cable

Pin Signal Description
VDD power Positive supply for the DS18B20 probe, typically 3.0–5.5 V.
DQ data 1-Wire digital data line; requires a pull-up resistor to VDD.
GND ground Ground return for the DS18B20 temperature probe.

Example wiring diagram — DS18B20 waterdichte probe temperatuursensor 1 m cable

From To Wire
board:5V x1:VDD red
board:GND x1:GND black
board:D2 x1:DQ green

Example Arduino code — DS18B20 waterdichte probe temperatuursensor 1 m cable

This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.

#include <OneWire.h>
#include <DallasTemperature.h>

const uint8_t ONE_WIRE_BUS = 2;

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  sensors.begin();
  Serial.println("DS18B20 temperature sensor example");
}

void loop() {
  sensors.requestTemperatures();
  float temperatureC = sensors.getTempCByIndex(0);

  if (temperatureC == DEVICE_DISCONNECTED_C) {
    Serial.println("Sensor not found or disconnected");
  } else {
    Serial.print("Temperature: ");
    Serial.print(temperatureC);
    Serial.println(" C");
  }

  delay(1000);
}

Related components

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Build your Arduino or ESP32 project with AI

Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.

Start for free