DS18B20 Digital Temperature Sensor - 1-Wire Thermometer for Distributed Temperature Monitoring The DS18B20 is a programmable-resolution 1-Wire digital temperature sensor for thermostats, weather stations, industrial monitoring, device thermal protection, and distributed temperature networks. Each device has a unique 64-bit serial code, allowing multiple sensors to share one data bus. It pairs well with the ELAB Nano V3, Raspberry Pi Pico W, and breadboard prototypes using the MB 102 Breadboard Kit. For air temperature and humidity monitoring, compare it with the DHT22 AM2302 sensor. According to the Maxim/Analog Devices DS18B20 specification, the sensor supports 9-bit to 12-bit resolution, -55C to +125C measurement range, and +/-0.5C accuracy from -10C to +85C. See the official DS18B20 datasheet for final design limits. Technical Specifications Parameter Value SKU TB-DS18B20 Sensor IC DS18B20 Interface 1-Wire digital bus Temperature Range -55C to +125C Accuracy +/-0.5C from -10C to +85C Resolution User-selectable 9-bit to 12-bit Supply Range 3.0V-5.5V per DS18B20 datasheet Conversion Time Up to 750ms at 12-bit resolution Unique ID 64-bit ROM code per sensor Power Modes External supply or parasite power Board Layout & Label Guide DQ - 1-Wire data pin; use a pull-up resistor to VCC. VDD - External power input when not using parasite mode. GND - Ground reference. Pull-Up Resistor - Commonly 4.7k on the 1-Wire data line. Sensor Body - Place in the target thermal zone for accurate readings. Bus Wiring - Multiple DS18B20 sensors can share DQ if each ID is addressed. Cable Note - Long cables need careful grounding and pull-up selection. Thermal Note - Allow time for the package to reach ambient temperature. Application Scenarios 1. Arduino Temperature Readout Read DS18B20 temperature with OneWire and DallasTemperature libraries. #include #include OneWire oneWire(2); DallasTemperature sensors(&oneWire); void setup() { Serial.begin(115200); sensors.begin(); } void loop() { sensors.requestTemperatures(); Serial.println(sensors.getTempCByIndex(0)); delay(1000); } 2. Multiple Sensor Scan Print addresses for every DS18B20 on the bus. #include OneWire ds(2); byte addr[8]; void setup() { Serial.begin(115200); } void loop() { if (ds.search(addr)) { for (byte i = 0; i < 8; i++) Serial.print(addr[i], HEX); Serial.println(); } else { ds.reset_search(); delay(3000); } } 3. MicroPython 1-Wire Read Read a DS18B20 from a MicroPython board. import time import onewire, ds18x20 from machine import Pin bus = onewire.OneWire(Pin(15)) sensor = ds18x20.DS18X20(bus) roms = sensor.scan() while True: sensor.convert_temp() time.sleep_ms(750) for rom in roms: print(sensor.read_temp(rom)) time.sleep(1) Packing List 1 x DS18B20 Digital Temperature Sensor FAQ Q: What interface does DS18B20 use?A: It uses a 1-Wire digital bus. Q: Can multiple sensors share one pin?A: Yes, each DS18B20 has a unique 64-bit ROM code. Q: What pull-up resistor should I use?A: A 4.7k pull-up is common for short 1-Wire buses. Q: What is the temperature range?A: The datasheet range is -55C to +125C. Q: What is the best accuracy range?A: It is specified at +/-0.5C from -10C to +85C. Q: Can it run from 3.3V?A: Yes, the DS18B20 supply range is 3.0V to 5.5V. Q: What is parasite power?A: The sensor can draw power from the data line in supported circuits. Q: Why do I read 85C?A: 85C is a common power-up value when conversion timing or communication is incorrect.