Multiple 1-wire buses on the raspberry pi 3 and multiple DS18B20

Darn, lost 2 of the 3 one-wires each lost their two sensors overnight. So it wasn’t just a connectivity issue causing me issues. I’m currently running with 5V VCC and 3.3V to data through a 4.7k resistor. I’ll try doubling up the resistors to see if that helps but my guess is that it won’t be enough to stabilize things. Looks like I’ll be forced to serialize the topology which will make wiring the RJ12 jacks more complicated. Presumably I only need to provide a return for the data line to feed into the next sensor? VCC/Gnd can remain in a star topology?

Update. Most of my reliability problems were with a single wire and/or sensor. Depending how I’d randomly chosen to group sensors in my testing I was seeing anything from that single sensor not even being reliable by itself to 3 (other) sensors working just fine in a star arrangement.

Maybe noisy fake sensors…

https://github.com/cpetrich/counterfeit_DS18B20.

I bought mine directly from Maxim website and that didn’t help.
The one thing I didn’t tried is a DS2482 shield for Raspberry, but I give up on that idea and replaced the sensors with WiFi version (wemos + espeasy). No zero problems.

Someone tried DS2482? I’d like to have a proper wire based solution for future projects.

any updates? How the situation is looking at your place? I curious did you solved the problem and how.

What I found was that the existing phone wiring I’m using seems to be the gating factor. Some runs can be wired together (star) and supports 3 sensors reliably. Other runs only work if they are by themselves. And others work initially but then get lost after a few hours. And others still don’t even get detected. The (estimated) wire length between the closet and the room jack doesn’t seem to have any real bearing on my success. Some close sensors don’t work while some of the most distance ones do. Given this I discounted the idea of redoing the wiring to serialize the topology - it wouldn’t help meaningfully help my situation.

Cases where the sensor reliably gets detected at initial connection but then disappears after a number of hours are the most frustrating. It feels like I ought to be able to tweak things to get those to work but bumping the power to 5V and dropping the resistor value by half by doubling them up didn’t make any difference for my problem cases.

One interesting case was the sensor I put in my daughter’s room. Initially it worked just fine by itself and only disappeared (after a while) when another sensor was added. So I had it by itself and that was working fine for a few days. Then it started disappearing again after 4 or so hours. Now it doesn’t even get detected if I disconnect/reconnect it. I might try a different sensor in case that one just failed on me.

I took a break from playing since I got frustrated by the unpredictability but my next steps are to confirm the wiring is otherwise good and correctly identified at the wiring closet end for a few of the jacks where I haven’t successfully had a sensor recognized at all yet (basement room, 2nd telephone socket in my office that’s not by the hot computer).

I do have a crimper now so I put connectors on the ends of the wires in the wiring closet so I can easily rearrange them to test new sensors and/or sensor star combinations.

So I added the master bedroom, re-connected my daughter’s room (which so far has been reliable again for several days), added the basement room, checked the wiring for the second socket in my office (it was miswired which is why it wasn’t working) and switched over to that.

So now I have 5 separate one-wires running off my pi. Currently with 3, 2, 2, 1, 1 connections respectively. I have not yet tried to optimize the connections fully. I know I have two rooms that require a dedicated connection (one is still not reconnected yet). But of the remaining 8 rooms, I don’t know if I can successfully bump 2->3 or 3->4 on a single one-wire pin. I also still have another 3 lower priority rooms I’d like to add sensors to. But there’s still plenty of spare gpio pins if I need yet more separate one-wires.

I had an epiphany the other day. I’d been so fixated on wiring length and quality being a big issue that I hasn’t considered that the sensors themselves may be at fault. And sure enough, swapping a well behaving sensor with one that disappeared after several hours never to return unless physically disconnected and reconnected showed that the good sensor on the ‘bad’ wire worked just fine. And the ‘bad’ sensor on the good line continued to not work properly. I see how that there’s an Amazon review for the sensors I bought describing exactly the same misbehavior symptoms. I’ve managed to get from 7 reliable to 9 reliable by using my spares. I lost a few of the spares by messing up the punch down into the rj11 plugs and then a number more of the sensors were immediately and obviously bad but I got 2 more good ones out of my remaining 6-8 sensors. I’ve ordered another 10 that had good reviews to see if i can get that final room (the master bedroom) working.

Consider ordering sensors from Maxim or from their distributors (https://www.maximintegrated.com/en/aboutus/contact-us/distributor-offices.html)
I know they are a bit pricey, compared to China clones, but you will be 100% sure they aren’t faulty.
If you have a company, you can order a couple as a free sample from Maxim :slight_smile:

These are the new ones I ordered that had better reviews:
Eiechip 10Pcs 18B20 DS18B20 TO-92 3 Pins Wire Digital Thermometer Temperature IC Sensor https://www.amazon.com/dp/B07MR71WVS/ref=cm_sw_r_cp_api_i_CALjFbDXHPF98

I lost one of the ‘good’ older ones because it fell out of the rj11 plug getting it out of the tight socket. I didn’t see any point trying to reuse it. So now I’m running 2 of the new ones. They are working perfectly so far for 1.5 days. I may try combining more onto fewer 1wire gpios in a few more days once I’ve confirmed they remain good.

For reference, these are the bad ones:
10pcs DS18B20 Temperature Sensor, Dallas 18B20 TO-92 3 Separate Pins Wire Digital Thermometer Temperature IC Sensor 18b20 Electronic for Arduino Raspb https://www.amazon.com/dp/B07XHQXMSG/ref=cm_sw_r_cp_apip_bWJbNTASIfdlB