DS18b20 usage and setup


11 posts
by RaTTuS » Thu Jan 17, 2013 10:20 am
I'd like to run one of my RPi's as a temp monitor for the house.
I have CAT 5e cabling all over the house and out to the shed
I understand http://www.cl.cam.ac.uk/freshers/raspbe ... mperature/
and have had one work attached to the top of my RPi
what would be the best way to arrange my setup so I can use some of my existing CAT5e to hang some more sensors at places farther down the line
I don't think that the 3.3v from the RPI will be beefy enough to reach the farther places [I have not yet tried]

I'm open to all suggestions ;-p
http://www.catb.org/esr/faqs/smart-questions.html Ask Questions
http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=7192 AutoStart Script

"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
User avatar
Posts: 6608
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by repton » Thu Jan 17, 2013 8:08 pm
If they're all over the house then the GPIO based 1-Wire driver isn't going to work for you, it's only any good on relatively short networks.

You need some other kind of 1-Wire master. Essentially you have two options, a DS9490R USB to 1-Wire host adapter or some kind of i2c connected master plugged into the GPIO connector. Either one will support a network of up to about 100m of twisted pair cable.

I sell both of these options and am happy to give all the advice you need either on here or by PM or email. See the link in my signature for more information.

Paul
UK Supplier of 1-Wire components, kits and modules:
http://www.sheepwalkelectronics.co.uk/
Posts: 91
Joined: Sat Mar 17, 2012 6:06 pm
Location: North Yorkshire, UK.
by rurwin » Thu Jan 17, 2013 8:52 pm
Hi repton.

I have 10 of these sitting waiting for me to get a round tuit. What would you say was a reasonable, stable maximum length for a GPIO-mastered line with good tight twisted pair (not CAT5) and no spurs?

I was thinking maybe 10m with 4-6 DS18B20s.
User avatar
Forum Moderator
Forum Moderator
Posts: 3132
Joined: Mon Jan 09, 2012 3:16 pm
by repton » Thu Jan 17, 2013 9:00 pm
rurwin wrote:I have 10 of these sitting waiting for me to get a round tuit. What would you say was a reasonable, stable maximum length for a GPIO-mastered line with good tight twisted pair (not CAT5) and no spurs?

I was thinking maybe 10m with 4-6 DS18B20s.


I've not actually had enough round tuits myself to test this to its limits but I have had 3 sensors working on 11m of cat5 reliably. I think the limiting factor is going to be cable length rather than number of sensors as the sensors themselves only use tiny amounts of power when idle.

I would think 10m and half a dozen sensors would work fine.

Paul
UK Supplier of 1-Wire components, kits and modules:
http://www.sheepwalkelectronics.co.uk/
Posts: 91
Joined: Sat Mar 17, 2012 6:06 pm
Location: North Yorkshire, UK.
by rurwin » Thu Jan 17, 2013 9:32 pm
Thanks
User avatar
Forum Moderator
Forum Moderator
Posts: 3132
Joined: Mon Jan 09, 2012 3:16 pm
by RaTTuS » Fri Jan 18, 2013 7:30 am
OK - Thanks ,
what I'll do when I have some time [ha!] is have a play and see what I can sort out.
http://www.catb.org/esr/faqs/smart-questions.html Ask Questions
http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=7192 AutoStart Script

"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
User avatar
Posts: 6608
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by vincewebb » Sun Jan 27, 2013 3:18 am
repton wrote:I sell both of these options and am happy to give all the advice you need either on here or by PM or email. See the link in my signature for more information.

Paul


I have one of Paul's RPI2 daughter boards
http://www.sheepwalkelectronics.co.uk/RPI2.shtml
I'm very pleased with it:
Posts: 3
Joined: Sun Jan 27, 2013 2:23 am
by aviansun » Fri Dec 19, 2014 5:46 am
Is this 1-wire setup useful for connecting a 16-channel relay which is close to the 120V mains board of the house and the gpio of RPi which is in the living room (approx 20m far away). So basically extending gpio over a long distance without interference caused by voltage spikes etc, due to mains lines.

Or

Should I just place the RPi close to the mains board and relay board, will that pose a threat to the gpio due to induced voltage caused by mains. The relay board has optocouplers, but what about the RPi side, Do I have to use optocouplers on the RPi GPIO ports also?

Thanks
Posts: 1
Joined: Fri Dec 19, 2014 5:31 am
by iinnovations » Mon Dec 22, 2014 12:57 am
aviansun wrote:Is this 1-wire setup useful for connecting a 16-channel relay which is close to the 120V mains board of the house and the gpio of RPi which is in the living room (approx 20m far away). So basically extending gpio over a long distance without interference caused by voltage spikes etc, due to mains lines.

Or

Should I just place the RPi close to the mains board and relay board, will that pose a threat to the gpio due to induced voltage caused by mains. The relay board has optocouplers, but what about the RPi side, Do I have to use optocouplers on the RPi GPIO ports also?

Thanks


I'd say this warrants another thread.
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com
User avatar
Posts: 620
Joined: Thu Jun 06, 2013 5:17 pm
by iinnovations » Mon Dec 22, 2014 12:59 am
I've been using DS2483s with my Pis with owfs/owserver for, well, many years with no issues. Long runs over CAT5, no problems. People say the DS9490s are more reliable (which I use on windows machines), but I've yet to have any issues with the DS2483s, which cost <$1 compared to ~$25-30 for the DS9490, and USBs are at a premium on the Pi.

C
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com
User avatar
Posts: 620
Joined: Thu Jun 06, 2013 5:17 pm
by iinnovations » Mon Dec 22, 2014 1:04 am
As far as setup is concerned, my boot code is here under 'runi2cowfs':

https://github.com/iinnovations/iicontr ... id/boot.py

but there's also code there with provision for running a USB master as well.

My read code of owfs/owserver is here:

https://github.com/iinnovations/iicontr ... owfslib.py

There is provision there for using ownet if you see fit, but I found it slow and am currently using the straight fuse/owfs method.

C
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com
User avatar
Posts: 620
Joined: Thu Jun 06, 2013 5:17 pm