4 pcs. DS18BS20 in long wire has noise

Status
Not open for further replies.

C. Emre ÖZ

Newbie level 6
Joined
Mar 1, 2015
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Turkey, Ankara
Visit site
Activity points
78
I use four ds18b20 in one port and 1. sensor on 9 meters cable, 2. sensor on 11 meters cable, 3. sensor on 13 meters cable, 4. sensor on 15 meters cable . First one hour i didn't face off any problem but one hour later i saw some wrong data and later my mcu was broken. My pull up resistor is 470 ohm and i dont use any optocoupler. i connect direct to mcu port. what is your guess about my problem.

Thank you
 

Those are long distances for 1-Wire interfaces, depending on the cable type you used you might have problems with propagation of the shorter pulse widths. That should not damage your MCU though so I suspect you have a connection or leakage from one of the wires to something else. Are the sensors each on their own cable or is it one 15m cable with four sensors along it's length? How are they connected to the MCU, a different cable to each pin or all cables in parallel to one pin?

Brian.
 

All sensors are connect to one pin but each sensor has different cable size (9,11,13,15). first one hour every thing is perfect i sensed 55 degrees each sensor fix but after one sensor of them sens 55,0,55,0,0,56,0,0,0,0 and block mcu. When restart the device it reset when communicate with ds18b20 and broken mcu. I use local supply 3 wire
 

Then you have several problems:

1. the pull up resistor should be around 4700 Ohms not 470 Ohms, it should still work and the devices are relatively tolerant of overcurrent but you are asking them (and your MCU) to pull the lies low with ~10mA. The manufacturer recommends not more than 4mA. You risk internal heat generation which will make your temperature readings drift upwards.

2. 1-Wire protocol requires fairly accurate timing and your combined cable capacitance (48 metres of it) is almost certainly too great for the short duration pulses to maintain enough shape to be recognized. The capacitance is of each cable in parallel and appears across all the sensors. It will not only reduce the pulse amplitude, it will increase the sink current as the MCU pulls the data line low.

3. You are at great risk of picking up noise and interference along that length of cable. It may also be prone to capacitive coupling of other signals which could exceed the limits the MCU can withstand.

1-Wire interface is intended for short connections. You might be able to make your system work if you use a low capacitance screened cable for the ground/data and a third wire for the power but you would have to be very careful how you filtered the VDD voltage at the sensor end so the supply impedance was kept low.

Where I have to use those sensors I convert the 1-Wire signal to a differential serial signal with a simple circuit at the sensor end. That keeps the time critical 1-Wire signals within a few mm of the DS18B20 and allows much longer cable (sometimes > 200m) to be used to carry the data back to the MCU. Following my method might cause you problems with selecting one sensor at a time though.

Brian.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…