Pages: [1]   Go Down
Author Topic: Problem DS18b20 with very long cable.  (Read 1939 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?

(A beginner who just came http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html)

Many questions in a thread.

Thank you in advance.
Logged

Atlanta, GA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/forum/index.php/topic,51638.msg368432.html#msg368432
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has anyone tried solution with multiple inputs?

Can you define the bus several places in the program?
# define ONE_WIRE_BUS 3

Or will the line be replaced with a variable?

Thank you:)
Logged

CO, USA
Offline Offline
God Member
*****
Karma: 5
Posts: 711
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can not find any in the data sheet from the maxim about the maximum length of cable (bus)


Guidelines for Reliable Long Line 1-Wire® Networks
Logged

... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My English is not good: (
I need 2 or preferably 3 cables with sensors. (Are problems with my 2 X 20 meters)

Can this program be rewritten so  I can use 2 (or 3)  I/O lines ( ex PORT 3, PORT4 and PORT5 to independent buses ) ?
Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You CAN....

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....

http://sheepdogguides.com/dst9parasitic.htm

---
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.

(Much) more on 1-Wire at...

http://sheepdogguides.com/dst6a1.htm
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The solution I hope to do is that of the image.
But instead of relay using multiple Arduino pin.



From   http://www.maxim-ic.com/app-notes/index.mvp/id/148

Hope also again the program I use can be rewrite.
The program was taken from here

http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html
Logged

CO, USA
Offline Offline
God Member
*****
Karma: 5
Posts: 711
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Code:
#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.
Code:
sensorsA.begin();
sensorsB.begin();
sensorsC.begin();

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
Code:
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.
Logged

... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

nice, thanks  smiley
Logged

Pages: [1]   Go Up
Jump to: