A bare DS18B20-compatible digital temperature sensor in a three-lead TO-92 package. It sends readings over a single 1-Wire data line, so one pin on an Arduino, ESP32 or Raspberry Pi can read several sensors. Use it on a breadboard or PCB, or seal it into your own probe. It needs a 4.7k pull-up resistor on the data line.
Specifications
Datasheets
What's in the box
Bare sensor in an anti-static bag. The pull-up resistor and wiring are not included.
Great for
Wiring & getting started
- Find the pins
Hold the sensor with the flat face towards you and the leads pointing down. From left to right the pins are GND, DQ (data) and VDD.
- Power it from your board's logic voltage
Connect VDD to 5V on an Arduino Uno or Nano, or to 3.3V on an ESP32 or Raspberry Pi. Connect GND to GND. Swapping VDD and GND makes the sensor hot quickly, so check before powering up.
- Add the 4.7k pull-up
Fit a 4.7k resistor between DQ and VDD, then connect DQ to a digital pin, such as D2 on an Arduino or GPIO4 on an ESP32 or Pi. Our DS18B20 adapter module has the pull-up fitted and a screw terminal for the leads.
- Read it
Install the OneWire and DallasTemperature libraries in the Arduino IDE and open the Simple example. Allow the full conversion time, up to 750 ms at 12 bit, before each reading.
Note: This is a DS18B20-compatible sensor. It uses the same pinout, commands and libraries, but compatible parts can differ in accuracy and conversion timing. Use normal three-wire power rather than parasite power, and check it against a known thermometer if accuracy matters. For wet or outdoor use, see our DS18B20-compatible waterproof temperature probe.
