schnoog
Posts: 12
Joined: Tue Dec 27, 2011 3:55 pm
Contact: Website

Problem with DS18B20 sensor

Sun Jul 15, 2012 11:03 am

Hi,
I just received some DS18B20 sensors. (http://www.ebay.de/itm/DS18B20-Digital- ... 369wt_1139)

I applied the patches for Dallas 1W interface,

Code: Select all

cd /boot
wget http://www.frank-buss.de/raspberrypi/kernel-rpi-w1.tgz
tar -xzf kernel-rpi-w1.tgz
rm -f kernel-rpi-w1.tgz
cd /lib/modules
wget http://www.frank-buss.de/raspberrypi/modules-rpi-w1.tgz
tar -xzf modules-rpi-w1.tgz
rm -f modules-rpi-w1.tgz
sync
reboo
and it seems the kernel is working correctly.
modprobe w1-gpio brings up no error

I connected the sensor as follow:
Red (VCC) to GPIO PIN 1
Green (Ground) to GPIO PIN 6
Yellow (Data) to GPIO PIN11

Red and yellow (VCC and Data) are bounded over a 4k7 resistance.
I used an old IDE wire to connect everything.
When I`m checking the voltage between "RED" and "GREEN" my multimeter saying 3V3.

But when I`m checking the w1 directory, it seems the devices was not found at all

Code: Select all

ls /sys/bus/w1/devices/w1_bus_master1/
driver     w1_master_add              w1_master_pointer  w1_master_slave_count
power      w1_master_attempts         w1_master_pullup   w1_master_slaves
subsystem  w1_master_max_slave_count  w1_master_remove   w1_master_timeout
uevent     w1_master_name             w1_master_search
The w1_master_attemps is increasing.
The output of "cat w1_master_slaves" is "not found."

Maybe someone of you can give me a hint whats I`m doing wrong.


Everey hint is appreciated.


Thanks and kind regards
Schnoog

nirn
Posts: 1
Joined: Tue Aug 07, 2012 9:05 pm

Re: Problem with DS18B20 sensor

Tue Aug 07, 2012 9:08 pm

Hi, this kernel works with DS18B20 only on GPIO 4, PIN07

schnoog
Posts: 12
Joined: Tue Dec 27, 2011 3:55 pm
Contact: Website

Re: Problem with DS18B20 sensor

Thu Aug 09, 2012 8:16 pm

Thanks for the response.

I`ve connected the data line to GPIO4 (Pin7), with the same results :(

Any further tipps?


Kind regards
Schnoog

schnoog
Posts: 12
Joined: Tue Dec 27, 2011 3:55 pm
Contact: Website

Re: Problem with DS18B20 sensor

Tue Aug 14, 2012 10:02 am

This is exactly how I connected the sensor.
I run rpi-update, patched the kernel again, and now the DS18 is visible.

Thank you very much :)

Kind regards
Schnoog

schnoog
Posts: 12
Joined: Tue Dec 27, 2011 3:55 pm
Contact: Website

Re: Problem with DS18B20 sensor

Fri Oct 19, 2012 1:48 pm

After update and patching all is running (onsen egg machine ;) )

nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Re: Problem with DS18B20 sensor

Thu Oct 25, 2012 4:41 pm

mmm... not sure what's happening here, as my machine has just started doing the same thing this afternoon. Was running quite happily, logging temperatures. I Ran apt-get update and apt-get dist-upgrade, and now all I get is 'not found' when I cat w1_master_slaves. Tried rebooting, no luck.

I'll see if I can work out what's going on, but in the meantime, I'm open to suggestions.

Ta,
--
nr.

nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Re: Problem with DS18B20 sensor

Thu Oct 25, 2012 8:25 pm

Talking to myself. I'm sure this isn't healthy.

Found the problem - it was actually hardware failure in one of the DS18B20s. The software update was unrelated as far as I can tell (unless it caused spontaneous corrosion in the 3v3 leg of the sensor). Temperatures are now being logged again, and humanity can breathe a sign of relief that every time I have a cup of tea in my shed the occasion will be marked with a small spike in a graph.
--
nr.

towy
Posts: 3
Joined: Sat Oct 27, 2012 7:27 pm
Location: Slovakia

Re: Problem with DS18B20 sensor

Sat Oct 27, 2012 7:43 pm

My DS18B20 is working fine. However can somebody tell me how it reports minus temperatures ?

cat /sys/bus/w1/devices/w1_bus_master1/28-000003b55333/w1_slave
da 00 4b 46 7f ff 06 10 0c : crc=0c YES
da 00 4b 46 7f ff 06 10 0c t=13625

