Extending 1Wire
Hi Derek/Brett,
Ran into another problem today while extending my 1wire sensor 'array'.
I got 2 running no problem, set up my pachube and data started flowing. Later, I added another and my readings all turned to "?".
To give you some more info...I purchased some stereo, 3.5mm jack extension cables...after checking prices etc it seems you only save a £1 or 2 by making the cables yourself. I've added a 5m cable for the second sensor split immediately after the livebox using a stero cable splitter like the one in your picture. One of those splits was then split again using the splitter device sent with the sensors, into that I plugged 1 more sensor and a 10m extension cable terminating at another sensor.
After moving the location of sensor 2(it was in direct sunlight), I then went to check the readings. All read "?"
XFX msgs report the same.
I have tried to disconnect and revert back to 2.. no effect, I even tried going back to 1...no effect. Don't think I've shorted anything, the only thing I can think off is the temp of the box? I know Derek said he has no problems with his but mine is upstairs in the loft(no vents), only a couple of fans running(set by temp sensor) and it's sitting on quite a hot Dell switch. Temp at the box get's upto about 37c.
Weird how it just 'went' though.
** Edit **
I should also have added that at "almost" the same time I added 3 more RF modules. Not the S variety but the W ones.
This seems to have been part of the issue. Sometime later in the eveinging, with everything being so hot, I had to shift things(one of the fans in the loft) around a bit. When I removed one of the RF modules(one that's been running for a week or so), the temps(all but one of the 3 connected came back initially, after a reboot, all 3 came back).
So I decided to unpolug one of the new RF modules which has been turning on & off on it's own since I installed it.
I've probably tried to do too much at onse. Tomorrow, I'll remove all the new RF entries I've put in and try and get the 1wire stuff going. Then move from there in a more methodical approach.
>In the ini file it says you can register upto 12 channels, I assume that equates to 6 RF modules?
Just checked with Brett (and the source code). You can specify control strings for upto 12 RF modules (an 'on' and an 'off' hex string for each).
Brett has rolled a new version of the HAH firmware, that will allow RF units > number 4 to be controlled directly via the web UI. This is currently in beta test.
Derek.
My permanent 1-wire setup has one sensor within 1m of the HAH and another at the end of a 5m extension cable. This seems totally reliable.
I must chat with Brett re the '?'s that you are seeing on the UI and the exact circumstances that cause these to be shown. Then, I must also go try a 'long run' of the 1-wire - easily done as I've got lots of the 3.5mm extension cables.
It's quite possible that the 5V supply is being stresssed. I also note that it's pretty damn warm at your location just now. I can easily replicate this with a fan heater.
Some of this is as much an art as a science.
I'll keep you advised of progress.
I'm also thinking that in many cases, rather than having the fuss of a long cable run, it might be smarter to implement a decoder for a commonly available RF temperature module. These are relatively cheap and much easier to deploy. Yet another reason to press on with the RF receiver capability for the HAH.
Reading up more on how to get the best out of 1-Wire. Lots of docs on this topic e.g. ftp://ftp.elin.ru/pdf/1-Wire/app108.pdf
So many things that need to be done better than we currently do. The long cable on the 1-Wire is indeed causing the micro to hang - that's why even the Inputs report as '?'. Might well be down to the 5V rail suffering.
So, an active pullup/a resistor in-line may well be the way to go. I'm also thinking that Cat5 cable (with its twisted pairs) might be a lot better than the 3.5mm jack cables. A bit more work to wire up, but it's reliability that we are looking for.
I'll be looking at the bus with my 'scope next weekend to get a better understanding of what is actually going on.
Also found this interesting document http://arduinoha.googlecode.com/issues/attachment?aid=1809249904413282613&name=wmr928-weijenberg.pdf&token=801df2db0837c15865335ae5a3a65a34
You are expanding the boundaries of the project with your experimentation on 1-Wire. Keep up the good work.
I'm not sure if this is of any use, but some of the posts in this thread refer to all the things you guys have been talking about, http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238032295.
I'm trying to get a 1wire device working on my Arduino with Bretts code. My code works fine on it's own, as does Bretts, but when I bring them together it stops working, so I've been looking for a solution. Hope it helps.
I do recall we made a decision not drive the 1wire devices parasytically due to power loss issues, as the data pin is also the power pin. I think possibly it has more to do with shielding and interferance picked on the wire.
Use cat5 or shielded cable for the run would get better quality. Most 3.5 jack extension cables are simply parallel paired wires, not the best. Occasionaly you can find good quality coax (shielded) cable, this would be better as the data and power pairs would be wrapped in a ground sheath.
The arduino notes are interesting thou. With the work that I've just finished on the arduino with xAP/Ethernet plugging in a 1-wire sensor and sending data should be trivial if you want to think about this approach for a standalone sensor.
http://www.dbzoo.com/livebox/hah_arduino
Perhaps Derek can put together a 1-wire xAP Arduino app (hint hint).
I was working on this last night, basing it on your latest code. But whenever I introduce the 1wire coding, it just stops working. I started again using some different 1wire libraries and got a bit further, but still miles from where I want to be. I can test and trouble shoot quite well, but it's about 20 years since I coded so I'm learning this as I go along, it's just slow, not to mention the late night taking their toll. I could e-mail it to, as long as you promise not to laugh, I'd like to be able to do this myself really, but some constructive feedback would probably help.
I'm also tempted by the idea of a 'standalone' temperature sensor. However, having a whole Arduino with Ethernet shield just to get a temp reading seems a bit of overkill. I see a serial-bridge Arduino connected directly to the HAH as a good way to beef up 'in HAH' capability, and the Ethernet Shield UDP capable Arduino as a way to add a whole new xAP enabled, remote, subsystem that can leverage the Plugboard in the HAH.
My thinking on the way ahead on this is in three workstreams.
First is to have a look at what state the 1-Wire signal looks like as the bus coming out the HAH (made from the 3.5mm cables) is extended. Also try tweaking down the value of the 1-Wire pullup resistor. I will 'scope this & put up some pictures.
Second is to try using UTP cable runs. From reading all the notes re 1-Wire, this should help.
Third (and much harder) is to decode the RF signal from the Oregon Scientific 433MHz RF wireless sensors. These are pretty inexpensive and have a decent range. I already have code that reliably decodes the RF signals from a BBSB transmitter.
... and thanks to Brett for all his good Arduino work, as well as the hint!
Well my next project is to get a universal transmitter working on the arduino so that you can send it an xAP packet that will define the RF pulse train you want to transmit.
This will then allow the HAH to control ANY RF capable device.
Once I get that sorted (insert laugh here) I'll work on a RF decoder (more laugher).
This is a long read, and I'm sure Derek has probably read this, or at least something like it, but it might be of use
http://www.1wire.org/Files/Articles/1-Wire-Design Guide v1.0.pdf
Well, I have done a bundle of reading. Turns out that for a 'long' 1-wire runs, driving the bus directly from a microcontroller pin (with external pullup resistor) isn't really sufficient. So, I used the 'master driver' reference design on Pg 64 of this document http://www.1wire.org/Files/Articles/1-Wire-Design%20Guide%20v1.0.pdf and the 'slave passthru' design on the top of page 65 to produce this PCB design http://www.flickr.com/photos/kenned/5007289299/
This board can be populated to work as a master or a slave.
Sourcing the ferrite chip component for the slave was tricky, but I eventually got these from a guy in LA (the surface mount parts are truly tiny).
I included a USB B style socket to allow optional 5V power injection.
Before going to fab with this design, I need to add mounting holes to the board & cross check the dimensions against a few suitable enclosures.
Yes! This is THE document when it comes to being thorough with 1-Wire.
I did base my latest design on a thorough read of all this (see post above). The wiring standard for the RJ45s is that published here http://www.hobby-boards.com/catalog/howto_wiring_diagram.php?referer=how... is what I used on the PCB design.
I will add solder pads to allow folks who wish to keep using the 3.5mm stereo jacks to simply solder on a socket at the master end.
Yes, easy to refit. The Master end could just be placed in an enclosure & connect to the existing 3.5mm stereo jack socket on the side of the HAH. Re dismantelling, if you are using the external master driver, you would want to leave R7 on the main PCB unpopulated (as the Master circuit will have its own, better, arrangement).
Of course, wiring to slaves DS18b20s will be via Cat5 and not stereo cables.
All this is awaiting PCB fab & some decent testing.
Hi Derek,
If there have been some further developments or clarification ;) regarding the PCB/solution you designed?
I have managed to get three sensors running over ca 15m Cat5 socket to panel segment + ca 2m patches but beyond this it seems difficult. From hah board to patch it is also your supplied 20cm cable with Cat5 socket. E.g. when connecting next segment and powering up hah one even sees some random chars on lcd. At same time the cabling is properly tested and able to run 1Gb. Have also tried parasite power supply, measured power drop in the end of cable to be insignificant etc. Will go for shottky diodes today to see if they can help me ..
Also if there are good ideas regarding how to use 1wire with "normal" in place Cat5 cabling that by nature physically is star-like whereas 1wire design guide says that "do not use network like this!" :| ?
---- Edited ----
Tried shottky diodes at sensors (ground to data), this did not help for current issues.
Had a short mail conversation with Derek today and heard two more suggestions that I tried:
- used external power to sensors, this did not help either
- used smaller pullup resistor, far away from controller .. and this indeed did help!
In fact, as I had two "branches" I removed 4k7 resistor from hah board and used two 2k7 resistors in end of both branches. These resistors are in parallel so it makes ca 1.35 kohm pullup.
Later added two more sensors without pullups in two extra rooms and two more next to first two, six in total (all I have planned for home use). And it still works - no signs of "overloading" hah board as before!
Working setup: 1wire network over existing Cat5 cabling, four segments in star connection, six sensors, pullup resistor ca 1.35 kohm, 17 to 24m network segments, total ca 85 of used cable lenght.
Regards,
Aivo
Hello Aivo
Yes I’ve found adjusting the pull up resistor is crucial to getting long runs to work - as is selecting the right conductors within the cat 5 run - avoid using more conductors than necessary - and leave the unused ones floating - the real killer on long runs in the capacitance in the cable - the pdf mentioned earlier in this tread is very informative..
http://www.1wire.org/Files/Articles/1-Wire-Design Guide v1.0.pdf
and a must read if you trying to get long runs to work, and if you have access to an oscilloscope, it will help in selecting the pull-up resistor value.
Cheers
Harry
Box running at 37C should be OK (that said, I now run mine in the basement where background temp is generally a constant 16C).
There should be no relation between RF devices and 1-wire operation.
It's more likely that there is a wiring issue on the 1-wire array. Some of the 3.5mm stereo cables are very cheaply made & don't use decent connectors. If you have a can of servisol switch cleaner to hand, try a little of this on the 3.5mm contacts. Don't 'hot plug' the 1-wire devices. Wire up everything with power off. Perhaps just try one device at the end of your 10m cable to see how this goes.
It would be interesting to know what voltage there is at the end of this 10m cable. The 1-wire devices really like to have a solid 5VDC. If you have a multimeter handy, you might want to check this - but for goodness sake don't short out the 5V line when taking a reading - doing so will trash your Livebox!
Also, read this appnote from Maxim re running reliable 1-wire busses. http://www.maxim-ic.com/app-notes/index.mvp/id/148