A few years ago I created a custom heating system for my house using a Raspberry PI, a few relays and DS18B20 sensors.
This is worked OK, now I want to move my project to an Arduino Uno, because I think it would be more stable.
However I've run in some issues when trying to connect my temperature sensors. When connecting the pins to the arduino and performing a search (using default search code from the OneWire library), it comes up with nothing. I've also tried the "OneWireNg" library without any luck.
I tried just connecting one sensor on a breadboard to the Arduino, which worked perfectly. However I cannot get my old network to work.
The old network has a 4.7kOhm resistor, connected to three sensors very close (1-2 meters). Then the cable extends underground outside where our heater sits (around 20-30 meters). There we have 4 sensors.
Some suggests decreasing the resistor, which I tested (having two resistors in parallel resulting in 2.35kOhm).
I've tested all sorts of pin arrangements, aswell as rechecking that it still works with the raspberry pi, which it does.
I should mention that all sensors in the old network are DS18B20 (waterproof version). The sensor I've tried with the Arduino was of the pin model. I also tried connecting a new DS18B20 which was waterproof to the Arduino in parallel with the non waterproof one, and the search found it correctly. However my point is that I've neved gotten a sensor used in the old network to work with the Arduino setup. Could the sensors be working differently somehow?
Has someone had similar issues, or could point me in the right direction?
I would expect that arrangement to work fine. The only factor that I can think of being a problem is the 30M wire run, but since it works with the Pi, I don't see why the Arduino (especially with its higher voltage) would have a problem.
I will experiment further with different resistors to see if I can get it working. Some people are suggesting adding a small capacitor. Do you think that could improve my situation?
I will experiment further with different resistors to see if I can get it working. Some people are suggesting adding a small capacitor. Do you think that could improve my situation?
If other people have found it useful, it might be worth a try.
However, I get the impression that your sensors are inaccessible and therefore tricky to replace if something goes wrong. If that's the case, I'd stick with what's working (the Pi) rather than risk frying anything with your experiments.
It sounds like you have a wiring/hardware issue if neither the Pi nor the Arduino can reliably talk to your sensors.
I would stick with the Pi and have it keep records of which sensors go offline and when - maybe there's a leak somewhere. Hopefully you can code around it.
The sensors sold as waterproof aren't robust, and moisture will get into them over a period of days or weeks
in my experience if constantly wet. This will cause leakage and may be the cause of the problem - higher
voltages may make the effects of moisture worse.
I agree with windbill and MarkT. On this forum we see problems with the "waterproof" DS18B20. They are "waterproof" just long enough to get a positive feedback for the seller.
Since it is almost working or not working, anything can have influence. A larger or lower pullup resistor value or higher or lower voltage can make it work or make it stop working.
You should start to think about making a new temperature sensor network. Be sure that everything is at least three times waterproof. Epoxy potting the DS18B20 is a good start for the first layer of protection.
If sensor readings become interrupted it is best to rebuild the entire network right from the beginning, with new or thoroughly checked components. Nice job in a new year. The 30 meter or so wire, is that a three-wire flat wire or a cat-5 LAN cable? I prefer the latter. Your 4.7 ohm resistor is between what wires? Can you post a wiring diagram?
best wishes for 2020 - Photoncatcher