Overview of DS18B20
This is a 1 Meter Waterproof, sealed, and pre-wired digital temperature sensor probe based on the DS18B20 sensor. Designed for precision and durability, it is ideal for applications requiring temperature measurements in challenging environments, such as liquids or outdoor conditions. Thanks to its digital communication, the sensor ensures no signal degradation even over long distances.
Key Features
- Waterproof Design: Encased in a stainless steel tube for reliable operation in wet or submerged environments.
- High Accuracy: Offers ±0.5°C accuracy over much of its range.
- Digital Output: Immune to analog signal degradation, ensuring high precision.
- Compact and Pre-wired: Comes pre-wired for easy integration into projects.
- Unique Serial ID: Each sensor has a unique 64-bit serial number for use with multiple sensors on the same data line.
Specifications
Parameter | Value |
---|---|
Sensor Type | DS18B20 |
Accuracy | ±0.5°C |
Output | Digital (1-Wire) |
Operating Voltage | 3.0 – 5.0V |
Cable Length | 1 Meter |
Encasing Material | Stainless Steel |
Applications
- Liquid temperature monitoring
- Environmental sensing
- Weather stations
- Industrial temperature measurements
- IoT and smart systems
Wiring Instructions
- Red Wire: Connect to VCC (3.3V or 5V)
- Black Wire: Connect to GND
- Yellow/White Wire: Connect to the microcontroller’s data pin (requires a 4.7kΩ pull-up resistor between DATA and VCC for stability)
Getting Started
Materials Needed
- DS18B20 Waterproof Temperature Sensor
- Microcontroller (e.g., Arduino, Raspberry Pi, ESP32)
- 4.7kΩ resistor (optional, for multiple sensors on a single line)
Setup Guide
- Connect the Wires:
- Red to VCC, Black to GND, Yellow/White to the data pin of the microcontroller.
- Install Libraries (Arduino):
- Install the “OneWire” and “DallasTemperature” libraries via the Arduino Library Manager.
- Load Sample Code: Use the sample code provided below to read temperature data.
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 // Digital pin connected to the DS18B20
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
Serial.begin(9600);
sensors.begin();
}
void loop() {
sensors.requestTemperatures();
float temperatureC = sensors.getTempCByIndex(0);
float temperatureF = sensors.getTempFByIndex(0);
Serial.print("Temperature Celsius: ");
Serial.print(temperatureC);
Serial.print("°C | Temperature Fahrenheit: ");
Serial.println(temperatureF);
delay(1000);
}
- Upload and Test: Upload the code to your microcontroller and view the temperature readings in the Arduino Serial Monitor.
Benefits of DS18B20 Sensor
- Durability: Waterproof and robust design for long-term use.
- Precision: Reliable and accurate temperature readings.
- Ease of Use: Simple wiring and coding for seamless integration.
Additional Products
Looking for a powerful microcontroller for your project? Check out the ESP32 Dev Kit V1, available on our website.