i.e 13.625 degrees. But how would it look for say -5 degrees ? Want to check my awk syntax can handle it but short of waiting for winter or using some ice...

Thanks, Tony

markyb
Posts: 2
Joined: Tue Oct 30, 2012 9:59 pm

Re: Problem with DS18B20 sensor

Tue Oct 30, 2012 10:01 pm

Hi Tony,

I occasionally get an erroneous reading which is displayed as 't=-1250' (for example) so presumably it just uses a hyphen...couldn't say for certain though.

Mark

drscheme
Posts: 20
Joined: Thu Feb 14, 2013 8:33 am

Re: Problem with DS18B20 sensor

Fri Feb 22, 2013 2:50 pm

Hi
Yfory wrote:Hi Schnoog,

Can I check how you have connected the circuit?
It should be:

Code: Select all

3.3v from Pi----.----VCC
                |
                '----4k7 Resistor----Data---GPIO4 (3rd pin down from 3.3v)

Ground on Pi----Ground on DS18B20
I am a little confused. I found another diagram on a website (http://www.cl.cam.ac.uk/freshers/raspbe ... mperature/) that shows a different setup:

Code: Select all

3.3v from Pi  -----.----------------------- VCC on DS18B20
                   |
                   X (4,7kOhm)
                   |
GPIO4 from Pi -----.----------------------- Data on DS18B20

Ground on Pi  ----------------------------- Ground on DS18B20
Which of both setups is not correct? Or are both diagrams the same (I'm not used to read this kind of diagrams). Sorry for that maybe stupid question but I am absolutely no electronic guy and don't want to break anything =)

asa_g
Posts: 20
Joined: Tue Jan 08, 2013 7:43 am

Re: Problem with DS18B20 sensor

Tue Feb 26, 2013 1:38 pm

I think second diagram is more correct.
ps
Does anyone has long term stats of using DS18B20 sensor?
i was using DHT22 and it was always hanging after 2-3 day of work

nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Re: Problem with DS18B20 sensor

Tue Feb 26, 2013 2:03 pm

asa_g wrote: Does anyone has long term stats of using DS18B20 sensor?
About 11 years worth, give or take. Only the past eight months or so from the R-pi, obviously. Most of these were collected using the DS9490R USB bridge, but the past four or five months or so have been from the R-pi kernel routines with the DS18B20s connected to the GPIO pins.
--
nr.

drscheme
Posts: 20
Joined: Thu Feb 14, 2013 8:33 am

Re: Problem with DS18B20 sensor

Sat Mar 02, 2013 4:39 pm

Are there actually other One-Wire sensors that are supported by Linux? E.g. a humidity sensor, etc?

repton
Posts: 91
Joined: Sat Mar 17, 2012 6:06 pm
Location: North Yorkshire, UK.
Contact: Website

Re: Problem with DS18B20 sensor

Sat Mar 02, 2013 8:40 pm

drscheme wrote:Are there actually other One-Wire sensors that are supported by Linux? E.g. a humidity sensor, etc?
Almost every 1-Wire device is supported by Linux given the right software. I think the kernel 1-Wire driver is a little limited as to what it supports but if you're using a USB or I2C connected master then you can use OWFS which supports pretty much every 1-Wire device there is.

Whilst there is no native 1-Wire humidity sensor there are quite a few people who make a humidity sensor module to a common design using a Honeywell sensor and a DS2438Z to interface it to the 1-Wire bus. You can get such modules from people like EDS, Hobby Boards, Homechip and me (see my signature below).

You can also get barometric pressure sensors, and wind speed and direction sensors as well as things like digital I/O modules to allow you to control external devices.

HTH,
Paul
UK Supplier of 1-Wire components, kits and modules:
http://www.sheepwalkelectronics.co.uk/

User avatar
yv1hx
Posts: 374
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
Contact: Website

Re: Problem with DS18B20 sensor

Tue Jun 25, 2013 7:10 pm

asa_g wrote:I think second diagram is more correct.
ps
Does anyone has long term stats of using DS18B20 sensor?
i was using DHT22 and it was always hanging after 2-3 day of work
asa_g: Please have a look here: http://yv1hx.no-ip.org

The red line in the very first graph is the ambient temp were my RPi lies, is gathered with a DS12B20 connected to the RPI as stated earlier.
Marco-Luis
Telecom Specialist (Now Available for Hire!)

http://www.meteoven.org
http://yv1hx.ddns.net
http://twitter.com/yv1hx

Return to “Automation, sensing and robotics”