DS18B20 Parasite power

manuka

Senior Member
That mode is intended to rob a few driving mA from the serial lines of a connected PC. Since you'd need to power up a reading Picaxe anyway, there's really not much point in having a PC on the side as well- better to just run the lot off a few AA cells! See perhaps <A href='http://www.picaxe.orcon.net.nz/datds08m.jpg ' Target=_Blank>External Web Link</a>.Many Picaxe/DS18B20 setups are designed for readings over lengthy periods &amp; outdoors etc too, &amp; only are connected to a PC when the data is finally gathered &amp; ready to crunch.
 

steliosm

Senior Member
I just want to avoid having to pull a third wire to the sensor. 2 wires looks very good solution when it comes to put the sensores a quite a few feets away from the PicAxe.

 

Michael 2727

Senior Member
You could try the Dallas/Maxim web site and go through their App Notes on the DS18B20.
Or maybe even notes on the DS1990 iButton which is a DS18B20 jammed into an iButton can.
I know that 1-wire works on the DS18B20 but only ever ran it on the bench not a long run.
 

BeanieBots

Moderator
This is from memory without the spec sheet in front of me, but I believe that to use parasitic power requires slightly different commands to be sent and is more timing critical. Hence, probably not possible with PICAXE firmware.

I agree that two wire connection would be a big benefit and I'll have a bash at trying a method this weekend myself.

Edited by - beaniebots on 16/08/2006 12:19:06
 

steliosm

Senior Member
BeanieBots, I'll try to do the same this weekend. We could then compare the results we came with. I really hope it works. I'm more concerned abouth the power consumption, since it will need more current that the 4K7 pull-up (~1mA @5V) can provide.
 

BeanieBots

Moderator
The &quot;standard&quot; trick is to use 'active' pullup. I think there might be some scope to do some tricks with diodes and caps but I'll reserve judgement until I've played with some first.
 

BeanieBots

Moderator
Instead of using a passive resistor, it's done using an 'active' transistor. The problem is how/when to turn the tranistor on/off. I'm sure the datasheet explains it all somewhere.
I did accidenatlly use a 330R pullup once and got away with it. The only clue it was wrong was that the temperature appeared to go up each time it was read due the excessive current causing parasitic heating.
 

steliosm

Senior Member
I did some tests yesterday evening. I didn't use a long cable though.
I noticed tha the sensor was a bit more sensitive. Powering the sensor the 'normal' way I had a steady reading (31C). Powering the sensor the parasite-way the reading was starting at 32, going down to 31 after a minute and occasionly reading 32 for 10-20 secs.
Samples were taken every 10 secs.
 

BeanieBots

Moderator
I couldn't find a figure for &quot;idle&quot; current so based my calcs on the full worst case 1.5mA. The latest firmware keeps the device &quot;active&quot; for the full 750mS. This would make the required reservoir cap enormous. In practice, I am sure there will be a significant idle time within that 750mS but can't tell till I test it.
The voltage range of 5 down to 3 is large enough to get away with a significant drop but again, no spec on what effect this will have on the reading.

What method did you use for parasite power?
 

steliosm

Senior Member
The sensor was powered-up through data pin which was pulled-up through a 4K7 resistor. I didn't follow the rest of the DS80B20 Datasheet's circuit.
 

BeanieBots

Moderator
OK, my results using 18X and 5.01v supply.
First off, I tried rev 8.1 and 8.6 firmware. The results (predictably) were very different as 8.1 is pre the 750mS wait. I'll only give the results for 8.6

The code was run on an AXE110 with DS18B20 on input 7 with 4k7 pullup and AXE033 on output 6 all done at ambient of 24.6C.

Connections:
DS18B20 0v to 0v, data to input 7 with 4k7 pullup.
Schottky diode between data and DS18B20 Vcc (blunt end to data), cap between DS18B20 power pins.

The code:

