Description
Temperature Sensor - Waterproof DS18B20 - SparkFun SEN-11050
This sealed digital temperature probe lets you precisely measure temperatures in wet environments with a simple 1-Wire interface.
The DS18B20 provides 9 to 12-bit (configurable) temperature readings over a 1-Wire interface so that only one wire (and ground) needs to be connected from a central microprocessor.
The measurement range of the DS18B20 itself is -55°C to+125°C, however on this unit the cable is not high temp rated. So this part should only be used to measure temps where the cable can be kept below 85°C.
A waterproof high-temperature sensor version is available where the whole assembly can be used up to 125°C
DS18B20 Wiring Pin Out:
- RED: Vcc
- BLACK: Ground
- WHITE: Signal
DS18B20 Features:
- 3.0-5.5V input voltage
- Waterproof
- -55°C to+85°C temperature range
- ±0.5°C accuracy from -10°C to +85°C
- 1 Wire interface
DS18B20 Dimensions:
- Probe Diameter: 7mm
- Probe Length: 26mm
- Overall length (including wire): 1800mm (6')
DS18B20 Specifications:
- Supply voltage: 3.0 to 5.5 V
- Standby current: 1 μA
- Active current: 1.5 mA
- Measuring range: -55 °C to + 85°C (-67 °F to +185 °F)
- Accuracy (Thermometer Error):
- ±0.5 °C from -10 °C to +85 °C
- ±1 °C from -30 °C to +100 °C
- ±2 °C from -55 °C to +85 °C
- Resolution: 9-bit to 12-bit (programmable)
- Conversion time: < 750 ms (12-bit resolution)
- Communication protocol: 1-Wire® bus protocol
DS18B20+ Block Diagram:
Connecting DS18B20+ to Arduino:
You'll need to download the Arduino Librarys "OneWire" and "DallasTemp" which you can find below, and install them to your Arduino Libraries folder.
Connect your Arduino as per this diagram:
Notes:
- You don't need a Scottish Uno, and Uno will do!
- You only need one 4.7K resistor per circuit, no matter how many temperature sensors you add in a daisy chain formation
Example Arduino Code for DS18B20+:
[code lang="arduino"]
/* Example code for the DS18B20+ One-Wire Digital Temperature Sensor */
// Include Arduino libraries:
#include
#include
// Define the Arduino data pin connected to the 1-Wire bus:
#define ONE_WIRE_BUS 2
// Create a new instance of the oneWire class to communicate with any OneWire device:
OneWire oneWire(ONE_WIRE_BUS);
// Pass the oneWire reference to DallasTemperature library:
DallasTemperature sensors(oneWire);
void setup() {
// Begin serial communication at a baud rate of 9600:
Serial.begin(9600);
// Start up the library:
sensors.begin();
}
void loop() {
// Send the command for all devices on the bus to perform a temperature conversion:
sensors.requestTemperatures();
// Fetch the temperature in degrees Celsius for device index:
float tempC = sensors.getTempCByIndex(0); // the index 0 refers to the first device
float tempF = sensors.getTempFByIndex(0); // Fetch the temperature in degrees Fahrenheit for device index
Serial.print("Temperature: "); //Output to the serial monitor
Serial.print(tempC); // Print the temperature in Celsius
Serial.print(" \xC2\xB0");
Serial.print("C | ");
Serial.print(tempF);// Print the temperature in Fahrenheit
Serial.print(" \xC2\xB0");
Serial.println("F");
// Wait 1 second:
delay(1000);
}
[/code]
Documents:
- DS18B20 Datasheet
- OneWire (Arduino Library)
- DallasTemp (Arduino Library)
3 Reviews
-
Title of review 1069
works perfectly<br />the waterproofing makes it a bit slower to respond than the bare device<br />but it does keep the water out!
-
Title of review 1068
No problem getting this sensor up and running with a Raspberry Pi on the dining room table. The next step will be to get it installed in the beehive ! Hope the bees don't chew it to death.
-
Title of review 1067
The DS18B20 waterproof temperature sensor from Proto-Pic is easy to use and ready for testing with a breadboard. The ends of the wires are pre soldered for easy connection to a breadboard. The cable is extremely long which is suitable for any application