navitron
 
Renewable Energy and Sustainability Forum
UK's most popular Renewable Energy Forum May 25, 2012, 12:03:56 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: UPDATE ON DECC APPLICATION FOR LEAVE TO APPEAL TO THE SUPREME COURT | Yingli Green Energy's PV Module Ranks No.2 in TUV Rheinland Energy Yield Test | Navitron Solar Showers at Glastonbury for Year 5!
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: N00bie with one wire stuff  (Read 2340 times)
Tim England
Newbie
*
Offline Offline

Posts: 45


« on: October 01, 2008, 06:09:57 PM »

Hope I'm not being too naff by asking about 'one wire' or whatever it's called, but from the miniscule amount of reading I have made today, it seems like this might be a help to me.

I would like to be able to monitor the temperature in the different rooms in the house from my laptop - is there where 'one wire' comes in?

Where do I start?  Where can I buy sensors?  CAT5 cabling I know about, and RJ45s etc.  How do I connect to the laptop?  What software do I need?  Is there a FAQ on this subject?

Sorry for all the questions, I'm normally on here reading about listerclones and CHP, not home monitoring, and need to get up to speed pretty quickly if possible.

Thanks

Tim
Logged
CeeBee
Hero Member
*****
Offline Offline

Posts: 827


WWW
« Reply #1 on: October 02, 2008, 04:57:24 PM »

I was looking forward to reading all the informative replies that you were going to get... May as well give the thread another kick.

Not done any of this myself. If nothing is forthcoming, you'll be stuck with Googling. Here's what I reckon:

The 'one-wire' refers to the fact that the sensors are strung - daisy-chained - along a single cable. The cable has at least two wires in it, but that's neither here nor there.

Looks to me like the sensors resemble computer-chips with legs. It's left to you to choose suitable wire, and attach the wires to the right legs.

You need some kind of HA (Host-adaptor) to deal with the one-wire bus and interface to computer. Seems that USB and serial (and other?) ones are available.

If you were hoping for Windows software, then I've not so far spotted any - still might be though. For Linux, owfs seems to be the way to go.

For other reasons, I'm considering the RFXCOM stuff for some monitoring. They do an RFXSensor module to which you can connect their limited range of one-wire sensors. But this then uses 433MHz radio to transmit to matching receiver, and you'd end up paying a lot more than with the direct DIY one-wire approach. Actually, if going the route of having an RFXCOM receiver, and just wanting to measure room temperatures (rather than temperatures at various points on pipes, or water cylinder), then you could put e.g. Oregon Scientific 433MHz temperature sensors in each room and receive them with the RFXCOM (as well as with the Oregon base-station, if you bought one of those as well).
« Last Edit: October 03, 2008, 05:23:41 PM by CeeBee » Logged

Mike N.
Sr. Member
****
Offline Offline

Posts: 357


« Reply #2 on: October 03, 2008, 11:55:51 AM »


Where do I start?  Where can I buy sensors?  CAT5 cabling I know about, and RJ45s etc.  How do I connect to the laptop?  What software do I need?  Is there a FAQ on this subject?
Thanks

Tim

Hi Tim

Hobby Boards is where I started. Their site has a good range of components but also links and background info. I also bought Tim Bitson's book Weather Toys which was very helpful. Also try searching this forum for references. there have been many  threads in the past.

http://www.hobby-boards.com/catalog/main_page.php

Mike
Logged
wyleu
Guest
« Reply #3 on: October 03, 2008, 01:41:07 PM »

One -wire....

What is it? what does it do? why would I like it?

Firstly a couple of things to know.

Accurate Measurement of a physical parameter is hard to do. Just trying to measure a voltage across a room involves wires which unless carefully designed will mean that the voltage at one end of those cables will be different from the voltage at the other. Add in a change of temperature and what those long wires might pick up from the mains wiring on your house  and you can see that when someone says it's exactly 12 Volts that really can mean almost nothing.
Once you realise that then if you think of the traditional Powerstation control room that may exist on sites that are the size of several fields then it is easy to see that the monitoring of such an enterprise is probably a fair bit more involved than just running wires which initself is a fairly involved task.

