I've followed instructions through various sites which have all given the same information about wiring the DS18B20 sensor to a Raspberry Pi (red is 3.3V, black is ground, white connects to GPIO pin 4 and bridged to 3.3V with a 4.7k to 10k pull-up resistor.

I run

sudo modprobe w1_therm ; sudo modprobe w1_gpio

I can see the temperature sensor start to set up under /sys/bus/w1/devices/ but only the master portion. It never finds a slave device. I see a symlink called "w1_bus_master1" which points back to /sys/bus/w1/drivers/w1_master_driver but that's all I get. If I follow the symlink, I see files like "w1_master_slave_count" and "w1_master_slaves" but when I cat the "w1_master_slave_count" it always says 0, and looking at the "w1_master_slaves" file always reports "not found."

I'm not sure what else to try. The product page on SparkFun said to use a 4.7k - 10k resistor and one comment on the page said the Dallas sensor could go as low as 2.2k on a 3.3V supply, so I've tried a couple of combinations. I didn't want to try the 5V supply since another user said theirs went up in a puff of smoke on a 5V rail.

I do not have any test equipment to do low-level debugging, so I'm curious what else I can check as to why this sensor isn't setting up properly.

This should be your answer

The sensor worked just fine on a Raspberry Pi B+ but not on the B. I triple checked some docs which claimed that pin 16 was GPIO #4 but other docs said GPIO #4 was pin 7, and hey, whatdya know, it works fine.

  • Overflow? I don't even know what that means, but it doesn't sound accurate. Anyways, process of elimination the first thing I know you have 2 of is GPIO pins, so try another, the problem of course if figuring out how to change the software. Second if you are using a breadboard, they might be a open somewhere, it's not a perfect tool, and some holes just don't give you a solid connection. Next you either need a basic volt/ohm meter to find out what's going on... if not a second sensor and/or second pi. – Tyson Jan 12 '15 at 1:16
  • The GPIO setup is built into the kernel, so without having to build a custom kernel every time Raspbian updates that'd be kind of a hassle. It's on a breadboard and I've tested the pins on that row with an LED and they all work fine. I'll see if I can pick up or borrow a volt/ohm meter this week, I was mostly hoping to find someone here who ran into the same problem at knew how to solve it. – Ian Douglas Jan 12 '15 at 2:28
  • 1
    Hi, welcome to Pi Q&A Exchange. Please do not update the question titles or questions with answers, solved or comments. You can answer your own question too and mark it accepted. Please up vote any other relevant answers to show your support. Thanks – Piotr Kula Jan 12 '15 at 7:09

You say "Edit: the sensor worked just fine on a Raspberry Pi B+ but not on the B. I triple checked some docs which claimed that pin 16 was GPIO #4 but other docs said GPIO #4 was pin 7"

They are both right. There are 3 different numbering schemes for GPIO. You need to determine which is intended.

See:- http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=91046&p=636782#p636782

PS I am not sure what your exact question was

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.