1

I am trying to figure out why I cannot get temperature sensors working connected to my RPi2. I have followed almost every possible guide on the internets without luck and the answers* provided here does not seem to work for me. So now I am posting my own question to see if anyone can lead me the right way.

I have NOT tried to run device-tree-compiler becuase I am not fully aware how it works. Would this be necessary?

*Dallas 1-wire temperature sensor not working , DS18B20 no longer working

Also:

learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overview

modmypi.com/blog/ds18b20-one-wire-digital-temperature-sensor-and-the-raspberry-pi

cl.cam.ac.uk/projects/raspberrypi/tutorials/temperature/

-

I have to admit that I am a total Linux-novice so I might be missing something fundamental here. I studied network engingeering and have been working as an IT-tech for a few years. Thought the Rapsberry Pi was going to be easy but it's been a humbling experience so far. :)

I have tried two different DS18B20's and another tempsensor(Pico T0-92). I get a steady current of 3.30 Volts between 3v3 and GRND. Between datapin and GRND I usually get 0.80 Volts, and beteween datapin and 3v3 is usually about 2.50. So I am assuming the sensors and connections are good. I have tried with 4.7K, 10K and without resistor with same results. I have successfully been turning LEDs on and off.

I have now done a fresh install of Raspbian Jessie. I have had the same issue in Raspbian Jessie Lite and Ubuntu Mate.

First thing I did was to update the system.

apt-get update
apt-get upgrade
reboot
rpi-update
reboot

I then found this thread and thought I would give the following a try: DS18B20 w1-gpio Device Tree gpiopin NOT = 4 . I started by modifying /boot/config.txt.

sdtv_mode=2
dtparam=i2c_arm=on
dtparam=i2c_vc=on
dtparam=spi=on
dtoverlay=w1-gpio,gpiopin=21

followed by a reboot and connecting my sensors to gpiopin21(#40 on RPi) (Results does not change if using other gpiopin.)

lsmod now showing:

pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
cfg80211              389253  0
rfkill                 16036  1 cfg80211
w1_gpio                 3401  0
wire                   24703  1 w1_gpio
bcm2835_gpiomem         2860  0
snd_bcm2835            19802  0
cn                      4258  1 wire
bcm2835_rng             1763  0
i2c_bcm2708             4920  0
spi_bcm2835             7074  0
snd_pcm                73442  1 snd_bcm2835
snd_timer              18792  1 snd_pcm
snd                    50779  3 snd_bcm2835,snd_timer,snd_pcm
uio_pdrv_genirq         2944  0
uio                     7753  1 uio_pdrv_genirq
i2c_dev                 5671  0
fuse                   80694  1
ipv6                  338574  32

dmesg is showing me the same errors as before:

[    4.573118] Driver for 1-wire Dallas network protocol.
[    4.617107] w1-gpio onewire@0: gpio pin 21, external pullup pin -1, parasitic power 0
[    4.617196] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling

...and a bit further down.

[   18.659585] w1_master_driver w1_bus_master1: w1_search: max_slave_count 64 reached, will continue next search.
[   64.663875] w1_master_driver w1_bus_master1: Family aa for aa.7aaaaaeaaaaa.af is not registered.
[  147.966042] w1_master_driver w1_bus_master1: Family aa for aa.eeaaaaeaaaaa.df is not registered.
[  148.303747] w1_master_driver w1_bus_master1: Family aa for aa.5eaaaaeaaaaa.ed is not registered.

...and that message keeps spamming dmesg.

EDIT, forgot to mention listed devices. (Where the serial is changing)

pi@raspberrypi:~ $ cd /sys/bus/w1/devices/
pi@raspberrypi:/sys/bus/w1/devices $ ls
aa-d6baaaaaaaaa  w1_bus_master1

And sometimes more gets added. (With only one sensor connected)

pi@raspberrypi:/sys/bus/w1/devices $ ls
aa-6ebaaaaaaaaa  aa-debaaaaaaaaa  aa-f5baaaaaaaaa  w1_bus_master1

Would be much appreciated if someone could shed some light on this for me or just try to point me in the right direction.

No need to beat around the bush, just call me an idiot if that is the case. :)

  • 1
    The configuration looks okay. /boot/config.txt dtoverlay=w1-gpio,gpiopin=21 is all you need. That leaves wrong wiring. Could you post a photo of the set-up. What pull-up resistor are you using between 3V3 and the data line? – joan Mar 3 '16 at 21:55
  • Yes, it must be the wiring! I have eliminated everything else at this point. Maybe an intermittent connection could cause the slave count to max out? Anyways, I will be gone for the weekend unfortunately so will have to get back to it next week. I will keep you update and thanks @joan for taking your time! – robsta Mar 4 '16 at 19:20
0

@joan, you were absolutely right. It was an issue with the connections, but still unsure about the rootcause.

At first, I was using the 3V and GRND "rails" on the breadboard. I then connected the sensor to the rails for power and Ground. The Data was connected directly to the Raspberry. I was still getting 3.3V through the sensor at this point, but I must admit I did not meassure the current through the sensor.

I then tried to connect the sensor bypassing the rails for power and ground. e.g: Directly to the numbered lines on the breadboard. Then I was able to read the temperatures properly.

-

I then discovered that I get the same issue as before if I connected another sensor in series with the first.

I guess it could be an intermittent connection somewhere on the breadboard or could I be loosing power from the Raspberry if using a breadboard?

Anyone have any previous experience with issues like this?

Thanks and Regards, Robert

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.