Hi everyone,
I recently picked up a DS18B20 temperature measurement module to log temperatures in a small Arduino project. The idea is to measure ambient temperature in different rooms and eventually expand it to multiple sensors on the same 1-Wire bus.
Setup Details:
Arduino Uno
DS18B20 module (3-pin version with onboard pull-up resistor)
Connected to 5V, GND, and digital pin 2 for data
Using the OneWire and DallasTemperature libraries
Simple sketch to read temperature every second and print to Serial
Now here are my issues:
The sensor sometimes returns -127°C or 85°C, which I know are error codes
Readings fluctuate by 1–2°C even in a stable room environment
When I connect a second DS18B20 module, only one of them reports consistently, the other drops out randomly
Occasionally, the Arduino freezes when reading multiple sensors
What I’ve tried so far:
Verified wiring and ensured common ground
Added a 4.7k pull-up resistor externally, even though the module claims to have one onboard
Tried both 5V and 3.3V supply
Adjusted delay between conversions (750ms vs 1000ms)
Tested with both parasitic power and normal VDD mode
My questions:
Is it normal for DS18B20 modules to need an external pull-up resistor even if one is included on the board?
How do you usually stabilize the readings so they don’t jump around by a degree or two?
For multiple sensors on one bus, is there a best practice for wiring length and layout to avoid dropouts?
Is there a recommended sampling rate for stable results (every second vs every few seconds)?
Thanks in advance for any advice, hoping to make this stable before I scale up to more sensors.