Steve T's Semi-Cohreant Ramblings

Just another WordPress site

  • About Steve
  • Blog Roll
  • Contact

1-Wire for Temperature Monitoring – Part 2

Posted by stevet on July 14, 2013
Posted in: Geek Out, Home Improvement.

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 1×9 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]
[email protected]:$ 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
[email protected]:$
[/code]

Four sensors! Awesome. Now how hot is it at all of these sensors:
[code]
[email protected]:$ 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
[email protected]:$
[/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.

Posts navigation

← 1-Wire for Temperature Monitoring
1-Wire for Temperature Monitoring – Part 3 →
  • Recent Posts

    • DirecTV 775 Message
    • Configuring BFGMiner on CentOS
    • 1-Wire for Temperature Monitoring – Part 3
    • 1-Wire for Temperature Monitoring – Part 2
    • 1-Wire for Temperature Monitoring
  • Recent Comments

    • stevet on BalanceNG Experts?
    • tgo on BalanceNG Experts?
    • stevet on Stupid NFL Officials
    • RoccoBoxer on Stupid NFL Officials
    • RoccoBoxer on Stupid NFL Officials
  • Archives

    • August 2016
    • November 2013
    • July 2013
    • July 2011
    • June 2011
    • August 2010
    • July 2010
    • May 2010
    • November 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
  • Categories

    • Geek Out
    • Home Improvement
    • Poker
    • Random Rants
    • Sports
    • Uncategorized
  • Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.