Shop OBEX P1 Docs P2 Docs Learn Events
1-wire — Parallax Forums

1-wire

Lars50Lars50 Posts: 23
edited 2008-01-17 22:02 in BASIC Stamp
I'm interested if somebody in this forum have experinced circuits with multiple 1-wire devices. I have since years used multiple SS18S20 (8 of them) with a Stamp 2p. The pull up resistor has not been at 4,7 K closer to 700 ohm. Now adding 6 more sensors I using a adj resistor (10 rev) and manage to get all sensor to work but not in stable conditions, pull up resistance about 300 ohm. I can fine tune the pull up to work, but suddenly it drops out and reading either 0 or 32 (I'm on celsius).

Long cables?, about 30 meter in total, 2 junction boxes in serie with 5 plus 9 sensors (cable length from 1/2 meter to 2 meters).

It could be many sources causing issues, the adj resistor is mounted on the test pad on a Stamp in class (I thinks its called so) but the rest is RJ12 plugs and circuit boards. everyting works when I reduce the number of sensors, so no short cut etc.

I appreciate some advice if somebody had any experince that could help me out here.

Lars

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-13 22:13
    The pullup value is too low. Have a look at Maxim/Dallas's website for application notes on 1-wire networks. I don't have the link handy, but they do go into detail on picking the proper pullup value and different configurations for networks. As I recall, 30 meters is not a very long cable. They talk about networks with 100s of meters of cable and large numbers of sensors (8 is small). I've used 12-16 1-wire switches plus another 8 button-type 1-wire time-keeping devices with a BS2p with a short (2 meter) twisted pair cable with no problems other than things slowing down as more devices had to be identified.

    Remember that these devices can be used in large buildings for thermostats where there may be a device in each room and cables extending throughout the building.
  • Lars50Lars50 Posts: 23
    edited 2008-01-13 23:16
    Thanks' I know the 4,7 K recommendation from Maxim and others, I get the thing working rigth now and I have less than 300 ohm pull-up. If I go for what is recommended the system is dead. So cables, can that be the issue, I'm using 0,14 mm2 unshieled LiYY control wire. Attached is a sketch showing the wiring. Could the cable resistance be too large, or why doesn't a 4,7 K pull up work?
  • FranklinFranklin Posts: 4,747
    edited 2008-01-13 23:36
    Found this, it might help www.maxim-ic.com/appnotes.cfm/an_pk/162

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Tracy AllenTracy Allen Posts: 6,667
    edited 2008-01-14 07:21
    Do you have an oscilloscope? It might be an immense help to resolve what is happening to the signal.

    If the cable capacitance is 150 pF per meter, then 30 meters would have around 0.005 µF. And with a 1k pullup, the RC constant would be around 5 microseconds. That compares with around 60 or 100 microseconds for the pulse events in the one-wire protocol. On the 'scope the signal should have good amplitude (~5 volts) and sharp falling edges, and around 5 microseconds on the rising (RC) edges.

    Are you by any chance trying to use the parasite power mode?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Lars50Lars50 Posts: 23
    edited 2008-01-14 22:26
    Hi and thanks'

    No unfortenately I do not oscilloscope, neither tried the parasite mode.

    I need to ask·a question, I'm using the VDD for both power to the DS1820 and Vpu, I have assumed that is the concept.

    About the cable, LiYY is an inexpensive standard cable, also used in Industrial applications. You meantion about capacitance of the cable and I trust you might be right but when Maxim talkes about 100m of cable length they don't say anything about this factor and they also specify a pull up of 4.7K. When I got everything to work (but not stable) I have only like 170 ohms. With 6 sensors I was at 700ohms. Is this where to look for the problem? Or is it normal that the pull up needs to adjusted downwards?
  • Tracy AllenTracy Allen Posts: 6,667
    edited 2008-01-15 07:39
    I feel there must be unplanned resistance or capacitance somewhere in the circuit. It might be a partial short circuit in one of the connectors or the sensor wiring that is loading down the system. Do you have a multimeter, something that would allow you to measure voltage on the sensor lines when idle and when the Stamp pulls it low? When idle, the voltage on both sides of the 170 ohms should be Vdd=5V. When the Stamp pin is low, it will not be at zero volts, because it will have some trouble pulling down against the 170 ohm resistor. Problems could also be caused by high resistance through the connectors, which could be measured with a voltmeter and ohmmeter. All the sensors have a good ground connection, right? It is also possible to use the Stamp itself to measure some things, for example, RCTIME can be used to measure the actual capacitance of the cable. However, a good voltmeter might help resolve the problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Lars50Lars50 Posts: 23
    edited 2008-01-17 22:02
    Tracy

    Just home from some travel abroad, so I havn't had time to check for any answers.

    I will try to do what you suggest, I measured the voltage previous and had 4,92V on VDD at the stamp, the voltage at the data was only half but I didn't continue as I wasn't what I was measuring. All sensors are grounded, I have played around to see if there was one or more sensors causing the issues but could not find any pattern. The low resistance pull actually occured already when having 4·sensors, at time I was at 700 ohm and installed a variable resitor to simplify tuning. The systems contains of two PCBs, both carefully checked for short cuts, connectorsI'm using RJ12 and using only 3 pins. When you say idle and stamp pin low, could you please describe what the conditions should be. I would assume that is a program pause for both cases?



    Thanks again for your support.

    Lars
Sign In or Register to comment.