Dallas temp reading high

ciseco

Senior Member
Hi,

Does any one know why when powering a dallas DS18B20 off an output the reading is a few degrees high? Got two doing the same thing, will solder one straight to VDD tommorow to check, just thought I'd ask first.

Cheers

Miles
________
herbalaire vaporizer
 
Last edited:

Michael 2727

Senior Member
What supply voltage are you using ?
What is your Temperature Reference ?
They can self heat if the supply voltage is too high.
Try 3 x AAA cells for a supply.

Edit: What value pullup resistor are you using, test it to be sure.
 
Last edited:

hippy

Technical Support
Staff member
The voltage out of an I/O pin will always be somewhat lower than supply VDD so that could be what's affecting it.
 

ciseco

Senior Member
All good questions, I don't normally power them off an output. I just saw a post awhile back about power saving and the suggestion was power it at read time, from an output, so it wasnt always on. I just took it as read and gave it a whirl, but then most of you guys run at 5V, so I'm suspecting that maybe my issue. (I put in a nominal 1000ms pause after taking output high to let it settle before readtemp command).

The 28x1 runs at 3V3, data sheet for the sensor says 3 to 5V at 4V its a max of 4ma (so that's within limits), I'll measure the output and see if thats above 3V as dippy suggests. Now I've had a nights sleep, I'm gonna bet that the 4K7 needs to be lowered a bit due to the lower voltage. Running straight off the 3V3 rail with 4K7 usuallly works fine though.

Boriz, you got me thinking is it parasitcally powered I don't think so, that I think would be if the VDD line was stealing power from DQ but it's wired like this.

AXE DS18B20
input dq
output vdd
gnd gnd
with a 4K7 between vdd & dq

Temp ref is a weather station in the same room, DS reading is 3-4 degrees higher.

Will report back findings

Miles
________
Subaru
 
Last edited:

eclectic

Moderator
Miles.
I've just tried a quick test:

Two pre-wired DS18B20, both with 4k7,taped close together.
In air, then hand-warmed.

Power supply = 2 x AA Alkaline

DS 1 gnd / V+ / input 0

DS2 gnd / Output 0 / input 7

First results are pictured.

e
 

Attachments

inglewoodpete

Senior Member
If you have 2 DS18B20s side by side, both tracking and reporting the 'wrong' temperature, I'd start to disbelieve your weather station. Do you have, or can you borrow, a couple of thermometers to compare your other readings with. Any old mercury or alcohol based glass thermometers will do. While you can't be sure which are accurate and which are not, the averages will start to indicate a winner :)
 

BeanieBots

Moderator
Contrary to popular beleif, measuring temperature to better than 1 deg is very difficult. With thermistors you have line impedance and noise issues, with thermocouples you have cold-junction and high gain amps giving problems. With the DS18B20, everything is all enclosed in the chip which round those problems but then introduces self heating issues.

In addition to all of that, there is thermal resistance between the sensor and point of interest plus stratification. In a standard room with little air flow, a gradient of several degrees can develop over just a few feet difference in hieght.
When comparing measurements between different sensors, you should put both sensors in an insulated box with a small fan to stir the air. (not too violent or it will negate any self heating effects). Allow things to settle for at least 20mins before taking any readings.
 

kevrus

New Member
To emphasise what BB said, I had three DS18b20 resting on a laminate floor, all within about a 12 inch area, all reading slightly different temps (less than 1 degree difference between any two though). When I swopped their positions on the floor, it actally showed minor variations in the floor temp and not in-accuracies in the sensors...I even taped the sensors to the floor so they all had similiar thermal contact...not exactly scientific though
 

eclectic

Moderator
Going back to Miles' original post#1 question.

I've just tried

1. DS18B20 powered from 3V
2. DS18B20 powered from output pin.
3. Two -10 - +110 alcohol thermometers. (NOT certified).

All taped together on the desk.

ALL show the same temperature. (Within my eyesight limits!)

e
 

westaust55

Moderator
If powering the DS18B20 directly from a PICAXE output, then:
1. the Output pin of the PIC may be as low as Vdd - 0.7 V.
2. with Vdd = 3.3V then supply to the DS18B20 may be as low as 2.6V.
3. From the DS18B20 datasheet, the minimum supply voltage to the DS18B20 is 3.0V.
 

ciseco

Senior Member
Did some tests

All located within inches of each other in the same room.

What I think is true