Main:
pulsout 3,150 'blip bi-colour LED each time
readtemp12 7,w0
serout 6,N2400,(254,128,#w0,&quot; &quot;)
pause 1000
goto main

The results:
Control, Vcc @ 5v, cap=0uF reading=394.
The 5v was then removed and various cap values tested. Temperature kept constant.

a)cap=0uF,reading=498 (and sometimes erratic)
b)cap=10uF,reading=501 (31.3C) (first stable value)
c)cap=220uF, reading=380 (23.75C)
d)cap=680uF, reading=386 (24.13C)
e)cap=2200uF, reading=388 (24.25C) (took several iterations to get up to voltage)
f)cap=6800uF, reading=390 (24.38C)

g) 5v replaced, reading=392 (24.5)

Conclusion:-
Running a DS18B20 on two wires is possible but only with a large cap of at least 10,000uF and under the understanding that the LSB of the 12-bit value will be compramised.
Further testing suggested that the variation in values was in part as a result of the reduced Vcc value. The higher values when C was less than 10uF are almost certainly erroneous reads and bit errors.
To be honest, I conclude that it is NOT reliably possibly with a PICAXE if you require the full resolution. Those of you who use an output pin for Vcc in power saving circuits, take note of the effects of dropped voltage on Vcc when used in 12-bit mode!

 

manuka

Senior Member
Well put &amp; researched! In spite of twin core wire being more abundant,longer 3 wire DS18B20 runs can easily be neatly organised by peeling 3 wires from cheap flexible ribbon (or rainbow) cable. Guess others know this trick too? Simply select the number of wires needed ( 1,2,3,4 - 36 etc!)&amp; voila -peel off. Hence =&gt; <A href='http://www.picaxe.orcon.net.nz/bread08.jpg' Target=_Blank>External Web Link</a>. Dirt cheap or free if you've got boxes of old PC floppy &amp; HD ribbon cables gathering dust anyway.
 

BeanieBots

Moderator
Thanks Stan. Admittedly only a sample of one but enough to get me interested again in using control of Vcc to gain an extra 1/2 bit resolution. (same principle as &quot;accelerator&quot; resistor in thermostat devices).
 

inglewoodpete

Senior Member
I've done some more reading on the DS18B20 and Maxim/Dallas acknowledge that the phantom supply is insufficient to keep the device going during conversions etc. From their datasheet:
However, when the DS18B20 is performing temperature conversions or ....., the operating current can be as high as 1.5mA. This current can cause a unacceptable voltage drop across the weak 1-wire pullup resistor and is more current than is supplied by Cpp. To assure that the DS18B20 has sufficient supply current, it is necessary to provide a strong pullup on the 1-Wire bus wheneve temperature conversions are taking place.... This can be accomplished by using a MOSFET to pull the bus directly to the rail as shown in Figure... It then goes on to describe the timing required for the additional supply.

Given that the PICAXE does the whole "read temp" cycle in 1 command, it does not allow the user to fiddle with the supply during conversion. So I think we can say that the 1-wire mode is probably not suited to the PICAXE (refer to edit, below).

I'm just glad I ran the extra wire in my application. (Solar heating of my family room in winter in Oz).

Edit (2010): This original post predated the X1 and X2 PICAXEs. I haven't tried it, but it may be possible to use the 1-wire powered mode with the owOut and owIn commands.
 
Last edited:

BeanieBots

Moderator
It's all quite clear in the datasheet.
That's why I'm curious how/what steliosm did for parasitic power.
It certainly IS possible as I have demonstrated. It's just not very practical due to the size of reservoir cap required. The value of the LSB is also compramised due to supply variation.
It is possible to improve the situation by decreasing the pull-up value. I have not done any serious testing in this area because personally, I value accuracy over a two wire option. As mentioned earlier, the DS18B20 coped with a 330R pull-up but did suffer with self heating. There is probably a value which would offer acceptable levels of self heating AND respectable reservoir size. If the full 12-bit reading is not required, then it is very viable option.
I merely point out the consequences of using the technique.

Edited by - beaniebots on 18/08/2006 12:46:31
 
I have just tried a 470uF capacitor across a remote DS18B20 power pins. This seems to be working well powering the system via just two wires via the data (parasite power line) and the -ve. I have placed another 4k7 at the DS18b20 in the usual way.

A sample rate of &gt; 2 seconds read rate is required to allow the 470uF to maintain sufficient charge.

(All this is powered off 3 x AA alkaline)

- Andrew
 
Top