bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

DS18B20 always shows 85 degrees

Thu Jun 18, 2015 10:28 am

Hi All,
I would love some help with some advice on troubleshooting a temperature sensor ds18b20 using Raspian.
I have a constant reading of 85 which would indicate that the RPi is connected and communicating with the sensor.
I have been using a 4.7k resistor and have also tried a large range of resistance values. I have tried parasitic power and non parasitic power. Shielded wire/unshielded wire. Soldered/breadboard. Update/upgrade config.txt modprobe- all the suggestions that have come to my attention through googling for almost a week. All these suggestion have resulted in the same constant reading of 85.

Is there some way that I can change some parameters to allow the sensor to exchange all its information?- not just the "hello I'm here and its 85 degrees" message.

Any helpful advice would be greatly appreciated.

achrn
Posts: 441
Joined: Wed Feb 13, 2013 1:22 pm

Re: DS18B20 always shows 85 degrees

Thu Jun 18, 2015 11:37 am

85 is an error code. Never believe a report of 85 from a DS18B20.

It means you are getting some sort of communication, but there's something not right about it. Unfortunately, what is 'not right' is hard to identify. What hardware are you using at the pi? Is it just bit-banging GPIO? What software are you using? What voltage is your bus running at? Have you tried any different sensors?

User avatar
RaTTuS
Posts: 10785
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: DS18B20 always shows 85 degrees

Thu Jun 18, 2015 11:39 am

if it always shows 85 then you have wired it up wrong [and it will probably get hot]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

ame
Posts: 3206
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: DS18B20 always shows 85 degrees

Thu Jun 18, 2015 12:29 pm

RaTTuS wrote:if it always shows 85 then you have wired it up wrong [and it will probably get hot]
No, it's wired up correctly. Otherwise it wouldn't be addressable, or it would report a checksum error. It won't get hot.

pwillard
Posts: 21
Joined: Wed Aug 22, 2012 1:55 pm

Re: DS18B20 always shows 85 degrees

Thu Jun 18, 2015 2:40 pm

It still indicates bad 1-wire communications though.

User avatar
RaTTuS
Posts: 10785
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: DS18B20 always shows 85 degrees

Thu Jun 18, 2015 3:00 pm

umm ^ yes

bad 1 wire comms
85 is out of range
but I see it when you have a bad power or ground connection [or the pull up is bad]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

danjperron
Posts: 3799
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DS18B20 always shows 85 degrees

Thu Jun 18, 2015 3:32 pm


bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

Re: DS18B20 always shows 85 degrees

Sat Jun 20, 2015 10:32 pm

achrn wrote:85 is an error code. Never believe a report of 85 from a DS18B20.

It means you are getting some sort of communication, but there's something not right about it. Unfortunately, what is 'not right' is hard to identify. What hardware are you using at the pi? Is it just bit-banging GPIO? What software are you using? What voltage is your bus running at? Have you tried any different sensors?
Thanks for your reply.
I had to find out what 'bit-banging' was, and it turns out that is what I'm doing. I've followed the tutorials on the Cambridge site and adafruit project 11.
The voltage reading at the sensor legs is 3.22v. I've tried it using the 5v supply pin and the reading at the sensor legs is 4.23v.
I've tried three different sensors.

Any additional pointers about what to check would be really appreciated.
Thanks.

bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

Re: DS18B20 always shows 85 degrees

Sun Jun 21, 2015 7:14 am

Thanks for your suggestion. I installed your software and communicated with my sensor. It gave the same error code (85 degrees
) Does your software rely on w1-gpio and w1-therm?

Thanks for your help.

ame
Posts: 3206
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: DS18B20 always shows 85 degrees

Sun Jun 21, 2015 7:34 am

How long is your wire?

What value of pull-up resistor are you using?

bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

Re: DS18B20 always shows 85 degrees

Sun Jun 21, 2015 7:54 am

pwillard wrote:It still indicates bad 1-wire communications though.
Thanks for thinking this through with me. The resistance from the sensor leg2 to the gpio4 pin is 0.006ohms.
When I wire the sensor in the way I think is correct I get an output of 85. When I wire it up in all the other combinations that I believe are wrong, I either get no response at all, or an error from the software saying it can't find a sensor.