So what's different?
Well it's your Digital ain't it?

If I measure 12 Volts with my recently calibrated good old fashion AVO meter with it's carefully prepared mirrored scale I might well read 12.7 Volts and given the quality of the meter then you probably can say that you have 12.7 volts. If I shout that reading down a telephone line to the control room then the accuracy of that is very high. It only starts to fail when the telephone line gets so noisy that you can't hear anything. And that is what digital has done. You can get a small integrated circuit ( a square black plastic beastie with 8 connections  about the size of small shirt button ) that can measure voltage accurately, because that is what it's designed to do. It will have compensation on it for changes in temperature, and it will read 12.7 volts as accurately as the AVOmeter. So it can be placed almost exactly at the point where the measurement is made. So how is this displayed ? well the AVOmeter has a fine clcokwork like mechansim and a finely defined scale with a mirror behind it so you can be sure your looking squarely at the meter to get the correct reading and in this case the thin hair like needle will sit over the top of it's own image in the mirror and also over the scal reading that corresponds to 12.7 volts. So that's how you know it's passing enough electrons to be 12.7 volts.
With the chip things are a little different. It has a set of patches of memory some of which are full of electrons and some of which aren't. The design of the chip means that the accurate electrical circuit has made those patches correspond to 12.7 expressed in a rather complicated layout that suits the computer world (it's binary) rather than a base ten number that suits it. BUT because we know that the patches are laid out in a specific way and that way is consistant then we can translate those on's and off's into 12.7 Volts.
So we need something to do that translation for us. But the lovely thing about that is that unlike the AVOmeter we do not need to have the reading mechanism at the same point as the measurement bit, as long as as well as laying out the memory patches in a specific way we transfer the result to the measuring mechanism in a standard way.
That's great cos we can easily store those digital results and we could deal with several measuring devices using only one monitor bit. So that's what One-Wire is in principal. IT a range of measuring devices that can all speak the same language down a wire that will be accurate if it's intelligible, to a system that understands that language and can then display the correct result.
The chips can measure most things http://www.maxim-ic.com/products/1-wire/ and address ( sic) a couple of other aspects that might not be instantly obvious. firstly how do we know which device is which? Well so solve this one the chips have a characteristic that is fairly rare in moderm electronic devices. They are all slightly different. They have another set of electric patches that rather than being changeable have a unique number burnt into them, and the manufacturer garentees that they are unique. It means that moving down the wires holding this all together you have values and addresses, but since that's all part of the design it' no problem. But a wire is a pretty dumb thing, and in relative terms electricity can only flow one way or another but not at the same time. Well once again the design of the system comes to the rescue. When the controller device which will nearly always be connected to a computer of some kind shouts a particular message, then all the connected device EXCEPT the one that is being addressed shut up for a bit and let the one device that is being addressed shout back. Very clever that bit cos when it's combined with the unique ID's you have a system that can use only one wire to transfer all this data, and rather than an individual wire going to each device you can connect all the devices to the same bit of wire and they all behave properly cos they are designed to do so. Hence ONE-WIRE !!
Actually you can't have just one wire. Because a voltage has to be relative to something and the two devices that wish to communicate have to be relative to each other. Think of a battery. When you measure the voltage you use two wires and it tells you there is 1.5 volts across the battery. If you only connect one wire to the battery then the meter won't do a thing.
So to get our One-wire measuring thingy's to actually do things there has to be the signal wire and a connection ( it doesn't nccasserily mean it has to be a wire , but its good practice to make it one) that way the electrons can flow round the loop properly and all the magic described above can happen. So it's not One Wire it's really two wire, and we haven't actually supplied one other characteristics that the little chip devices need. Power. Now One-wire can pull a clever little trick here where the device can suck enough power out of the signal wire
to satisfy it's rather minimal demands, so it can run across two wires but althou' it works fairly well with a couple of devices it doesn't work much above that and it's also fairly dodgy in the presence of hum from mains and such like... so in this correspondents view you need a third wire to power the devices.

