Op werkdagen vóór 14:00 uur besteld = dezelfde dag verzonden en in 98% van de gevallen de volgende dag in huis. Gratis retourneren 30 dagen bedenktijd 1 jaar garantie
← Tillbaka till översikten

Vid uppspelning laddas videon från YouTube.

Kopplingsschema och kodexempel

Så här kopplar du DS18B20 vattentät probtemperatursensor 1m kabel till en Arduino UNO eller ESP32, med ett exempel­sketch som du kan ladda upp direkt.

DS18B20 Waterproof Temperature Sensor Demo

This project reads temperature data from the waterproof DS18B20 probe and prints the values in Celsius to the Serial Monitor every second. Connect the sensor directly to the Arduino Uno and open the Serial Monitor at 115200 baud to view real-time temperature measurements.

Kopplingsschema: DS18B20 vattentät probtemperatursensor 1m kabel på en Arduino UNO
Kopplingsschema · Klicka för att förstora
Kopplingstabell: DS18B20 vattentät probtemperatursensor 1m kabel på en Arduino UNO
Kopplingstabell · Klicka för att förstora
DS18B20_Waterproof_Temperature_Sensor_De.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : DS18B20 Waterproof Temperature Sensor Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : DS18B20 waterdichte probe temperatuursensor 1 m cable
 *  Libraries : OneWire 2.3.8, DallasTemperature 4.0.6
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

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

const int ONE_WIRE_BUS = 2;

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

void setup() {
  Serial.begin(115200);
  sensors.begin();
  Serial.println(F("DS18B20 Temperature Sensor Initialized"));
}

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

  if (tempC == DEVICE_DISCONNECTED_C) {
    Serial.println(F("Error: Could not read temperature data"));
  } else {
    Serial.print(F("Temperature: "));
    Serial.print(tempC);
    Serial.println(F(" °C"));
  }

  delay(1000);
}

Nödvändiga bibliotek: OneWire 2.3.8, DallasTemperature 4.0.6

Wiring diagram and example code generated by Codey.online — https://www.codey.online

ESP32 DS18B20 Waterproof Temperature Sensor

This project reads temperature data from a waterproof DS18B20 probe and prints the readings in Celsius and Fahrenheit to the Serial Monitor. A 4.7kΩ pull-up resistor is placed between the 3.3V power line and the 1-Wire data line for reliable communication. Open the Serial Monitor at 115200 baud to observe the live temperature measurements.

Kopplingsschema: DS18B20 vattentät probtemperatursensor 1m kabel på en ESP32 DevKit V1
Kopplingsschema · Klicka för att förstora
Kopplingstabell: DS18B20 vattentät probtemperatursensor 1m kabel på en ESP32 DevKit V1
Kopplingstabell · Klicka för att förstora
ESP32_DS18B20_Waterproof_Temperature_Sen.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : ESP32 DS18B20 Waterproof Temperature Sensor
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : DS18B20 waterdichte probe temperatuursensor 1 m cable
 *  Libraries : OneWire 2.3.8, DallasTemperature 4.0.6
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

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

const int ONE_WIRE_BUS = 4;

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

void setup() {
  Serial.begin(115200);
  sensors.begin();
  Serial.println("DS18B20 Temperature Sensor Demo");
}

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

  if (tempC == DEVICE_DISCONNECTED_C) {
    Serial.println("Error: Could not read temperature data");
  } else {
    float tempF = sensors.getTempFByIndex(0);
    Serial.print("Temperature: ");
    Serial.print(tempC);
    Serial.print(" °C | ");
    Serial.print(tempF);
    Serial.println(" °F");
  }

  delay(1000);
}

Nödvändiga bibliotek: OneWire 2.3.8, DallasTemperature 4.0.6

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Tidigare visade

9V batteriklämma anslutning

9V batteriklämma anslutning

€ 0,85
5V Högeffektsrelä 250V 30A

5V Högeffektsrelä 250V 30A

€ 6,50
Labaggregat 0-15V DC / 0-2A Analog

Labaggregat 0-15V DC / 0-2A Analog

€ 79,00
Visa