Steve's Ramblings

1-Wire for Temperature Monitoring - Part 2

This is a continuation post documenting my installation of a 1-Wire Temperature monitoring system in my house. Part 1 can be found here.

Ultimately I want to monitor 5 different sensors in and around my house. However because I don't feel like climbing around in my attic when it is well north of 100 degrees, I am only going to hook up four.

In my last post, I documented the process of hooking up a weatherproof sensor to a RJ-11 jack. While that works and will work well, I previously wired RJ-45 jacks for ethernet so I switched to that size wherever I could.

Next problem I had to solve is how to distribute the 1-Wire system to multiple plugs. I found this Leviton 1x9 Structured Telephone Module which is typically used to distribute phone services up to 9 plugs. Since 1-wire uses three wires, this will work great. It is a $20 part, but well worth it.

I wired up three RJ-45 plugs into about 18" of four-wire phone wire and then punched the wires down into the telephone module. I could then use my Ethernet panel to connect the USB sensor and the two internal sensors. I then punched down one of the weatherproof sensors into the same block. Lastly, I soldered a final sensor to a longer length of four wire phone cord. I ran that cable up into my attic and zip tied it to an attic brace. After I punched it into the block and plugged my two internal sensors in, I was set to test the system.

First up is to run the initialization: [code] stevet@neon:$ sudo /usr/bin/digitemp_DS2490 -i DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane GNU Public License v2.0 - http://www.digitemp.com Found DS2490 device #1 at 001/019 Turning off all DS2409 Couplers ..... Searching the 1-Wire LAN 28C092C80400000E : DS18B20 Temperature Sensor 2881D1C8040000EB : DS18B20 Temperature Sensor 28355AD90400003C : DS18B20 Temperature Sensor 287B69C7040000BD : DS18B20 Temperature Sensor ROM #0 : 28C092C80400000E ROM #1 : 2881D1C8040000EB ROM #2 : 28355AD90400003C ROM #3 : 287B69C7040000BD Wrote .digitemprc stevet@neon:$ [/code]

Four sensors! Awesome. Now how hot is it at all of these sensors: [code] stevet@neon:$ sudo /usr/bin/digitemp_DS2490 -i DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane GNU Public License v2.0 - http://www.digitemp.com Found DS2490 device #1 at 001/019 2013/07/14 13:07:31 Sensor 0 F: 110.53 2013/07/14 13:07:32 Sensor 1 F: 91.51 2013/07/14 13:07:33 Sensor 2 F: 78.69 2013/07/14 13:07:34 Sensor 3 F: 79.93 stevet@neon:$ [/code]

A bit warm in my attic. But every sensor worked.

In my last post I created a /etc/digitemprc file that is used as part of my cronjob. That config needs to be modified with the current sensors. Just like the last post, I used the .digitemprc file created by the initialization and changed the log format.

Because I added three sensors and the order has changed, my digitemp_rename script needs to be updated as well. Here is the new version. Very similar to before, but it handles the new sensors: [code] #!/bin/bash

sed -e "s/Sensor 0/Attic/" -e "s/#0 : 28C092C80400000E//" -e "s/Sensor 1/Garage/" -e "s/#1 : 2881D1C8040000EB//" -e "s/Sensor 2/Living_Room/" -e "s/#2 : 28355AD90400003C//" -e "s/Sensor 3/Master_Bedroom/" -e "s/#3 : 287B69C7040000BD//" [/code]

While I was doing all of this work, I disabled the crontab. It would error out while sensors were disconnected and moving around anyway. I cleared the log file and re-enabled the cronjob to run every minute.

After a few minutes, this is what my log looks like: [code] 2013/07/14 13:08:02 Attic F: 110.53 2013/07/14 13:08:03 Garage F: 91.51 2013/07/14 13:08:04 Living_Room F: 78.69 2013/07/14 13:08:05 Master_Bedroom F: 79.93 2013/07/14 13:09:02 Attic F: 110.75 2013/07/14 13:09:03 Garage F: 91.51 2013/07/14 13:09:04 Living_Room F: 78.69 2013/07/14 13:09:05 Master_Bedroom F: 79.93 2013/07/14 13:10:02 Attic F: 110.86 2013/07/14 13:10:03 Garage F: 91.51 2013/07/14 13:10:05 Living_Room F: 78.57 2013/07/14 13:10:06 Master_Bedroom F: 79.81 [/code]

Everything looks good from a logging perspective.

Part 3 is to graph the data that I am gathering and see how things look visually over time.