ES-13005|7Semi DS18B20 Waterproof Temperature Sensor Probe 6-inch 1M Wire
Introduction
The 7Semi DS18B20 Waterproof Temperature Sensor Probe 6-inch 1M Wire is a highly accurate and reliable sensor designed for temperature monitoring in various environments. It utilizes 1-Wire communication, allowing easy integration with microcontrollers and embedded systems. With its stainless steel waterproof probe, it is ideal for use in harsh conditions such as liquid temperature monitoring and industrial applications.
Features
-
Measures temperatures from -55°C to +125°C
-
Accuracy of ±0.5°C from -10°C to +85°C
-
Programmable Resolution: 9-bit to 12-bit
-
1-Wire Interface: Requires only one data pin
-
Stainless Steel Waterproof Probe for durability
-
Parasitic Power Mode is available
Technical Specification
The Technical Specification table provides detailed information about the 7Semi DS18B20 Waterproof Temperature Sensor Probe 6-inch 1M Wire, including its operating voltage, current consumption, and electrical characteristics. This data helps users understand the power requirements, communication parameters, and performance capabilities of the sensor. It ensures compatibility with different microcontrollers and embedded systems while providing guidelines for efficient integration into various applications.
-
Temperature Range: -55°C to +125°C
-
Accuracy: ±0.5°C from -10°C to +85°C
-
Resolution: 9-bit to 12-bit (Programmable)
-
Operating Voltage: 3.0V to 5.5V
-
Communication Protocol: 1-Wire
-
Probe Material: Stainless Steel
-
Probe Dimensions: 6mm diameter,152mm length
Pinouts
Hardware Interface
Connection Explanation:
-
Connect VDD to 3.3V or 5V
-
Connect GND to Ground.
-
Connect DQ to a digital I/O pin on a microcontroller.
-
Use a 4.7kΩ pull-up resistor between DQ and VDD.
Example Code
We provide example codes to help you get started with the 7Semi DS18B20 Waterproof Temperature Sensor Probe 6-inch 1M Wire. These examples demonstrate how to communicate with the sensor and retrieve CO₂, temperature, and humidity data using the I²C protocol. The code is available for two popular platforms: Arduino and ESP32.
Code Explanation
1. Including Necessary Libraries
#include #include
-
OneWire.h: Manages communication with 1-Wire devices.
-
DallasTemperature.h: Provides functions to interact with the DS18B20 sensor.
2. Defining the Data Pin
#define ONE_WIRE_BUS 2
-
Unordered List ItemSpecifies the digital pin where the DS18B20 sensor is connected.
3. Initializing OneWire and DallasTemperature Objects
OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire);
-
OneWire object (oneWire) initializes communication with the sensor.
-
DallasTemperature object (sensors) uses the oneWire object to access DS18B20.
4. Setup Function
void setup() { Serial.begin(9600); sensors.begin(); }
-
Serial.begin(9600): Initializes serial communication for debugging.
-
sensors.begin(): Initializes the DS18B20 sensor.
5. Requesting and Reading Temperature in Loop
void loop() { sensors.requestTemperatures(); float tempC = sensors.getTempCByIndex(0); Serial.print("Temperature: "); Serial.print(tempC); Serial.println(" °C"); delay(1000); }
-
sensors.requestTemperatures(): Sends a command to DS18B20 to measure temperature.
-
sensors.getTempCByIndex(0): Reads the temperature from the first sensor.
-
Serial.print(): Displays the temperature on the serial monitor.
-
delay(1000): Waits 1 second before the next reading.
6. Arduino Example Code
-
This example is designed for Arduino-compatible boards and demonstrates:
-
Initializing the 1-Wire communication with the DS18B20 sensor Board.
-
Reading temperature data from the sensor.
-
Printing the sensor data to the Serial Monitor.
7. ESP32 Example Code This example targets ESP32 boards and showcases:
-
Configuring the ESP32 1-Wire interface to communicate with the DS18B20 sensor Board.
-
Reading temperature data from the sensor.
-
Printing the sensor data to the Serial Monitor.
How to Access the Code
-
Download Link for Arduino and ESP32 Example Click here to download → 18b20.rar