Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino source code for KC868-AM]-02 DS18b20
#1
Code:
#include <DS18B20.h>

DS18B20 ds1(5); 
DS18B20 ds2(14); 
DS18B20 ds3(13);
DS18B20 ds4(33);
void setup() {
  Serial.begin(115200);
}
void loop() {
Serial.printf("T1:%.2fC||T2:%.2fC||T3:%.2fC||T4:%.2fC\n",ds1.getTempC(),ds2.getTempC(),ds3.getTempC(),ds4.getTempC());
      delay(500);
}


Attached Files
.zip   AM_DS18b20.zip (Size: 491 bytes / Downloads: 146)
Reply
#2
Hi,

for the DS18B20, what is the max cable length this should work with?

Also. OneWire should support multiple devices on the same bus. I tried 2, which worked fine on the same GPIO. Then 3 and it stopped working and it seems the sensor(s) is/are dead.
Reply
#3
it according to wire quality. i have tested with 10pcs DS18B20 work together, also work well,
[Image: attachment.php?aid=1392]
details see here:
https://www.kincony.com/forum/showthread.php?tid=2290
Reply
#4
Wow, ok. Thanks.

Hmm, not sure why it failed then.

And the max cable length?
Reply
#5
i have tested with one sensor, MAX about 30 meter.
here is test video: 
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)