Some technical background on the Dallas Semiconductor 1-wire-network
(Microlan) that is discussed below.
It's called 1-wire (trademark!), even though it's physically two
wires. Go figure; marketing!
Of the two wires, one is ground, and the other is both power and data.
This does impose some weird constraints on the 1-wire-network system,
but it has shown itself to me to be quite robust with the use of
standard rj-11 phone connectors.
From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
>Kevin Wang gave me (thanks) a temperature sensor that consists of a
>standard DB-9 serial port connector, a length of telephone cable, some
>small parts from Dallas Semiconductor Corporation (DS2480 and DS1280 I
>think from the source, but I cannot find these dcumented at their
>website http://www.dalsemi.com, so maybe there are newer or different
>parts ... Kevin?), and some open source from Dallas to drive this
>gizmo.
Yes, those are the correct part #'s.
Here's the general type of message that I fax to order parts:
>Fax To: 972-371-3715
>
>From: Kevin Wang
>Please bill to: (visa|mastercard) 0000-1111-2222 exp 00/00/2000
>Please ship via: UPS
>Please ship to:
> Kevin Wang
> 1111 Street Ave
> Some City, CA 90000
>
>Items Requested:
>
>10 DS1820, PR-35 package - temp sensor accurate to 0.5C
>1 DS9097U-S09 - universal 1-wire com port adapter
The DS9097 is the serial dongle, with the chip inside being the
DS2480.
I can't find my receipt from my last shipment, but I remember that the
DS9097's were $10-$15, and the sensors themselves were around $2-4 USD
each. My original shipment of 2x DS9097 serial port dongles and 4x
DS1820 sensors cost $47.42 USD (includes shipping cost).
From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
>Kevin, do you expect to have many/several of these sensors wired up
>in parallel from the same serial port? And how many in the limit?
Yes, I definitely expect more than one sensor to be on a given 1-wire
network at a time. I am running three sensors on one 1-wire-network at
home, and plan on eventually increasing that to ~20. At work, I have
one in my office, and eventualy would like to have one sensor per
machine, which would make it average 6 at any given time.
I vaguely remember that the limit on quantity of sensors is something
like 100. I can't find the appropriate spec sheet right now, but I do
remember that it was a very large number.
The real limitation is electrical. It varies depending on cable
capacitance, length and quantity of sensors. I have tested two sensors
at the end of 400' (~120m) of cheap phone cable, and it worked. I plan
on using RJ-11 telephone cables everywhere to run these sensors, since
it's cheap, light, and flexible cable and I can use existing telephone
"Y" splitters to add more sensors.
Which reminds me, I brought a second sensor and the appropriate RJ-11
connectors to give to you on friday, but totally forgot to communicate
this. How can I get this second sensor to you, so that you can
properly test multi-sensor 1-wire-networks? This sensor has only about
19 inches (~0.5m) of cable attached to it. Could I, should I just drop
it into an envelope and mail it?
>Do you ever expect to use more than 1 serial port? I am guessing that
>cable lengths or other MicroLAN limitations would force you to a second
>serial port eventually.
realistically, just for temp sensors, no. but then again, I don't plan
on having that many sensors on the 1-wire-network, maybe 20 tops.
If there is a high 1-wire-network load, it can be solved by adding a
third wire for power. Actual power consumption is extremely low, and
could be done with some batteries, although a wall wart would be more
than enough.
>Do you know where I can find
>(a) a description of the parts you purchased and wired together, and
included above. Note that those are raw parts, and one still needs to
connect the rj-11 phone jack to the sensor itself which looks like a
plain transistor. I can write something up (and include various part
#'s) so that anyone with a wire stripper and a screwdriver can put
something together.
>(b) a MicroLAN programmer's guide ... I am most interested in
> - when I need to acquire and release the MicroLAN ... I am doing
> it for every fetch at the moment, but could I just acquire it
> once at the start of the PMDA? And if so, who would I screw
> up and how?
http://www.ibutton.com/tmex/
the way I run it at home is to probe the network only once - at program
startup which tends to be once every reboot. It does get confused when
a sensor drops off the network, but a restart makes the error messages
go away.
> - there is a 1 second quiescence time before sampling the
> reply from each sensor ... this will mean the PMCD timeouts
> will have to be potentially very large or I need a cacheing
> PMDA if the sensor count is going to be large.
http://www.dalsemi.com/datasheets/pdfindex.html
Actually, that's ~1 second in which the sensor is calculating the
temperature! the spec sheets that this calculation should take no more
than 0.5 seconds, but once you add in transfer time, and other
overhead, it comes out to ~1 sec.
Also, that's per sensor. Only one sensor may be running temperature
calculations at a time, because with only two wires to do power and
signal, it needs to tie the bus up high to have enough power to do the
calculation itself!
If you go with the model of probing the 1-wire-network at startup time,
and holding the serial port the whole time, I don't see a problem with
doing a caching type pmda where everything is continuously queried for
temperatures, and assuming 100 sensors at 1 second per datapoint,
that's a update time of 100 seconds. Not great, but reasonable.
If someone does need more timely temperature readings, one need only
purchase more serial dongles and run more 1-wire-networks separate from
each other.
Hm, one could make some sort of combined pmda, where one pmda can and
does probe multiple serial ports, and hides this fact. the 64-bit
serial number per temp sensor makes then totally unique from each
other. No need to identify which 1-wire-network is which.
realistically, I don't think we need to support more than (qty1)
1-wire-network per system. the pmda's might get unusually messy trying
to separate things out by network and by temp sensor id#.
I see this as a quick and easy fix for no system accessible
environmental sensors.
>Do you want either the /var/pcp/pmdas/roomtemp contents for Linux, and/or
>the source code for the PMDA?
Yes, I'd love to have this running under pcp&linux! binaries would be
easiest, but anything I need to do is acceptable.
- Kevin
|