Last updated
The DS18B20 is a digital temperature sensor that provides highly accurate temperature readings over a wide range. It communicates via the 1-Wire protocol, allowing multiple sensors to be connected on the same data line, which simplifies wiring and reduces the number of I/O pins needed on the microcontroller. The sensor is commonly used in environmental monitoring, HVAC systems, and various industrial applications due to its precision and ease of use.
High Accuracy: Accurate temperature measurements with a precision of ±0.5°C over a wide range.
Wide Temperature Range: Measures temperatures from -55°C to +125°C.
1-Wire Interface: Allows multiple sensors to be connected on a single bus.
Programmable Resolution: User-selectable resolution from 9 to 12 bits.
Unique 64-bit Serial Code: Each sensor has a unique code, enabling multiple sensors to be identified on the same bus.
Low Power Consumption: Suitable for battery-powered applications.
Parasitic Power Mode: Can operate without an external power supply by drawing power from the data line.
Operating Voltage: 3.0V to 5.5V
Temperature Range: -55°C to +125°C
Accuracy: ±0.5°C (from -10°C to +85°C)
Resolution: 9 to 12 bits (programmable)
Interface: 1-Wire protocol
Conversion Time: 93.75ms (9-bit) to 750ms (12-bit)
Unique Serial Code: 64-bit
VDD: Power supply pin (3.0V to 5.5V) - optional if using parasitic power mode
GND: Ground pin
DQ: Data line (1-Wire interface)
TO-92 Package Size: 4.9mm x 4.0mm x 5.9mm
Power the Sensor: Connect the VDD pin to a power supply (3.0V to 5.5V) and the GND pin to ground. If using parasitic power mode, connect a 4.7kΩ pull-up resistor between the DQ pin and the power supply.
Connect the Data Line: Connect the DQ pin to a digital I/O pin on your microcontroller.
Initialize the Sensor: Use a suitable library to initialize and communicate with the sensor. The following example demonstrates how to use the DS18B20 sensor with an Arduino.