ds18b20 question

hi there i have a prodect coming up which i need to measure temp which i was going to use DS18B20 in parasitic mode (2 wire) but the only problen i can see is the cable lengh is going to be between 150 to 200m, even if i drop the pull up resistor is this going to work relabel? or am i going to have to us something like DS2482-100 which will give me a hard pull up?

any help will be appreciated
thanks Joe

Think you should read this one - Guidelines for Reliable Long Line 1-Wire Networks | Analog Devices -

There are several pointers to documents including handling long lines.

thanks for that link there is a lot of intersting things on there
I should be able to do 200m with out DS2482-100, just?
has anyone got any expereance using DS18B20 over 150 to 200m?

For comparison, I use a 2K pullup resistor with my ~100 meter system.

hi again
i have measure my cable run and it is just over 200m i have try 2k pull-up resistor and not luck

how low can i go? 1k?

If you can avoid parasite power it will be more tractable as you then have
a decoupling capacitor to stabilise things. Try 1k even. For parasite
power you must use active pullup in the driver as documented. Quality
shielded cable?

tried a 1k still not there :confused:

yes shielded cable CY

now i know you lot are going to say to avoid parasite power but the one problem may occur that the sensor may get damaged due to its location so the only thing that worries me is having a GND and 5v down there which get shorted together and cause damage to regulators and may be other components.
Unless anyone has a easy solution to limiting current or something?

50 ohm resistor in series with the power? let the decoupling capacitor at the sensor keep the rail stiff there. The fault current's limited to 100mA which is pretty safe (and easily detected)
The chip only takes a few mA I think.
Another protection issues with long signal cables outside is lightning - any wiring into a building should ideally have a ground-return route that can carry lightning induces currents
safely away to earth, preferably without starting any fires.

Beyond a certain range wireless comms becomes attractive, since you may save the
cost and risks of the cable completely, although there are other issues (you still need
power in some form!). WSN standard for wireless sensor network, and is a good search
term for such approaches.

ok thanks for that :slight_smile:

i would go wireless but if you saw the environment it is going into think we would just stick with just a temp sensor lol (hard to keep water out when it is being hit with 3000 psi of water)

well i tried it using 3 core to day and it does not work, just siting at 0.00, i am not using the 50 ohm resistor yet, i tried it with a 1k and 4.7k pull up resistor from 5v to the sensor pin

any idea?

thanks Joe

First things first... did you verify that your code and sensor works with a short wire? Don't even think about extending the wire until it works well with a short cable. (Sorry if this is obvious, but it wasn't mentioned whether it ever works.)

sorry i should have said, yes if i connect the sensor straight into the arduino it work fine

i did measure the voltage at the sensor (at the end of the cable) from 5v and GND and i got 4.9v so the supply voltage seem fine

Parasite mode should only be used when a small number of devices are used over relatively short distances.

http://openenergymonitor.org/emon/buildingblocks/DS18B20-temperature-sensing

FYI.
@pwillard,
Are you using parasitic mode or are you providing 5V to the device ?

pwillard:
For comparison, I use a 2K pullup resistor with my ~100 meter system.

always. :wink:

i was using parasitic mode but now i am spilling 5v

i have tried 2k and did not work :confused:

i was using parasitic mode but now i am spilling 5v

What, pray tell, does "spilling" mean. (aside from "spilling your drink...spilling milk, spilling blood...etc"

i was using parasitic mode but now i am supply 5v

i have tried 2k and did not work :confused: ?

This is where an oscilloscope would be very handy to see what the signals look like on both ends of the wire. That long wire has a lot of capacitance, and it tends to round off the edges of the signals by the time it gets to the end of the wire. This prevents the device from properly seeing the signals, and from properly sending back the response.

Joes:
I should be able to do 200m with out DS2482-100, just?

The key word in there is "just." You're just on the edge of whether it will work without a driver chip. How well it works will depend on a lot of variables: the quality of the wire and it's capacitance, the drive strength of your pull-up resistor, the amount of electrical noise in the area, and many other factors. If everything is ideal, you can get that range without a driver chip. If even one of those variables are less than ideal, you can have trouble.

You may want to consider using one of those driver chips - the main advantage is that they use active pull-ups to overcome the line capacitance - instead of just using a resistor to charge up the data line, it turns on a transistor to actively provide a shot of pore to bring up the data line voltage quickly.

hi ShapeShifter thanks for your reply

i can get me hands on a oscilloscope so i well do that and have a look and let you lot no what i see.

well to day i have played with difference resistors and moving them down to the sensor and no different :/.

this cable will be ran with a lot of other cables lot of them being 3phase so to make this relable it mite be better to us a driver chips now.
what are we looking at for a drive chip, DS2482?

thanks all for your help so far

Joes:
i can get me hands on a oscilloscope so i well do that and have a look and let you lot no what i see.

It would be interesting seeing three sets of data:

  • Power and data when using a short wire
  • Power and data and the processor end of a long wire
  • Power and data at the sensor end of a long wire

For each case, while it's most important to see what the data is doing, it would also be interesting to see if there is any noise or undue loading of the power supply during a complete measurement/data transfer sequence.

The first case gives a baseline of what things would look like under ideal conditions. This can then be compared to the second and third cases to see what the long wires are doing. My guess is that you will see nice square pulses for the first case, but they will be very rounded humps at the end of the long wire. Look at the datasheet for the sensor, and there will be a timing diagram that shows various pulse widths and rise times -- compare what you are seeing on the scope to the requirements on the datasheet.

what are we looking at for a drive chip, DS2482?

That seems to be the most common solution, but I don't have any personal experience with any of the driver chips. (But I do have some experience trying to drive signals down long wires and the kind of distortions that can happen.)

well here we go

5v power red is at the arduino end and yellow is at the ds18b20:

ds18b20 straight into the arduino:

red is at the arduino end and yellow is at the ds18b20 after the cable run


well tell me what you think? i presume the 5v is fine, and the ds18b20 straight into the arduino is how it should look like and adding the cable run sends it all over the place?

any one got any info on a chip drive with arduino?