So that's it really you can connect many ( it can be hundreds ) of little sensors onto three wires that interconnect the whole rig and it works over 20 or so metres  back to a computer that can read all these values in a system that is probably more accurate than the sort of stuff that used to keep powerstations running properly. And it's cheap. The sensros cost a couple of quid and the interface bit ( which is a USB plug in device nowadays) will cost you about 30 pounds and if you can do the wiring and the soldering you can monitor all kinds of things in all kinds of places. Quite what is used to display all this stuff is a different problem, but funnily enough there might well be a community solution to that quite soon.

Oh before we move on there are a couple of other observations,
Firstly. DO NOT CONNECT ONE-WIRE EQUIPMENT DIRECTLY TO THE MAIN IN ANY WAY SHAPE OR FORM. KEEP THEM COMPLETELY SEPARATE.

That doesn't mean it can't be used to measure mains devices but the design of such devices required quarenteed seperation and unless you know what your doing here stay well away. A computer with all it's metal elements at mains voltage is perfectly possible to do this way and that will kill people. So Don't do it.

ONe-wire is proprietary, it's a published format but it's really only made by one manufacturer Dallas/Maxim and they reserve the right to alter things. It could all disappear  tomorrow and leave only bleating. It's not an open format like 12C or such like. So that is a bit of a pain.

But other than that if you want accurate measurement of temperature or humidity or voltage or light levels or rotational speeds or , or , or then one wire is probably the way to go in the domestic environment.

Look at the link above if you are more interested and certainly hobbyboards http://www.hobby-boards.com have supplied my bits and pieces, and they genuinely do work.

If anyone wants any further information then stick it on this thread and I'll attempt to give my personal view of the issue.

Chris@wyleu

Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #4 on: October 03, 2008, 04:58:46 PM »

Tim,
It you stick to Windows software then Logtemp free from www.mrsoft.fi, will do the measuring, sorting out the sensor ID's and give you pretty graphs, with next to no computing knowledge required.
All you need is a DS9490 USB to 1 wire adaptor from Hobby Boards or other supplier,  (there is also a serial port version ) and some DS18B20 sensors, which you can either buy already housed and fitted with sockets or as naked TO-92 packages.

You just need to daisy chain them together - You can either use the RJ45 cable to fit the Hobby Board modules or a twisted pair seems to work.

You just assemble the system, plug it into the USB port and start the software.

Although producing a graph is the default the software allows you to save it in several other formats or even send it up to the Web.

The only problem is that the data is stored on the laptop so this needs to be running all the time you are measuring.
« Last Edit: October 03, 2008, 07:14:27 PM by ericw » Logged
wookey
Hero Member
*****
Offline Offline

Posts: 2672


WWW
« Reply #5 on: October 03, 2008, 11:53:22 PM »

And on Linux use owfs (one-wire filesystem).

As has already been posted hobby-boards is a good place to start. Prices not too bad at current exchange rates. Sensors are available a bit cheaper from e.g. this guy: http://www.welserver.com/store.htm

Other pages of interesting reading:

Lots of good info on 1-wire in general, from a hobbyist point of view:
http://www.arunet.co.uk/tkboyd/e1didx.htm

http://www.opnode.org/dokuwiki/doku.php?id=opn-one : An interesting stand-alone 1-wire device that will monitor all your devices and draw pretty graphs, show webpages etc.

Some sexier and more expensive 1-wire sensors: http://www.datanab.com/sensors/sensors_1wire.htm

I decided not to use RJ45/RJ11 connectors for my system in the end (after seeing the physical size of the sockets) and have been using molex-alike 3-pin connectors instead. They are smaller and cheaper (about 16p per connector (plug, socket, crimps)) but a bit fiddly to make (putting crimps on the Cat5 is tedious).
Logged

