Pin connection for DS18S20

yds

New Member
Can someone tell me what the pin connections are for the DS18S20 temp sensor connection to 1-wire network? I am guessing that pin 2 (the middle pin) connects to the data line, and pin 1(power) and 3(ground) both connect to the ground line. Is this correct?
 
Can someone tell me what the pin connections are for the DS18S20 temp sensor connection to 1-wire network? I am guessing that pin 2 (the middle pin) connects to the data line, and pin 1(power) and 3(ground) both connect to the ground line. Is this correct?

That is correct.

Eric
 
In parasite mode (pin 3 connected to gnd), I think only one sensor at a time can be doing a temperature conversion and nothing else can be happening on the bus.

To quote from the spec sheet:
"The DS18S20 can also be powered by the conventional method of connecting an external power supply to
the VDD pin, as shown in Figure 5. The advantage of this method is that the MOSFET pullup is not
required, and the 1-Wire bus is free to carry other traffic during the temperature conversion time."

If you have multiple sensors, you'd have to wait for each one to finish the conversion and read it before you can go on to the next one. It takes about a second to fully process each sensor.

If you have a lot of sensors and/or are reading them often, then consider using powered mode.
In powered mode (pin 3 connected to vdd, typically +5v), you can send a Convert T to all the sensors, then go back and read them.
 
Does anyone know what happens when one is running the sensor in parasite mode (no +5V on the sensor network), but one forgets to connect pin 3 to ground? Are the sensors going to mostly work, or be a little unreliable, or am I looking at a desaster?

I just discovered last night that I've been consistently wiring my sensors wrong, leaving pin 3 NC or not connected. The sensors are a mix of DS18S20 and DS1822; unfortunately, not the -PAR models which are designed for parasitic operation. And even more unfortunately, about a dozen sensors are buried deeply in the house and in the attic, and I can't get to them without major construction work.

The interesting thing is: Using a DS9490 = DS2490 USB adapter, and the OneWireViewer application on a Windows laptop, all sensors are reachable and readable. I've been trying to read them using a Soekris embedded PC running OpenBSD, and using a DS9490 I can get to some of them, but not all of them; driving them directly of a parallel (GPIO) port has not worked at all, but I think that there are software issues here.

If someone has experience with 1-wire sensors with forgotten ground pins, let me know how bad it is.
 
Does anyone know what happens when one is running the sensor in parasite mode (no +5V on the sensor network), but one forgets to connect pin 3 to ground? Are the sensors going to mostly work, or be a little unreliable, or am I looking at a desaster?
Sometimes they'll be fine. Sometimes you won't be able to see them. Sometimes you'll get 85*C readings. Sometimes it depends on the cabling. Sometimes it depends on the weather. The spec sheet says VDD must be connected to ground for parasite mode. Looking at the block diagram, connecting VDD to ground indicates to the power supply sense that the parasite power circuit should be activated and it should steal power from DQ instead of using VDD. If ground is left floating it could randomly confuse the power sense and that's when you'd have problems. The worst thing that could happen is that some sensor could get stuck and busy out the bus until its reset.

I just discovered last night that I've been consistently wiring my sensors wrong, leaving pin 3 NC or not connected. The sensors are a mix of DS18S20 and DS1822; unfortunately, not the -PAR models which are designed for parasitic operation. And even more unfortunately, about a dozen sensors are buried deeply in the house and in the attic, and I can't get to them without major construction work.
Break out the sawzall. You'll eventually need access to your sensors for replacement, testing, etc.

Are these sensors on a straight bus, or did you get creative and use a star or some other non-conformist topology?

Out of curiosity, where are all these sensors and what are you trying to measure?

The interesting thing is: Using a DS9490 = DS2490 USB adapter, and the OneWireViewer application on a Windows laptop, all sensors are reachable and readable. I've been trying to read them using a Soekris embedded PC running OpenBSD, and using a DS9490 I can get to some of them, but not all of them; driving them directly of a parallel (GPIO) port has not worked at all, but I think that there are software issues here.
Obviously its OK, for now, using Windows. Maybe a driver or timing issue with OpenBSD or the hardware? Any pattern to which sensors you can or can't read?
 
Sometimes they'll be fine. Sometimes you won't be able to see them. Sometimes you'll get 85*C readings. Sometimes it depends on the cabling. Sometimes it depends on the weather. The spec sheet says VDD must be connected to ground for parasite mode. Looking at the block diagram, connecting VDD to ground indicates to the power supply sense that the parasite power circuit should be activated and it should steal power from DQ instead of using VDD. If ground is left floating it could randomly confuse the power sense and that's when you'd have problems. The worst thing that could happen is that some sensor could get stuck and busy out the bus until its reset.
One would hope that the good folks at Dallas (who usually are VERY smart) would have put a pulldown resistor on the Vdd pin, so if left unconnected by mistake, it defaults to ground.

