Read Temp DS18b20 Parasitic Mode

Lt2mc

Member
hey All,
Just a quick question, I could not find the answer to in this forum. Does the ReadTemp function in a 28x2 work with a parasitic DS18B20-par?

I have finally used the last of my Stashed DS 18b temperature sensors, and I am now forced into switching over to the newer DS18b20-par sensors. Before I start gutting out my home made shields, to accommodate a different type of sensor. I want to make sure I am not missing anything.
Thanks for the time
 

Lt2mc

Member
Thanks technical,
I just ordered 10ea from the store, and will play with the owin command till they get here.
I guess the DS18B going 0- stock and obsolete is not as bad as I thought.
 

AllyCat

Senior Member
Hi,

But I'm not sure it can be used in parasitic mode ? From the on-line Command Reference :

"The readtemp command is not designed to be used with parasitically powered DS18B20 sensors (DS18B20-PAR) as the 5V pin of the sensor must always be connected. "

Or perhaps this comment from the OWOUT Command Reference is relevant ? :

"Some devices, such as the DS18B20 temperature sensor, may require a strong pullup after a byte is written."

Also, the data sheet in the Store appears to be a "404 Not found", but the Maxim (?) data sheet appears to indicate that a "special" (FET) drive circuit is required at the "host".

Cheers, Alan.
 
Last edited:

inglewoodpete

Senior Member
I dedicated many hours trying to get a PICAXE-hosted DS18B20 to work as a true 1-wire (+ground) a few years ago without success. I could never charge the remote capacitor enough to complete the return data transfer. Note that I was just using a PIC (PICAXE) as the line driver and did not try to use a low impedence driver to charge the capacitor(s). In the end, it was easier to use 3-wire circuit (Ground+Power+Data).
 

neiltechspec

Senior Member
You didn't leave it long enough between reads.

I have been using one over two wires (25m ish) for years, with a diode & .047F capacitor. About 5 seconds between reads.
Just has the 4K7 pullup on on the PICAXE.

I only had two wires left in the Cat5.
 

Aries

New Member
I only had two wires left in the Cat5.
I was in a similar position when I replaced the room thermostats with Picaxe-based ones. The bathroom temperature sensor was already wired with 2-core cable, so I used Neil's approach and it has worked flawlessly - admittedly not for 25 years yet.
 

rq3

Senior Member
I was in a similar position when I replaced the room thermostats with Picaxe-based ones. The bathroom temperature sensor was already wired with 2-core cable, so I used Neil's approach and it has worked flawlessly - admittedly not for 25 years yet.
I think Neil was referring to 25 meters, not 25 years, although Picaxe is getting there! And the internal Picaxe pullups are nowhere near 4.7K! From memory, anywhere between 30K and 300K.
 

Lt2mc

Member
Thanks everyone for the input. after a few tweaks to the OWIN command sample from the manual, i was able to get the ds18 working, albeit with a large offset of -85c over the raw value. In non-parisitic Mode using READTEMP the other DS18s were accurate to +/-1c roughly. The device now also seems hyper sensitive to temperature changes, which is not too much of a problem since I am using it essentially as an adjustable temperature switch on a heat sink. As for the circuit, I used a 4.7k between the data leg and 5v. and tied the device ground and power legs together.
 

AllyCat

Senior Member
Hi,
..., with a diode & .047F capacitor
Is that a 0.047 Farads Supercap (i.e. 47,000 uF) ? And where does the diode go? Normally the diode(s) inside the 18B20 would be sufficient.

IMHO, you've just created a "Local" auxiliary power supply rail, not running the 18B20 in the "intended" Parasitic mode.
...i was able to get the ds18 working, albeit with a large offset of -85c over the raw value. .. The device now also seems hyper sensitive to temperature changes, ....
IMHO that is not "working" (with an unexplained offset and sensitivity). Note that the resolution of the (PICaxe) READTEMP command is only 1 degree C, whilst the native resolution of the 18B20 is equivalent to the READTEMP12 command, with a resolution of 0.0625 degrees (per bit). It's that "12 bit" data which I would expect to read via the OWIN/OUT commands, and also where the "sign" bit is located.

Cheers, Alan.
 

neiltechspec

Senior Member
Yes, it is a .047F.
It's just a simple method of running a DS18B20+ over two wires when that's what's left in the cable.

25 metres was a wild estimate, it's actually nearer 18 metres.
 
Top