Difference between revisions of "OpenBSD onewire"

From WTFwiki
Jump to navigation Jump to search
(initial onewire stuff)
 
(add example parts list)
Line 33: Line 33:
 
this project and the layout of my onewire network.<br/>
 
this project and the layout of my onewire network.<br/>
 
<br/>
 
<br/>
 +
== Parts List (examples) ==
 +
=== Required ===
 +
* [http://www.hobby-boards.com/catalog/product_info.php?cPath=23&products_id=1503 DS9490R-A USB 1wire Adapter] - 1 of these per installation
 +
* [http://www.hobby-boards.com/catalog/product_info.php?cPath=26&products_id=93 DS18S20 Temp Sensor] - N of these
 +
* As many feet of cat5e, cat3, thermostat wire, or any suitable 2-3 contact copper media (I use cat5e)
 +
=== Optional ===
 +
To make the installation pretty, and easier to maintain, I also use the following, at significant additional cost:
 +
* [http://www.amazon.com/Surface-Mount-RJ-45-Keystone-Wiring/dp/B005LIAS0S/ref=sr_1_8?s=electronics&ie=UTF8&qid=1317146238&sr=1-8 Surface mount 2-mod boxes] - N of these, that is: 1 2port box per sensor.  Mine are a little different, this is just an example.
 +
* [http://www.amazon.com/CAT5E-White-Keystone-Jack-568A/dp/B000RBCRLC/ref=sr_1_4?s=electronics&ie=UTF8&qid=1317146183&sr=1-4 RJ45 keystone modular jacks] - N*2 of these, that is: 2 per sensor.
 +
* [http://www.amazon.com/100PCS-CAT5E-MODULAR-PLUGS-Connector/dp/B003M5BIII/ref=sr_1_6?s=electronics&ie=UTF8&qid=1317146582&sr=1-6 RJ45 8P8C male connectors] - N*2 of these, that is: 2 per sensor.
 
= Code =
 
= Code =
 
I'll later make my code available for download, but I don't have time right now.<br/>
 
I'll later make my code available for download, but I don't have time right now.<br/>

Revision as of 14:03, 27 September 2011

Introduction

I recently ran into a situation that called for some environmental monitoring
of some random things on my home property, and had long thought about playing
with Dallas Semiconductor "onewire" devices to do this: specifically monitoring
temperature.

Software Implementation

Conveniently, my home router (a Soekris net4801 runs OpenBSD 4.6,
which supports some of these devices wonderfully, and in a very convenient manner.

I opted to use a USB adapter (DS9490R) with some DS18S20 sensors.
The USB adapter attaches happily as uow(4) and automatically scans the
attached onewire(4) bus for devices.

These choices made this project very simple..

I also wrote a few custom scripts using the Bourne shell and Ruby to do things
with the data that the sysctl(8) interface provides me: I mainly graph the data
using rrdtool for trending and analysis.

Hardware Implementation

I used standard cat5e cable, which I already had plenty of around my house
(I'm a net admin, what can I say..) and RJ45 ends and mod jacks/wall boxes
due to their simplicity and convenience.

The cabling is simple, but involves some soldering to the sensors themselves.
There are 3 pins on a sensor: GND, DQ, and VDD: in my case, I actively use only
2 of them: GND, DQ. VDD is simply jumpered to GND because I'm using them in
"parasitic power mode", which means they draw power from the bus and store it
locally for later use. I used the blue and white-blue pair out of the cat5e,
and consistantly wired the white-blue to GND and blue to DQ as a convention.
I wired all of my sensors in a daisy-chain fashion because it works well for
this project and the layout of my onewire network.

Parts List (examples)

Required

Optional

To make the installation pretty, and easier to maintain, I also use the following, at significant additional cost:

Code

I'll later make my code available for download, but I don't have time right now.

Graphs

Some of my example graphs can currently be found here.
No guarantees that they'll stay available at this point.