Pages: [1]   Go Down
Author Topic: DS18B20 temp sensors sometimes returning 0.00  (Read 701 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had a problem were I had 2 DS18B20 sometimes both returning 0.00. I finally figured out why but thought I'd share the problem and solution. I did a lot of searching and I couldn't find anyone else who had had the same problem. I think this was because I had done very noobish thing.

Hardware setup
- Duemilanove
- WiShield 2.0
- 2 DS18B20 temp sensors were connected (not parasiticly)

library's:
- WiShield library 1.13
- DallasTemperature library 3.4
- OneWire 2.0

The temp sensors worked fine with just the DallasTemperature multiple example. I mashed this example with the WiShield WiServer example (simple web page returning temps) and started getting temps of 0.00 for 1 in 3 reading. I removed the serial printing of the temp readings and but was still getting 0.00 for about 1 in 20 readings.

Turns out that I was stupidly using pin 2 to communicate with the sensors when the WiShield was using it as an interrupt.

Moral of the story, for me atleast, is make a list of all the pins on the board and note what hardware is using what pin.

Hope this helps someone else just starting on the Arduino path.

(edit: spelling)
« Last Edit: September 28, 2010, 06:44:06 pm by ahidau » Logged

Central Europe
Offline Offline
Edison Member
*
Karma: 6
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for posting it. I had a similar problem with the servo library and timers. Documenting used resources is just so much more important in embedded systems than for normal application programming.

Korman
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can highly recommend these sensors btw. I have them both right next to each other on a breadboard. Most of the time they are exactly the same temp and very occasionally they are 0.06 degrees apart. I'm running them in 12 bit mode. Since I fixed my pin assignment mistake, they have behaved flawlessly.
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 8
Posts: 1992
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I suspect its your sketch.  I run a total of 8 of these on two arduinos. I read them all once a minute and graph them (for over a year now). I get the odd glitch (one giving an erroneous reading around once a month maybe) but on the whole they they are very reliable. I agree with ahidau, they are also very accurate and repeatable. When I was trialling them I has 5 together on a breadboard, they all read within 1/16 of a degree of each other and comparing them with several trusted thermometers they were accurate to the limit of my existing thermometers.
« Last Edit: September 29, 2010, 02:30:53 am by stephen_t » Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have exactly the same hardware but struggle with the programming, I will PM you as I was hoping to get your sketch.

Cheers,
Ben
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 8
Posts: 1992
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Since I last posted in September I've noticed it occurs more often in winter, since I  have an interrupt driven gas monitor it trips up more when I'm using more gas which fits in with the interrupt theory.  I over read the thermometers and ignore readings if they are more than a degree or two away from the previous reading.  Crude but effective..........
Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 169
Posts: 12448
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
- DallasTemperature library 3.4

FYI : Version 3.6 is allready available - http://download.milesburton.com/Arduino/MaximTemperature/DallasTemperature_360.zip
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: