Can not find any in the data sheet from the maxim about the maximum length of cable (bus)
Trying to connect the multiple sensors on a bus, it runs fine up to 20 meters, but when the next 20 meters in length connected to stopping it. Have tested the two systems separately and it works fine ..
DS18b20 is connected to Vcc (not parasitic mode) gnd and DQ are connected to one twisted pair (cat5). (Found the solution somewhere)
The resistance of 4.7 k is placed at one end of the bus, but wonder if there will be a resistance for each sensor ?
Would it be okay to let the two buses connected to each port ?
Will there be a comprehensive omprogramering ?
Connect 3 DS18B20s to an Arduino by using three pins, and a ground connection.
You SHOULD... if not terribly difficult... use non-parasitic powering for the system....
However... if you don't mind working (much) harder on the software side, put 3 (or more) DS18B20s on a single pin of the Arduino. This means just 3 wires, instead of 5....
1-Wire data
Power
Ground
You then get into the 1-Wire techniques of chip addressing. The three devices remain "quiet" until you send a "tell me the temperature" command out on the 1-Wire data line... but you have to say WHICH chip you are sending that command to.
The simpler technique, using 5 wires....
Power
Ground
and a separate 1-Wire data wire to each chip
... works in a similar way, but as there is only one temperature sensor on each data wire, you can skip the addressing part.
You'll need to instantiate 3 separate instances of the one-wire object.
Untested, just duplicating lines inside my working 1-wire sketch, and adding alpha suffixes to the variable names.
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wires plugged into digital pins 2,3,4 on the Arduino
#define ONE_WIRE_BUSA 2
#define ONE_WIRE_BUSB 3
#define ONE_WIRE_BUSC 4
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWireA(ONE_WIRE_BUSA);
OneWire oneWireB(ONE_WIRE_BUSB);
OneWire oneWireC(ONE_WIRE_BUSC);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensorsA(&oneWireA);
DallasTemperature sensorsB(&oneWireB);
DallasTemperature sensorsC(&oneWireC);
Then you can read your sensors using the usual functions, e.g.
Of course, your code will be much neater if you define arrays for these. Hmmm. I'm not sure how the declaration would look for that. You'd want the equivalent of
int sensors[3];
Except int would be the DallasTemperature type, and I don't know about doing that without the one-wire reference. I'm an okay C programmer, C++ not so much.