[plug] sensors

Daniel Foote freefoote at gmail.com
Thu Sep 20 09:13:46 WST 2007


> In fact, I believe there's software out there to link up a DS18S20
> directly to the serial port (see
> http://martybugs.net/electronics/tempsensor), which makes it even
> simpler.

If you want the simplest, have a look at OWFS (one wire fs). It has
bindings for many languages (PHP/Perl/Python/Tcl), and also has a FUSE
module, so you can mount your one-wire devices as a filesystem and
then simply "cat" values from the sensors.

http://owfs.sf.net

On their page they show the dead-simplest bit banging serial adapter -
it's crude and slower than a proper controller, but works very well (I
used it to log three DS18S20 sensors for 6 weeks, once per minute.
Early next year I hope to log about 10 sensors, maybe every 5 minutes,
over a week).

OWFS also supports various USB and proper RS232 one wire adapters.

Hope this helps...

Daniel Foote.

(As a side note, I bought just last week a few toys: single board
ethernet computers. They are based on a PIC18F452, with a RTL8019 for
ethernet connectivity. Not that cheap - $65/each.

The PIC itself has 32k of Flash and 1.5k of SRAM. The shipped firmware
takes up half that flash space. It also comes with a seperate 32k
EEPROM for webpages.

They ship with a web server and a set of basic pages. You can FTP a
new set of pages to it (the .cgi pages are parsed and tags in it
replaced, allowing a basic mini-application to be built for it). For
anything more complicated, the PIC would have to be reflashed - it has
the appropriate in-circuit-programming socket. It comes with the full
source code (in C) and you can get a free compiler for it (Microchips
C18, seems to be Windows only but I'll give it a go under Wine). For
one of the other boards I'm going to have to flash it to make it do
what I want, so I'll be trying to build a programmer fairly soon.

One of these boards has just replaced my old serial sprinkler
controller. Now it can serve up its own webpage with "Back lawn: off
[toggle]"  and so forth.

(Can I keep this Linux related by saying that my linux fileserver
turns on and off the sprinklers as needed, after checking to see how
much it's rained in the last few days? It screenscrapes the BoM site
for the nearest weather station, tallies the rain, and if lower than a
certain amount, fires up the sprinklers. The entries are in my user's
crontab, which is populated once a day from one of my Google calendars
by a Python script that I wrote that downloads the iCal file for the
relevant calendar and parses it... oh... and to turn on and off the
sprinklers, the server uses wget to hit a certain http URL on the
controller to toggle the appropriate outputs...)

Anyway, enough rambling...)



More information about the plug mailing list