Author Topic: Multiple DS18B20 returning ZERO  (Read 2620 times)

0 Members and 1 Guest are viewing this topic.

Offline PSR B1257Topic starter

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: de
Multiple DS18B20 returning ZERO
« on: December 24, 2017, 07:49:38 pm »
Hy guys,

my new Arduino-Clone is driving me nuts...
I have been successfully running a temperature-logger with four DS18B20 sensors on a "Sainsmart UNO". Until some idiot  :palm: shortet the supply rail of the board... :-BROKE
So I went ahead and got me a nother Arduino-Clone with a logging-shield (https://www.ebay.de/itm/Arduino-Uno-R3-mit-XD-204-Data-logging-shield/281460446703?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2648), but lo and behold, the same code is no longer working  :--
With all four sensors connected, each sensor is replying 0.00. If I connect only one random sensor, everything is fine again. I get three errors and one correct temperatur-reading.

Any ideas are welcome.

P.S.: Merry Christmas  :)
In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline 2N3055

  • Super Contributor
  • ***
  • Posts: 8854
  • Country: hr
Re: Multiple DS18B20 returning ZERO
« Reply #1 on: December 24, 2017, 10:39:52 pm »
Do you run 5V? Do you connect sensor with +VCC (3 wires ) or parasitically (2 wires)? What pull-up resistor do you use?
Do you have access to scope to see waveforms?

P.S. Thanks, Merry Christmas to you too!!
"Just hard work is not enough - it must be applied sensibly."
Dr. Richard W. Hamming
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9103
  • Country: ca
Re: Multiple DS18B20 returning ZERO
« Reply #2 on: December 24, 2017, 11:35:52 pm »
Maybe your new shield is fighting with the temperature sensors.
The DS18B20's should be on a separate I/O pins - not shared with the SD card or RTC data lines?

Merry Christmas! We got snow and -23C tonight, so a chilly white Christmas.
 

Offline PSR B1257Topic starter

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: de
Re: Multiple DS18B20 returning ZERO
« Reply #3 on: December 26, 2017, 09:58:21 am »
The 5V supply and such is fine.

Just for curiosity, I've added a 12k resistor in parallel to the existing 4k7 resistor (3-wire connected sensor) which causes the whole mess to work again  :-+

At least for now. A endurance test is running....
In theory, there is no difference between theory and practice. But, in practice, there is.
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2535
  • Country: gb
Re: Multiple DS18B20 returning ZERO
« Reply #4 on: December 26, 2017, 07:56:22 pm »
read the one-wire comms datasheets.
the way you adress multiple devices without a clash is different to talking to a single one.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9103
  • Country: ca
Re: Multiple DS18B20 returning ZERO
« Reply #5 on: December 26, 2017, 10:52:18 pm »
Watch long cable runs to the DS18B20's will need a lower (4k7 to 1k) pullup resistor and a 0.1uF decoupling cap across VDD and GND local at each temperature sensor for really good data.
 

Offline PSR B1257Topic starter

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: de
Re: Multiple DS18B20 returning ZERO
« Reply #6 on: December 29, 2017, 07:58:31 pm »
Quote
the way you adress multiple devices without a clash is different to talking to a single one.
Yes, but this is not the problem, since I had a already working program on the destroyed Arduino.

Quote
Watch long cable runs to the DS18B20's will need a lower (4k7 to 1k) pullup resistor and a 0.1uF decoupling cap
As examined by my little experiment with the 12k resistor in parallel.
A decoupling cap at the sensor however seems like a good idea, to prevent any unexpected issues.

My endurance test went successfully so far. None of the sensors is replying "0.00" or even the error code "-127" since it was started.
In theory, there is no difference between theory and practice. But, in practice, there is.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->