Sorry to bump into an old thread, but i have a similar problem.
(moderator: split of from Problem with DS18B20 output: - Sensors - Arduino Forum )
I'm using OneWire and milesburton library to read from multiple ds18b20 sensors.
The problem is that on some of those sensors temperature slightly fluctuates between readings, eg. (raw format from milesburton library):
Sensor resolution is set to 11 bits. Sadly, my setup goes against any "best practice":
7 sensors in total
Star network topology (i could wire 3 sensors in a non start topology, but i cannot change wiring of 4 others)
Cable length varies from 50cm to 18 meters. Some if those cables run near power cables (220v), cannot change that.
1k pull up resistor (tried with 0.5 - 2k, does not seem to impact it)
Voltage seems to run at 5.22v - 5.25v
So what are my options to get more stable readings?:
- Do some kind of software based post-processing (eg.: read values 5 times, and take an average or median)?
- Rewire each sensor on separate pin to avoid star topology?