I have an issue with Dallas 18b20: randomly I loose connection (serial number of sensors disappear). I have two sensors that have been connected to Raspberry, with 4k7 resistor. I didn’t have problems till two month ago. Now I loose the sensors, most of times at same hour (19:00 but nothing happens that could be a cause). I tried: change both the Dallas with Maxim original, change power supply to Raspberry with 3A, verify cable (cat 5e) that has no shorts, change connectors and resistor. When I get the connection lost I check with multimeter that I have roughly 1.1 volt between GND and Vin (GPIO 7), instead of 3.3 v; and 2.2 volt between Vin and Vcc (3.3 volt) instead of 0 volt. The cable for Dallas is roughly 5m. Now I’m trying with last chance and I changed the Raspberry and the resistor replacing 4k7 with 1k5. I don’t know what will happen next hours but I would ask if someone could tell me what could be the problem? Thanks

  • 5m is a bit too long. Perhaps you can find a 1m cable and see if the problem disappears.
    – tlfong01
    Aug 24, 2022 at 11:59
  • Yes but with same cable it has been working fine for almost 4 years. Aug 24, 2022 at 12:28
  • 1
    OK. So cable length should not be a problem, but see notes below. I see that you are using two sensors. Perhaps you can try just one sensor and see what happens. Notes, for i2C (which is similar 1-wire) devices, changing wiring configuration may change total impedance/capacitance, and cause problems.
    – tlfong01
    Aug 24, 2022 at 13:04
  • 1
    You should add a schematic to clarify your question.
    – Seamus
    Aug 25, 2022 at 20:17

1 Answer 1


It sounds like something has failed and or was on the edge. If your voltage measurements were made with the system running they are invalid as it is an approximate square wave on the pin. Rob Tillaart wrote a scanner for the Arduino, I do not know of one for the Pi. If you can find one it will help a lot. Without a schematic I will take a guess and say the 4.7K which you ran from the GPIO to +3V3 is to large, try something in the 1.2K range (1.5K should work). Connect only one sensor with a piece of wire no longer then 1 meter (~yard) and try it, then do it again with the second sensor. If both work try two. If one does not replace it with a known good unit. If neither work get another known good sensor. If this does not get you there which I think it will post your schematic, not a frizzy picture and the code. Before you do all of that try switching the port high for a few seconds then low for a few seconds with only your volt meter and see what your meters tells you. If you are more than about 0.5 volt from the either rail depending if high or low you possibly fried the Pi.

  • As told, I already changed the resistor to 1k5 and I shortened the last segment of second Dallas (from 3 mt to few centimeters). Now both Dallas are in same place with more than 5 mt of cat5 (I forgot to add the cable I left in surplus), probably they are 10 mt!. You tell me about some checks on sensors but, as already told, the sensors lost connection randomly. Normally, also in this period, they work fine. Only sometimes I loose connection of both and I have the strange tension on GND, VCC and Vin. What I must do is to detach the cable from Raspberry and reconnect it and all is fine again. Aug 25, 2022 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.