Wookey
kristen
Hero Member
*****
Offline Offline

Posts: 1568


« Reply #6 on: October 05, 2008, 09:48:40 AM »

I read "Weather Toys: Building and Hacking Your Own 1-Wire Weather Station" by Tim Bitson ISBN: 0-470-04046-7

http://www.weathertoys.net/weathertoys/main.html

which gave me a good understanding into how 1-wire works (I just love the elegant simplicity of the concept) and how to hack together some software to handle additional sensors etc.  It deals with multiple temperature sensors, so in some ways may help you, but there is also talk of other types of devices - e.g. humidity - which may be relevant too, and building a "website" to display the data, and so on.

You will have to run a wire to each location you want a sensor - that wire can daisy-chain from sensor to sensor, and/or use a Star layout (if there is no convenient route for a single cable to link each sensor).

You might want to consider handling the communication either wirelessly (which is expensive, certainly for 1-wire, probably also for others) or via adaptors that can plug into, and communicate over, the mains - such as the X10 protocol used for Home Automation (although I don't know if that can carry signals from sensors, or just remotely turn on/off light switches)

http://www.uk-automation.co.uk/article_info.php?articles_id=7
Logged
wookey
Hero Member
*****
Offline Offline

Posts: 2672


WWW
« Reply #7 on: October 05, 2008, 12:47:29 PM »

X10 is widely available but it's a crappy protocol (no 'acks' - you just send signals out on the wires and hope) and it's trying to get noticed in the little gap when the mains signals crosses zero volts which is tricky to get reliable. It does work, and is relatively cheap, but there are many much better solutions these days. The catch is that it's not yet really clear which are going to become widespread in the long term.

Check out KNX, Webbrick, C-bus, M-wave, Zibgee, idranet, 802.15.4, 433Mhz. Hardly any of them are quite cheap enough yet. Idranet is nice (cheap, sensible) if you don't mind windows-only and proprietary. Zigbee is great but target devices not yet widely available. Webbrick is flexible and uses open standards, but expensive. M-wave is new in europe (only just got a frequency allocated - popular in the US). Cheapest wireless stuff is 433Mhz device-specfic protocol as used by all those electricicty monitors, but there are no standards. Cheapest wired is 1-wire. KNX is interesting as it does both and is an ISO standard (get it from your library rather than pay them 100euro to read it), not sure about device availability though.

All in all this is what is known as an 'exciting' area: lots of competing protocols and huge potential but it's stull something for the rich and early adopters for the time being.

There are lots I haven't mentioned - it's all horribly complicated.
Logged

Wookey
hiccup
Sr. Member
****
Online Online

Posts: 284


« Reply #8 on: October 05, 2008, 01:06:33 PM »

Hi

Wookey mentioned Datanab for one-wire stuff...

You might also want to look at the Barix Barionet and X8 products. Datanab sell them in the US but there is a UK supplier. PM me for details.

The Barionet is a din rail mounted PIC based controller with a web interface (programmed in a sort of BASIC) and it knows how to talk to 1-wire temperature devices. It also talks modbus over RS485 and the X8 is a modbus node that can do a number of I/O things including 1-wire.

Kind regards

Hic!
Logged

16 x Sanyo HIT250E01 into SB4000TL inverter, 2 x 20 x 58mm Navi Tubes on 22deg roof facing SSE, Gledhill Torrent RE Solar 277litre Store, TDC4 Ether Controller, Xpelair Xcell400BP HRV, Stovax Riva 66 Wood Burner
KenB
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2691


Energy Self Enlightenment


WWW
« Reply #9 on: October 05, 2008, 01:12:14 PM »

Wyleu, Wookey, List,

"One Wire" has to be one of the biggest misnomers in the industry.  Especially when you need 3 wires to get it to work reliably. 

I prefer genuine "two-wire"  or telephone systems, using the two wires to supply power and bi-directional comms. Good old tried and tested technology.

My other favourite is "no-wire"  -   433MHz wireless is perfectly adequate for small amounts of data from remote sensors.  I was quite proud of my solar powered wireless compost heap temperature probe, that used a canibalised 433MHz door bell and a solar garden lamp as its principal components.

Whilst other systems exist, you are quite correct in saying that no real standards for protocols exist.

The other problem is overkill - do I really need a Zigbee  data link capable of 250kb/s, a thirsty 2.4GHz transceiver and  a microcontroller at either end capable of supporting the Zigbee stack, just to turn a light on and off?

Sometimes it's nice to keep things simple.



Ken





Logged
hiccup
Sr. Member
****
Online Online

Posts: 284


« Reply #10 on: October 05, 2008, 03:26:12 PM »

Yup - 1-wire refers to the data part but I won't hold that against the standard.

While it's true that getting 1-wire to work correctly over 2 wires (gnd + pwr/data) is marginally more difficult than 3 wires (gnd + pwr + data), it really comes down to reading the protocol documentation and following it exactly. Timing is critical as the device has to be able to steal power from the data signal. This is all done for you if you use the right host interface or controller.

Once it is working correctly, 1-wire is one of the most reliable systems out there. I've had dozens of sensors on a 2 wire chain exceeding 100m all working correctly.

I agree with KenB about keeping things simple, so I avoid all wireless systems (enough RF in the air as it is), and KNX/EIB is just not for enthusiasts unless they have deep pockets.

1-wire temperature measurement is both simple and accurate. Most of the other systems mentioned simply do not lend themselves to distributed temperature measurement the way that 1-wire does.

My only gripe with 1-wire is that there is a maximum 125C measurement limit on the standard devices. There are ways around this of course.

Kind regards

Hic!
Logged

16 x Sanyo HIT250E01 into SB4000TL inverter, 2 x 20 x 58mm Navi Tubes on 22deg roof facing SSE, Gledhill Torrent RE Solar 277litre Store, TDC4 Ether Controller, Xpelair Xcell400BP HRV, Stovax Riva 66 Wood Burner
wyleu
Guest
« Reply #11 on: October 05, 2008, 04:51:28 PM »

They all stink one way or another and they all have their advantages. The really important aspect is how you combine all this stuff into some coherent structure that makes the different delivering mechanisms an irrelevance. I've just put one-wire via OWFS onto a laptop and it just does it. As far as the control side goes it's another area of preference, X-10 is cheap enough to get you going but it's got failings, certainly, but I like the fact that you don't need to flood wire to place the control elements close to the appliances and it's as close to a possible hybrid system as your likely to get. Can't say I'm massively impressed by what low-energy bulbs seem to be able to do to it. Devices with a Wireless port are probably the nicest and most environmentally friendly ( open to debate of course Cheesy ), no mucking about with plugs/sockets/wires/holes/inwalls/infloors/insane implications of retro fitting wires. Zig Bee?.

I'm pretty agnostic as far as hardware goes, preferring to grant to the designer the justification of interface. ( In my case it's generally whatever I can get going followed by reconsideration based on the long term reliability).
What standards/protocols do you put down the two wires?,
 During 1982  we towed a 5 kilometre cable full of microphones around the North Sea to make some fairly interesting 3D pictures, and that stream pumped electricity down the line very much like on one wire. I was told they didn't like putting any form of DC down the stream and they got a more reliable system that way, so it's been argued for a fair while to get to the present level of uncertainty !

The real heart is an event loop that gathers all this stuff and chucks it at any app thats' interested enough to have expressed an interest. How tight that needs to be, and where it runs is very much a subject up for grabs. But linux on a laptop is at least something that can be done, so it's a good point to start. Personal I'm running things on www.debian.org Debian etch (etch is the current stable release.) It seems pretty stable if rather old fashioned.
If anyone has something that could be stuck into it, preferably via IP wih USB as second choice, then it's probably worthwhile to make the attempt. At the end of the day you need a mirrored scale somewhere to watch the results and the odds are that's going to be computerish.

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!