I'd appreciate any thoughts on how to pin down a problem I'm having getting reliable readings from some of my DS18B20s. I'm running a number of these for home automation sensing purposes, for instance monitoring boiler and water flow temperatures, usually without any problem. However, I have a couple of sensors at around 5m distance that are giving me problems.
Here's the situation:
- Two Arduinos, one Mega (with Ethernet shield) and one Uno (no shield)
- Each reading between 3 (Mega) and 6 (Uno) sensors
- Datalines for Mega sensors on ports 6, 7 & 8
- One sensor per port
- Each sensor connected using dedicated CAT5e cable
- Maximum sensor distance from Arduino around 5m
- Sensors continually powered (ie, not parasitic) @ 5v, with the data line pulled up using 4k7 resistors using an external strip board
- Sensors being read every 10 seconds using standard OneWire.h library
I have had no problems with the reliability or accuracy of the sensors on the Uno. I have equally had no problems with one of the sensors on the Mega, which is at a distance of perhaps 3m. The problem comes with the two other sensors on the Mega, which are perhaps slightly further at around 5m. They behave as follows:
- On powerup, sensors read around 15 degrees C more than ambient
- Over the next 2-3 minutes, the sensor readings progressively reduce to ambient
- The sensors function correctly for the next 2-3 days, after which time they fail to read
I have tried increasing the temperature conversion delay from the 188mS recommended for 10 bit resolution to 300mS, but without any measurable effect.
Would appreciate any pointers of what to explore. Others have clearly managed reliable comms at several 10s of metres, so I can't believe the problem is distance alone. Could it be capacitance, or side effects from the use of the external board? Any thoughts appreciated