Bramley
Posts: 15
Joined: Wed Oct 02, 2013 10:08 am

DS18B20 logging suddenly stopped

Sat Feb 01, 2014 7:41 pm

Hi - I hope that someone will have some advice on a problem I haven't experienced before.

Using a simple Python program on my RPi Rev2, I had been successfully logging 5 DS18B20 probes indoors to calibrate them. Then, after several hours perfect running unattended, I had two sets of bizarre readings, after which the programme crashed.
I have been using the protocol described in the Adafruit tutorials pages (http://learn.adafruit.com/adafruits-ras ... re-sensing). (BTW, I have similar RPi which has been running happily as a weather logger for several months.)

The wiring is :
Probe + line to 3.3V on RPi
Probe -line to GND on RPi
Probe signal line to GPIO4
Probe signal line to 4.7Kohm to 3.3V on RPi)

I have tried rebooting, and using:

Code: Select all

sudo modprobe w1-gpio
sudo modprobe w1-therm
and checking for the probe files in

Code: Select all

/sys/bus/w1/devices
but with no success. (It did work earlier today.)

I have tested GPIO4 with a simple LED-flashing program, but the LED didn't flash (though it did when tested on GPIO7).

Does this mean a hardware failure on GPIO4, or is there (fingers crossed) a software solution?

I would greatly appreciate any advice on this troublesome problem.

dpenezic
Posts: 99
Joined: Sat Dec 22, 2012 2:36 pm

Re: DS18B20 logging suddenly stopped

Sat Feb 01, 2014 10:04 pm

Hi,

Which version of kernel you use ? From some version you may use any available GPIO pin for 1-wire master input.

Try to restart RPi, and remove w1-gpio and w1-therm module, then try to use LED for blink testing.

Regards,
Dubravko Penezic

Bramley
Posts: 15
Joined: Wed Oct 02, 2013 10:08 am

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 9:55 am

Hi Dubravko

Many thanks for your kind and prompt suggestions. Apologies for the late reply.

I am running Kernel version 3.10.25+, but as a relative beginner I do not know how to find if this supports other ports on modprobe w1_therm, or (if it does) how to do it.

I performed a modprobe -r on w1_therm and w1_gpio to remove them, and rebooted the RPi. The LED flashing worked perfectly on GPIO4.

I then reloaded w1_gpio, and the LED flashing did not work on GPIO4.

I removed w1_gpio and the flashing worked again.

So, there is apparently some adverse reaction between w1_gpio and GPIO4, though whether this is software or hardware I don't know.

If you have any thoughts on this matter I would like to hear them.

Thanks again!

dpenezic
Posts: 99
Joined: Sat Dec 22, 2012 2:36 pm

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 10:30 am

Hi,

It is nice to hear that your RPi is working correctly :) .

Your LED blink dont work if you start w1-gpio, because that kernel module start software support for 1-wireless master device, and that is O.K. .

Do you use RPi camera board ? or any other I2C devices ? Did you try with just one DS18B20 ?

Please read http://www.raspberrypi.org/phpBB3/viewt ... 52#p477052 .

Regards,
Dubravko Penezic

Bramley
Posts: 15
Joined: Wed Oct 02, 2013 10:08 am

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 11:47 am

Hello Again, Dubravko

Thanks for explaining why w1-gpio caused problems with GPIO4. It is a steep learning curve! At least it doesn't seem like a hardware problem.

For my testing, I have reduced my circuit to just the single DS18B20 probe, with nothing else connected. I am using a PiPlate for the pinout, to be sure of using the correct pins. I don't have a camera board.

Sadly, however, when I run w1-gpio and w1-therm, I still get no probe temperature file under /sys/bus/w1/devices, just the folder w1_bus_master.

Following the posting that you linked to, I have changed the channel to GPIO7, but with no success.

The weird thing is that the logging programme was reading the data happily yesterday afternoon, then gave 2 sets of strange readings, and then stopped making the temperature output files. So, something happened during the run.

I have tried varying the signal--3V3 resistor to 10kohm, and to 22kohm (this latter resistor works on my other RPi logger which has a 20-m long bus cable). No success!

I wonder if you have any other ideas. Thanks again.

dpenezic
Posts: 99
Joined: Sat Dec 22, 2012 2:36 pm

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 2:07 pm

Hi,
may you send picture of your wire connection ?

Regards,
Dubravko Penezic

Bramley
Posts: 15
Joined: Wed Oct 02, 2013 10:08 am

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 2:36 pm

Here's the circuit.
I hope it is clear as I'm only allowed 64KB. The resistor is 4.7k.
Thanks.
Attachments
DS18B20_bb.png
DS18B20_bb.png (56.91 KiB) Viewed 1599 times

RobinGreig
Posts: 15
Joined: Sat Oct 27, 2012 2:40 am
Location: Calgary, Alberta, Canada

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 2:48 pm

Hello,

I'm an enthusiastic user of the Pi & DS18B20's
I have a setup at my office, home, and garage and have them all recording back to the mysql database in the garage Pi.
You can see my recordings online at therm.hopto.org (I live by Calgary, Alberta, Canada, and the temps are Celsius).

I just wanted to jump in and offer another thought.
Is it possible that your DS18B20 has failed?
Do you have another that you can plug in and try?

Robin
www.robingreig.ca
Arduino + Raspi + Amateur Radio enthusiast since 2012
VE6RBN Canadian Amateur Radio Callsign

Bramley
Posts: 15
Joined: Wed Oct 02, 2013 10:08 am

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 3:41 pm

Hi Robin

Nice to meet another DS18B20 enthusiast. They are so consistent (+- 0.2C) that they hardly need calibrating.

Good suggestion - I have tried another probe, with no success. The strange thing is that all 5 probes went down during a logging session. I have only had one break down before, and that gave what looked like an alarm value of 85degC - a bit hot in a damp and chilly Wales!

I look forward to reading your weather blog.

Thanks for taking the trouble.

dpenezic
Posts: 99
Joined: Sat Dec 22, 2012 2:36 pm

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 4:17 pm

Hi,

connection is looking O.K. ... please try to connect your DS18B20 directly to RPi without PiPlate .

Regards,
Dubravko Penezic

Bramley
Posts: 15
Joined: Wed Oct 02, 2013 10:08 am

Re: DS18B20 logging suddenly stopped

Sun Feb 02, 2014 5:12 pm

Brilliant!

It was a connection problem. When I plugged directly into the RPi, everything worked perfectly.

I suspect that the problem is that to use the Pi directly I had to use some well-made male--female jumper wires from the header to the breadboard. To use the PiPlate I used cheap male--male jumper wires, which must have been making poor contact. The first thing I tried when the problem occurred originally was to plug in and out again (I was warned years ago about "dry joints"), but that obviously wasn't enough. How very embarrassing!

I really am grateful for all the time you have spent helping me out on this. One good thing is that I have learned a bit more about w1-modules, and from another of your postings I have learnt how to change gpio input pins (I had wondered why all the examples I read used GPIO4).

Thank you once again. Now for a glass of wine to celebrate!

Return to “Troubleshooting”