dragino / LoRa_STM32

Source code for Dragino LoRa module base on STM32 Chip
76 stars 76 forks source link

DS18B20 1-Wire with longer cable is not working #18

Open themuck opened 2 years ago

themuck commented 2 years ago

Hey, i try to use the dragino lsn50 with a DS18B20 and a ~10m J-Y(ST)Y cable. But it looks like there are timing issues in the software with a higher cable capacity? So with the cable extension the lsn50 do not detect the DS18B20... but 1-wire can go ub to 100m

https://www.maximintegrated.com/en/design/technical-documents/tutorials/1/148.html https://www.maximintegrated.com/en/design/technical-documents/app-notes/1/126.html

DominusFulguris commented 2 years ago
  1. Is the DS18B20 being powered from the 5V boost circuit? If not, this may address the issue.2. You may be able to compensate for the longer cable by lowering the value of the pullup resistance on the data line. Try adding another 4.7kOhm in parallel. I.e. connect between power and data lines. -------- Original message --------From: themuck @.> Date: 28/10/21 6:17 am (GMT+10:00) To: dragino/LoRa_STM32 @.> Cc: Subscribed @.***> Subject: [dragino/LoRa_STM32] DS18B20 1-Wire with longer cable is not working (Issue #18) Hey, i try to use the dragino lsn50 with a DS18B20 and a ~10m J-Y(ST)Y cable. But it looks like there are timing issues in the software with a higher cable capacity? https://www.maximintegrated.com/en/design/technical-documents/app-notes/1/126.html

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

themuck commented 2 years ago

Hey, sure i tested the stuff with some parallel resistors. and it works only with 1k parallel -> ~830ohm. And i use 3.3V Power.

But i have no issues with an ESP32 Device and #include , #include libs with 4.7k and 3.3V. So when the timing and programming is right it works! And with longer cable and more than one sensor!

Go down to 830ohm is in my opinion to low, in case of the 4mA drive current. And with another piece of software it works. We talk about 10m with one sensor! Not 100m or more ;), so i think there is something wrong in the 1-Wire implementation. Or it can be much better!