So I think I have isolated the problem to the 1- wire communications, (but not the wire part, just the communication part
)

I would like help in investigating the communication between the pi and the sensor: is there any way of changing something to enable better communication?

bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

Re: DS18B20 always shows 85 degrees

Sun Jun 21, 2015 8:06 am

ame wrote:How long is your wire?

What value of pull-up resistor are you using?
Hi, thanks for your input. The wires that I am using are only about 200mm long.
I am using a 4.7k resistor.

I have also tried the following resistor values
1, 5, 10, 22, 33, 47, 56, 100, 150, 220, 330, 560, 820, 1k, 1.5k, 2.2k, 3.3k, 4.7k, 5.6k, 6.8k, 8.2k, 10k, 15k, 22k, 33k, 47k, 56k, 68k, 82k, 100k,150k, 220k, 330k, 470k, 560k, 680k, 1M
There was a range centred around 4.7k where I got a response from the sensor and outside of this range there was no response.

I am interested in any additional troubleshooting steps you might suggest.
thanks

danjperron
Posts: 3799
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DS18B20 always shows 85 degrees

Sun Jun 21, 2015 12:40 pm

Thanks for your suggestion. I installed your software and communicated with my sensor. It gave the same error code (85 degrees
) Does your software rely on w1-gpio and w1-therm?
No Not at all and you should not use GPIO4 for my code since I'm doing my own bit banging!

Maybe a picture of your assembly will help! Like the other subscriber did on the post I sent you!

Kagetaze
Posts: 86
Joined: Sat Jan 24, 2015 12:01 pm

Re: DS18B20 always shows 85 degrees

Mon Jun 22, 2015 6:09 pm

You can use DS18B20 in parasite power mode, meaning that you only need two wires: ground and data, no need for pullup resistor for the data.

As per the datasheet (http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf page 2): VDD must be grounded for operation in parasite power mode.

DS18B20 needs strong pull-up on the data line in this mode achievable by issuing this commands:

sudo modprobe w1-gpio pullup=1
sudo modprobe w1-therm strong_pullup=1

1. parasitic power mode features simplicity in wiring. Only 2 wires needed for this mode. This is especially important when one want to wire a big number of sensors together.

2. the disadvantage of the parasite mode is that the IO needs strong pullup to be able to provide enough current. However this is not a real problem with this temperature sensors.

3. another disadvantage of the parasite power is the slower communication speed. One have to charge the parasite capacitor and that takes time, in case of this sensor > 500 ms.

bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

Re: DS18B20 always shows 85 degrees

Thu Jun 25, 2015 7:10 am

Oh dear! I have made a fundamental, monumental embarassmental mistake.
I thought I was using a DS18B20, but in fact I was using a DS18B20-PAR instead!!!

WOOPS!

Thanks to everyone who replied with helpful advice. Your combined troubleshooting tips made me go right back to basics- leading me to discover my error.

I've ordered the non-'PAR' version and expect much happier times with that when it arrives.

ame
Posts: 3206
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: DS18B20 always shows 85 degrees

Thu Jun 25, 2015 7:15 am

bullster wrote:Oh dear! I have made a fundamental, monumental embarassmental mistake.
I thought I was using a DS18B20, but in fact I was using a DS18B20-PAR instead!!!

WOOPS!

Thanks to everyone who replied with helpful advice. Your combined troubleshooting tips made me go right back to basics- leading me to discover my error.

I've ordered the non-'PAR' version and expect much happier times with that when it arrives.
They should still work. You need to specify parasitic mode in the driver (in the dtoverlay line if that's what you are using).

bullster
Posts: 7
Joined: Thu Jun 18, 2015 8:04 am

Re: DS18B20 always shows 85 degrees

Mon Jun 29, 2015 9:36 am

I have replaced the ds18b20-PAR with a ds18b20 and everything is working fantastically now.

Thanks for all the contributions to help me solve this problem that has been bugging me for months.

Return to “Automation, sensing and robotics”