Go Down

Topic: resistor for multiple DS18B20 sensors (Read 267 times) previous topic - next topic

phytopia

Hi,

I have 4 DS18B20 sensors with different cable lenghts of 1m, 2m, 12m and 13m. They are all connected together via I2C. I am using a 4,7kOhm resistor and the values I get seem realistic.

Do I need a smaller resistor because of the total cable length? I also need to add one more sensor with 3m cable length. Or isn't there a problem as long as I get realistic values?

skywatch

You should be fine with good cable and connections.

Put the resistor at the farthest end away from the arduino.


phytopia

You should be fine with good cable and connections.

Put the resistor at the farthest end away from the arduino.


Cable is CAT5.

Not sure what you mean by farthest end away from arduino. I have all sensors come together in one luster terminal on one side. On the other side of the luster terminal I have three jumper wires coming out for 5V, GND and DATA. The jumper wires for 5V and DATA are connected via the resistor inside the luster terminal.

Is that the correct way of wiring?

pylon

Quote
ut the resistor at the farthest end away from the arduino.
This is wrong. Put the resistor to the Arduino side.

Quote
Is that the correct way of wiring?
Yes.

Quote
They are all connected together via I2C
This is wrong. DS18B20 connect by OneWire not I2C.

Quote
Do I need a smaller resistor because of the total cable length?
No.

If you get problems with increasing bus length you may try to switch off parasite mode. As you're using Cat5 cable you have more than enough wires to have a separate Vcc signal.

phytopia

If you get problems with increasing bus length you may try to switch off parasite mode. As you're using Cat5 cable you have more than enough wires to have a separate Vcc signal.
I have 3 wires going in to the arduino from the DS18B20 sensors, so it's already not in parasite mode, is it??

MarkT

#5
Nov 13, 2018, 02:33 pm Last Edit: Nov 13, 2018, 02:34 pm by MarkT
Hi,

I have 4 DS18B20 sensors with different cable lenghts of 1m, 2m, 12m and 13m. They are all connected together via I2C. I am using a 4,7kOhm resistor and the values I get seem realistic.

Do I need a smaller resistor because of the total cable length? I also need to add one more sensor with 3m cable length. Or isn't there a problem as long as I get realistic values?
Nothing to do with I2C, you are confusing it with OneWire.

How have you used the signal pairs in the CAT5?

Do you have decoupling capacitors on each sensor (this is advisable)
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

phytopia

How have you used the signal pairs in the CAT5?

Do you have decoupling capacitors on each sensor (this is advisable)
One twisted pait for DATA and GND and one for 5V and GND.

No, i don't have decoupling capacitors on any sensor. I need them to be under water, not sure if this is possible...

Nick_Pyner

It is possible and you can get pre-wired waterproof sensors with 15m of kosher cable. No decoupling capacitors included, but I have never heard of them being used and I think it is nonsense. Since you claim to have realistic values already, you are using one-wire bus or, specifically not I2C, and the only problem is that you might not know the difference - which is not relevant at this stage.

phytopia

I now connected five DS18B20 sensors together via OneWire and it doesn't work. But it works with four sensors. With five sensors, either the one sensor with the longest cable or the four other sensors are working, but never all five.

My Interpretation is, the resistor is too big for all five sensors.
So, I would buy a 3.3kOhm instead of the 4.7kOhm resistor to make it work. Does that make sense??

pylon

Quote
So, I would buy a 3.3kOhm instead of the 4.7kOhm resistor to make it work. Does that make sense??
I would put the sensor with the long cable to a separate pin, so establishing a separate OneWire bus.

Using a smaller resistor is outside the specs so it may or may not work but you also risk to damage the sensors (although that needs a lot more in my experience).

phytopia

I just put in an additional 10kOhm resistor, which totals 3,2kOhm and now all five work.

MarkT

Cable is CAT5.

Not sure what you mean by farthest end away from arduino.
A cable has two ends, one is at the sensor, one is at the Arduino...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up