In my case, the Vdd pin is clipped off as short as possible, and the little leftover stub insulated with heat shrink. The DQ pin (which is right next to it) is also insulated with heat shrink. So high-resistance or capacity crosstalk between DQ and Vdd should be very very small - better than on a PC board.

Break out the sawzall. You'll eventually need access to your sensors for replacement, testing, etc.
I hope not. In particular, one set of them is not reachable without MAJOR surgery (I'll explain below why). Fortunately, that set is backed up by thermocouples, but those are not connected to any sensors, they just come to an outlet box; the intent had been to use the thermocouples to occasionally manually calibrate the Dallas sensors.

Are these sensors on a straight bus, or did you get creative and use a star or some other non-conformist topology?
Between 4 and 6 of them on a nearly straight bus. By "nearly straight" I mean that each sensor is soldered to a stub of wire, between a few inches and a foot long, which then merges into the bus. For most of the groups, the cabling used is Cat5 or Cat6, with the stubs being individual pairs pulled out of that cable. I know that unshielded twisted pair is not optimal for one-wire, but it seems to work great. For one set of sensors, the wiring is shielded twisted instrumentation cable (that run is in the attic, where exposed Cat5 might not survive). And the other pairs in the Cat5 cable are either unused or used for other 1-wire sensors, so no Ethernet and 1-wire in the same Cat5.

Out of curiosity, where are all these sensors and what are you trying to measure?
Normal house instrumentation. One set is in the attic: I was wondering how much difference installing two attic fans would make, so I added 7 fans to the attic: one each on the air inlet (north and south side of the house, and exterior temperature on the two sides can vary by 20 degrees on sunny days, depending on the wind), one each right at the attic fan to measure the temperature of the air being blown out, one pair at the top and bottom of the attic (right under the roof sheeting and right on top of the insulation that separates it from living space), and finally one in the living space, right underneath the ceiling drywall. This set is wired using instrumentation cable, and is a pretty long run (about 80 feet total).

Another set is in the basement, for the various rooms, a few around the wine cellar. Uses Cat5. Boring.

And the last set is on the inside of an underground exterior basement wall. I have a wine cellar in the basement, which is just a small corner room that is exquisitely well insulated, with ridiculously many inches of high-R foam insulation. The interesting question is: what is the soil temperature, at various depths. To measure it, I attached 4 sensors to the exterior concrete, spaced from bottom to top, backed up by two thermocouples. To get to these sensors from the inside, one has to dig through: 1/2" drywall,
1/2" plywood that was used to flatten out the wall before drywalling, a 2x4 stud wall with all the bays solidly filled with foam sheet insulation, with the edges of the sheets sealed with spray foam, and then a 2" solid uninterrupted layer of sheet foam. Meaning the sensors are in there for good, wired wrong or not.

All other sensors could be replaced and rewired, but it would take hours and hours of work (the ones in the attic took about 3 hours to install, because the attic is so narrow and cramped that just moving around is a chore).

By the way, watching soil temperature at the surface and up to 8' down is interesting. At the top you see obvious daily cycles, and the effect of sunshine or cold storms. In the middle you see a little daily variation, some annual cycles, and influence from rain (water coming down the soil brings hot or cold with it). At the bottom, it is nearly perfectly steady, with a very small and delayed annual cycle. The end goal is to record and graph it, because just studying it is interesting; not for any particular purpose (curiosity killed the cat).

The interesting thing is: Using a DS9490 = DS2490 USB adapter, and the OneWireViewer application on a Windows laptop, all sensors are reachable and readable. I've been trying to read them using a Soekris embedded PC running OpenBSD, and using a DS9490 I can get to some of them, but not all of them; driving them directly of a parallel (GPIO) port has not worked at all, but I think that there are software issues here.
Obviously its OK, for now, using Windows. Maybe a driver or timing issue with OpenBSD or the hardware? Any pattern to which sensors you can or can't read?
No pattern. The sensors are a mix of 18B20 and 1822. There is only one string that can be read from OpnBSD, and those are the four buried deeply in the wine cellar wall (phew). They happen to all be 18B20's.

The scary thing is: I can create a trivially short "sensor string", using a single 18B20 and a 4" long cable. That string is not readable from OpenBSD on the Soekris, with neither the DS9490 USB adapter nor with a parallel port! But it works fine from a Windows laptop. Over Christmas, I'll install OpenBSD on the Windows laptop, to see whether the problem follows the USB port hardware or the operating system.
 
Back
Top