19.5 DS18B20 on electricity meter sensor in dining room (always believed this to be right)
19.5 DS18B20 on my boiler monitor (brought into dining room, placed next to elec mon sensor), so they agree
18.5 weather station in dining room (my assumed reference, although on hard surface and it's very very slow to react)
14.8 DS18B20 outside (believed to be similar to the car - VW passat)
14.6 weather station on a plant pot about 1 ft from this after 30 mins

So that makes me think the weather station is there or there abouts

this is what the two read

22.7 output powered DS18B20 #1
23.9 output powered DS18B20 #2

picaxe supply from reg 3.301v (verified within .1v across 3 different meters)
picaxe ouput 3.30v
voltage across 4K7 3.294v

looked at the connections again, just to see if I'd done something daft, nope, looks fine. Dropping another 4K7 across to make essentially 2K35 made no difference

code on all picaxes

readtemp12 3,w3
b3 = w3 / 256 / 128
if b3 = 1 then
w3 = w3 ^ $ffff + 1
b10="-"
else
b10="+"
endif
w3 = w3 * 10 / 16
b12 = w3 / 10
b13 = w3 // 10
if b12 < 10 then
b11="0"
serout XBEEdataoutPIN,BAUD,("aR",s1,s2,"T",b10,"0",#b12,".",#b13,"--")
else
serout XBEEdataoutPIN,BAUD,("aR",s1,s2,"T",b10,#b12,".",#b13,"--")
endif

going to try a DS on a wire, it can only be duff sensors or local heating now
________
volcano vaporizer reviews
 
Last edited:

ciseco

Senior Member
Seem to have gotten to the bottom of it, the voltage regulator feels very slightly warm (hardly decernable) and must be thermally transfering across the board and up the legs of the DS even though it's physically about 2 inches away.

When I wire another one with 4 inches of cable and bend it back so it's at the same height as the onboard one there's over 2.5 degree difference (19.4 & 22 degrees) the other one which hasn't been switched off (23.7 degrees), I guess being left on some time longer it had crept even higher.

I supose it shows one good thing, these dallas sensors are very consistant, in my rather basic tests thats only 0.1 degree difference over quite a few, so what the rest of you have found seems to hold true.

The other being, I'm as daft as a brush for not suspecting it earlier, I guess what I learn from this is put the regulation outside the box or extend the sensor well away from the board to minimise thermal conduction.

Many many thanks to everyone, sorry, my fault as usual

Miles
________
BMW M5 (E34)
 
Last edited:

BeanieBots

Moderator
Glad you got there in the end and well done for owning up.
It's a good lesson learned and I doubt one you'll forget too quickly.
Also, don't forget the basic spec of the DS18B20 is +/-0.5C, so to have the best part of 1C difference between two sensors should not be too surprising.
 

ciseco

Senior Member
yep, to back of the class :D

you just know when you've done something so many times that when two situations come along so similar it fry's your noodle how on earth this can be happening. The overall factor now is that over all these boards it's the new el cheapo 6v psu's from farnell that put out 9.45v and 9.44v thats the difference. If'd I'd been using the 5v regulated jobs I normally do or 4 aa's it wouldnt have happened, the reg is having to work so much harder hence the rise. How silly do I feel :confused:

miles

P.S. whilst having them all together and the temp having gone up slightly there's so far a max difference of 0.2 degrees across al the dallas sensors, I'll put the heating on and try a few more times to see what comes out. The weather station is still way out, so that's for sure now an unreliable reference. The one on my multimeter reads 18-19 no matter where I put it, inside or out, from craplin electronics :)
________
vapor lounge
 
Last edited:

BeanieBots

Moderator
It certainly is worth testing over a range of temperatures. They can be quite non-linear over a fairly small range. I have one which is spot on at 22C but nearly +0.3C out by the time it gets up to 33C and almost spot on again at 47C.
Admittedly my reference has not been calibrated in 15 years but I have other DS18B20s which do not show the same charcteristic against the same reference, so if nothing else, it does demonstrate that they can vary from device to device and not always by a simple offset error.
 

ciseco

Senior Member
I think I'm now at about the limit of where I need to take the heating system, it's now like barbados in here.

The single largest variance over 6 devices is 0.4 degrees so taking the dallas 0.5 degree acuracy seems totally fair.

I'd guess to get a resolution better than this with these is either to map them out against a very good reference or to bury a number within a single metal block and average them out, you'd still have to carefully select which ones to use though.

I should get some proper work done :)
________
Z series
 
Last edited:

BeanieBots

Moderator
That is proper work!
You are learning about resolution vs accuracy, testing methods and a whole lot more. I also get the impression that you are enjoying it too.

A cheaper option to turning up the central heating is to build yourself an evironmental chamber. Great PICAXE project in its own right as well.
My first one was a converted fridge controlled by a Z80 because PICAXE did not exist then. I made another one a few years ago from a polystyrene box (courtesy of the local supermaket) and an 18X. VERY EASY.
 

ciseco

Senior Member
Environmental chamber, now there's an idea

a serene place to escape from the misses..........................

oh yeah,

already got one,

it's called a "shed" over 'ere in blightly

:D hehehehehehehehehe
________
GM L66 engine picture
 
Last edited:

BeanieBots

Moderator
A shed is a place where tools get subjected to the environment.
Unfortunately, that includes you (and me) when the missus has had enough.
An environmental chamber is a place where you control the environment.
 

ciseco

Senior Member
control the environment...................... PHONE AL GORE, he's been looking for one of those ehehehehe

Sorry I digress, having too much fun, have a hangover from hell and anything not to do with work seems so much more tempting :)
________
medical marijuana doctor
 
Last edited:

papaof2

Senior Member
Shed versus environmental chamber:

At a previous house I had the luxury of an 8ft by 10ft outside building that was insulated, with finished interior walls, wired for electricity, a wall thermostat controlling a plug-in electric heater, and a small window air conditioner. It was a great place for my electronics workbench (the wife and kids couldn't complain about the smoke from soldering) and the amateur radio gear (being up late didn't disturb anyone else). Having a space like that with its own temperature controls would make a great large-scale environmental chamber ;-)

It was also a good place to hide birthday/Christmas gifts for the kids - just another brown carton with funny writing on it... There was the downside of a 30ft walk - especially when it rained and I didn't have an umbrella out there.

John
 
Top