Hello,
I trying to connect 20 DS18B20 temperature sensors together (for a soil monitoring project). The sensors are the 3m cabled, waterproof versions of the DS18B20. I've connected all of them in parallel and am using an external source of power supply to power them (rather than powering them through the 5V pin on my Arduino Uno). The total cable weight/length is around 60.5m (20 x 3m + 0.5m for parallel wiring) and cable radius is 3.2m.
I've checked all of the sensors individually (and they all work fine) and hard-coded their addresses into the code to avoid having to search for their addresses every time I run the code.
Here's my issue. Let's say that sensor #1 is the one closest to the Arduino in the parallel circuit and sensor #20 is the farthest. When I only connect sensor #1 and read it, it works fine. But as soon as I connect the other 19 sensors, the reading immediately display -127C (ie. does not read).
So my question is, how do I make connect and read from 20 sensors?
** EDIT (SOLUTION) **
Thank you all for your amazing ideas and suggestions. After toying around with all the ideas, two of them worked for me.
- Splitting the sensors on more than one Arduino Pin: this works although it means that more cabling is required and the code becomes increasingly messy as more sensors are added.
- Decreasing the pull-up resistor value: this worked like a charm! I don't have the knowledge to do exact calculations but found that a 1k ohm resistor worked for 20 sensors on a single serial bus line.
I'm sure that the first solution has many added benefits to it but for the sake of simplicity, I went with the second option.