Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Getting inconsistent results on 1 wire Pi Plus

The 1 Wire Pi Plus and 1 Wire Pi Zero are a 1 Wire interface for the Raspberry Pi

01/11/2016

Posted by:
sam

sam Avatar

I am using the 1 wire pi plus board to connect fifteen DS18B20 sensors to pi using a Cat5 cable with 50m long wiring. I have followed the instructions to Install OWFS and Python-OW from your website and made the connections as below. One twisted pair is used for GND and DQ and one single wire rom another pair is used for VDD. Rest of the wires in the cable are not used.VDD from each sensor is connected to 5V on the board using a single wire from one of the twisted pairs.GND from each sensor is connected to GND on the board using one of the wires from the twisted pairDQ from each sensor is connected to OW on the board using the other wire from the same twisted pairBut when I run the Python script I am getting inconsistent results. some times it reads all the 15 sensors, some times it reads only few sensors and sometimes it does not read any sensors.Can you adise on whats wrong?

01/11/2016

Posted by:
andrew

andrew Avatar

The problem could be that not enough power is getting to all of the sensors on the bus which is causing inconsistent communication. It is probably a combination of the cable length and the number of devices on the bus.

One possible solution to this is shown in the datasheet for the DS2482 chip which we use on the 1 Wire Pi Plus. You can add an external P-channel MOSFET and a current limiting resistor onto the 1-wire bus to increase the pull-up current. The MOSFET will need to be driven from the PCTLZ pin on the DS2482 which is pin 6. This pin is not connected to anything on the 1 Wire Pi Plus so you will need to solder a wire from the chip to the MOSFET. The datasheet goes into more detail on how to wire up the MOSFET and configure it.

01/11/2016

Posted by:
andrew

andrew Avatar

Having done a bit more research into the problem you may not need an external MOSFET. The DS2482 includes a configuration option for an internal active pullup which is recommended for cable lengths of more than 10m. There are more details about the configuration options on page 5 of the DS2482 datasheet. I am trying to find out how you change the configuration register within OWFS, once I have found a solution I will post it here.

01/11/2016

Posted by:
andrew

andrew Avatar

After digging through the source code for owfs I think I have found how to activate the internal pullups on the DS2482. If you are using owfs then you can use the command option --ActivePullUp to enable the pull-up resistor.

owfs --debug --ActivePullUp --i2c=ALL:ALL /mnt/owfs/

I have tried adding the line "activepullup" to /etc/owfs.conf and it did not error when the Raspberry Pi booted so I think that may work as well for setting the pull-up active.

Hopefully, this will fix the problems you are having.

01/11/2016

Posted by:
sam

sam Avatar

Thanks for your reply. I have added the line as seen below. is this correct?I did not see any difference after adding the line so want to make sure this is the correct way to add the line.forum image

01/11/2016

Posted by:
andrew

andrew Avatar

If you are using the owfs.conf then you should just need to add:

activepullup

Put this below allow_other in place of the line you have entered.

If this doesn't work then it may be worth posting a support request on the owfs support forums to see if any of the developers know how to enable the active pullups in owfs. The man pages for owfs do not make any mention of the activepullup option and I could only find it in the source code for owfs so the developers may know more about how to get it working.

02/11/2016

Posted by:
sam

sam Avatar

Thanks for your prompt reply. Before doing further investigation I would like to seek your advise on the wiring.is it worth trying with two twisted pairs of the cat5 cable "data & ground using one twisted pair and power & ground using a second twisted pair? currently I am using one twisted pair for data & ground and a single wire from another twisted pair for powerIs it worth trying a simple three core cable instead of a cat5?there are 45 joints on the total cable lenth(3 for each sensor).How about soldering all these joints. will this help?thanks

02/11/2016

Posted by:
andrew

andrew Avatar

It may be worth trying both twisted pairs with the ground connected to two wires, which should reduce the amount of noise on the cable and increase the current capacity of the ground line.

Soldering the cables will also help as the inconsistent results you are getting could be caused by a bad connection between the wires and sensors.

29/12/2016

Posted by:
sam

sam Avatar

1> The above has been tested for 24 sensors over 65m of cat5 cable has worked reliablly and consistantly. After adding 10 more sensors and 15m more cable to the bus it stopped working. So i just tried disconnecting the Vdd wire from the pi and it started working and detecting all sensors. This is now in parasitic mode and it potentially contradicts the information that parasitic mode is not suitable for longer cable lengths(not defined). do you recommend using parasitic mode?2> Can a sheilded twisted pair cable be used as in coil configuration as shipped. this was in a bench test mode

29/12/2016

Posted by:
andrew

andrew Avatar

If parasitic mode is working for your project then it is probably best to keep using that.I am not sure what the effects of using twisted pair in a coil configuration would be as I haven't personally tried it but you would basically be making a large inductor so if it works when coiled it should work once you lay the sensors out in a line.

Sign in to post your reply


Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout