DS18B20 reads 85 all the time

kristercnc

New Member
I am using DS18B20 chip to read temperatur, and controlling my pelletsburner. On at 60 deg. and off at 70 deg. But somtimes I get a reading of 85 for a short time, and then it gets back to the normal temperature.
I also have some chips that reads 85 all the time (broken I think).
Is there something wrong with my chip, or is there a bug in the program?
 

nick12ab

Senior Member
Where did you obtain these DS18B20s?
Have you got the pull-up resistor fitted on the data connection?
Have you got decoupling capacitors fitted?
Have you got the DS18B20s powered properly or parasitically powered? PICAXE won't work with the latter.
 

kristercnc

New Member
More facts. The DS18B20 came from Picaxe shop.
I have a 4.7k resistor close to the picaxe. I have no capasitor on the data connection. Are you suppose to?
It is a AXE 401 28X2 Shield base. I soldered it myself.
The power to the DS18B20 is 5 volt from the picaxe. I use a telefone cable, that in this case is about 4 meter long.
 

lbenson

Senior Member
85 is likely to be a wiring issue--bad power, bad ground, or bad pullup--I've forgotten which, but I've seen it a number of times.

4 meters is fairly long, but I've done that several times successfully (with 1/8" mini stereo cable).
 

nick12ab

Senior Member
More facts. The DS18B20 came from Picaxe shop.
I have a 4.7k resistor close to the picaxe. I have no capasitor on the data connection. Are you suppose to?
It is a AXE 401 28X2 Shield base. I soldered it myself.
The power to the DS18B20 is 5 volt from the picaxe. I use a telefone cable, that in this case is about 4 meter long.
The decoupling capacitor needs to be across the power pins. Do you have the 0V connection connected as well? I thought telephone wire only had two wires in it.
 

kristercnc

New Member
The cable has 4 wires in it.
I use 3 of them. 0V, +5V, data. A 4.7k is connected between +5V and data. Perhaps I need a smaller pull-up resistor, due to long cable? Does it matter if the 4.7k resistor is close to the picaxe or close to the DS18B20?
Temporarely I have fixed it by repeting the reading if I get the value 85.
I use a press fit RJ11 (4pins) connector (easy to make) on the cable. Could this be a problem?
 

lbenson

Senior Member
I wouldn't suspect the RJ11 connector to be the problem (though it could be). Do you reliably read 5V at the DS18B20 with a DVM? Also 5V on the data line (via the pullup) when you're not trying to read it? You might try paralleling the 4K7 with a 10K or another 4K7 to see if that helps.
 

kristercnc

New Member
Yes I use Logicator to program. But it not nessarely the problem.

Thread moved.
Problem may be of general interest. e
 
Last edited by a moderator:

Paix

Senior Member
I believe that the norm in such connections is to use all four wires. Pos and ground twisted and signal and ground twisted, but the signal ground is only made at the board, providing an electrostatic screen, but not an earth loop for the data signal.

FWIW. . .

Mostly 85 is related to power issues not so much signal integrity.
 

inglewoodpete

Senior Member
4-wire telephone cable is usually a quad, not 2 twisted pairs. I have run a DS18B20 at the end of 10 metres (3 wires used) of telephone cable without any problems - actually 2 x DS18B20 using 4 wires (2 x data wire) - if that makes sense. 4.7k pullups + capacitor across power pins at the DS18B20.
 

westaust55

Moderator
Have a read through the 1-Wire netowrks information I posted here (in particular the first pages of the atatchement at post 43) :http://www.picaxeforum.co.uk/showthread.php?15306-One-Wire-Devices-Networks/page5

Earthing spare conductors and use of screened cables should ideally be avoided for capacitive reasons but I have pressed a screened 2 core audio type cable into service for (from memory) a 40 metre length with five DS18B20 chips at the remote end without any capacitors as the remote end. There may certainly be a need to reduce the pull-up resistor value (down to as low as 2.2 kOhm) but also ensure if using a Rev Ed PICAXE board that there are no pull-down resistors on the input.
 
Top