gau061
Posts: 4
Joined: Thu Mar 28, 2013 4:49 am

DS18B20 Setup Error

Thu Mar 28, 2013 9:02 am

Hello All help in setting up DS18B20 for my Pi for project on temperature sensor. I am following instructions on http://learn.adafruit.com/adafruits-ras ... /ds18b20.

In this code I do not found w1 folder.

cd 28-xxxx folder also not showing.

How can I set up DS18b20 successfully ?

Please Help.

Gaurav
Attachments
pi's X desktop (raspberrypi3) - TightVNC Viewer 3282013 22110 PM.bmp.jpg
Snapshot of file
pi's X desktop (raspberrypi3) - TightVNC Viewer 3282013 22110 PM.bmp.jpg (56.42 KiB) Viewed 9788 times

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 12:21 pm

There's another guide here - http://www.cl.cam.ac.uk/freshers/raspbe ... mperature/

You need to enable to w1 modules

Code: Select all

sudo modprobe w1-gpio
sudo modprobe w1-therm
w1 should then appear as expected.

gau061
Posts: 4
Joined: Thu Mar 28, 2013 4:49 am

Re: DS18B20 Setup Error

Thu Mar 28, 2013 1:26 pm

Hi

I got the w1 folder but I am not getting 28-xxxxx file.

Do I need to Update any kernal ? If so please give me the link.

Regards,

Gaurav
Attachments
Rpi.jpg
Rpi.jpg (38.03 KiB) Viewed 9765 times

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 2:09 pm

Are you using a DS18B20 sensor that is on a board already or just the bare sensor?

If it's the bare sensor do you have the required resistor in the circuit?

gau061
Posts: 4
Joined: Thu Mar 28, 2013 4:49 am

Re: DS18B20 Setup Error

Thu Mar 28, 2013 2:16 pm

Yes I use DS18B20 sensor, that is on the board already and circuit is complete.

But that folder is not generating . i.e 28-000003cee4ca

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 3:41 pm

What GPIO pins are you using?

idem
Posts: 12
Joined: Mon Feb 18, 2013 3:23 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 4:01 pm

got the same error :

# uname -a
Linux babyroom 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux

# cat /etc/debian_version
debconf.conf debian_version

# cat /etc/debian_version
7.0

# modprobe w1-gpio && modprobe w1-therm
in dmesg got :
13.336807] Driver for 1-wire Dallas network protocol.

# ls /sys/bus/w1/devices/
lrwxrwxrwx 1 root root 0 mars 28 16:38 w1_bus_master1 -> ../../../devices/w1_bus_master1/

nothing else...any help ?
Last edited by idem on Thu Mar 28, 2013 10:26 pm, edited 1 time in total.

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 4:06 pm

How is it wired up?

I have the premade boards with the resistor already fitted. Mine are wired up ....

+ to 5V
- to GND
S to GPIO4 (Pin 7)

User avatar
RaTTuS
Posts: 10491
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: DS18B20 Setup Error

Thu Mar 28, 2013 4:07 pm

ant_thomas wrote:How is it wired up?

I have the premade boards with the resistor already fitted. Mine are wired up ....

+ to 5V
..
to the 3V please ....
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 4:10 pm

RaTTuS wrote:
ant_thomas wrote:How is it wired up?

I have the premade boards with the resistor already fitted. Mine are wired up ....

+ to 5V
..
to the 3V please ....
Am I risking damaging my RPis by running the sensors off 5V?

I also have relays running on 5Vs. Bad idea? As well as PIR sensors.

gau061
Posts: 4
Joined: Thu Mar 28, 2013 4:49 am

Re: DS18B20 Setup Error

Thu Mar 28, 2013 4:32 pm

I am using Pin 1 for GPIO power supply (3v)

GPIO 4

PIN 6- GND

idem
Posts: 12
Joined: Mon Feb 18, 2013 3:23 pm

Re: DS18B20 Setup Error

Thu Mar 28, 2013 10:30 pm

ant_thomas wrote:How is it wired up?

I have the premade boards with the resistor already fitted. Mine are wired up ....

+ to 5V
- to GND
S to GPIO4 (Pin 7)
+ to 3.3V
- to GND
S to GPIO 4

Great, plugged in 5V it works :)

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: DS18B20 Setup Error

Fri Mar 29, 2013 1:06 pm

idem wrote:
ant_thomas wrote:How is it wired up?

I have the premade boards with the resistor already fitted. Mine are wired up ....

+ to 5V
- to GND
S to GPIO4 (Pin 7)
+ to 3.3V
- to GND
S to GPIO 4

Great, plugged in 5V it works :)
Good stuff. Hopefully it doesn't cause issues. I've moved mine over to 3.3V and it's still working but my relays don't work properly on 3.3V.

Are you sure your 3.3V is working?

Mazikainen
Posts: 1
Joined: Fri May 17, 2013 8:06 pm

Re: DS18B20 Setup Error

Fri May 17, 2013 8:12 pm

Just to note anyone with the same problem I had, make sure you have the correct GPIO layout for the revision of RPI you are using. I accidentially looked at the pins of Revision 2 even though my Raspberry was Revision 1 and ended up using the wrong Pin 4. You can see the instructions on how to see which revision you have here: http://www.raspberrypi-spy.co.uk/2012/0 ... d-version/

Once I had it properly connected it worked just as the examples show. I was worried for a moment I had fried the sensor during soldering (very little soldering experience).

miataman1957
Posts: 2
Joined: Sun Jul 28, 2013 2:35 am

Re: DS18B20 Setup Error

Sun Jul 28, 2013 2:40 am

Does the sensor need to be connected to gpio4? and if so why.But if not how do I go about configuring a different pin such as gpio25 to function. I have it working on GPIO4 but will need to redesign my pcb board to accommodate gpio4 if I am limited to it.

User avatar
MattHawkinsUK
Posts: 538
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
Contact: Website

Re: DS18B20 Setup Error

Sun Jul 28, 2013 8:50 am

I think it needs to be GPIO4 because that is the GPIO that the kernel module is setup to use. Would be interested to know if it can be changed but I suspect not.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)

Schorschi
Posts: 220
Joined: Thu Nov 22, 2012 9:38 pm

Re: DS18B20 Setup Error

Mon Jul 29, 2013 11:55 pm

Anyway to get the kernel to use something other than GPIO pint 4?

cheako
Posts: 1
Joined: Mon Dec 09, 2013 8:22 pm

Re: DS18B20 Setup Error

Mon Dec 09, 2013 9:18 pm

I'd imagine a lot of users would encounter problems of some kind. Ne1 have a checklist and troubleshooting guide?

Here is what I'm lost at, aside from all the troubleshooting that was clear:
1. Wire color codes, my sensor(s) are cased in a long can and have a 1m cable. Lots of photos online have all sorts of colors, I've gone with green and red being ground and power with yellow being data. Perhaps it would work to list the connectors using terms like "lightest, darkest, and middle", thus allowing for any colors to be used. That's assuming lightest and darkest are always data and ground... and that everyone agrees green is darker than red.

2 This page menchions board rev having an influence, however for this project both revision should be wired the same... GPIO4 is P1-7? My rev is 000e, but I couldn't find a pinout for it anywhere. If there is multiple setups, they both should be listed explicitly to provide a complete reference and no mistake.

3. The use of "scripts/config --enable DYNAMIC_DEBUG" kernel build command. To turn on w1 debugging, try:

Code: Select all

#!/bin/sh
[ "`zgrep DYNAMIC_DEBUG /proc/config.gz`" ] || exit 4
f=/sys/kernel/debug/dynamic_debug/control
[ -f $f ] ||
mount -t debugfs none /sys/kernel/debug
modprobe w1_gpio
grep w1 $f|wc
grep w1.*" =p " $f|wc
echo 'file w1.c =p' > $f
echo 'file w1_netlink.c =p' > $f
grep w1.*" =p " $f|wc
modprobe w1_therm
Loading your modules this way with a DYNAMIC_DEBUG kernel will show you more about what's going on in dmesg output. For me it just indicates that I've no w1_therm supported devices on a perfectly good w1 bus. I've not seen any devices detected on the bus, but without kcore support that's difficult to say.

4. As this page suggests either 5v or 3.3v will work, does the resistor value need to change? I just read that the GPIO pins should be able to self pullup, would that be applicable here? I'm using 1.5k and get a voltage of 2.73 across the resistor and 0.586 to ground or 3.316.

The above is a list of topics that I've ruled out in my case, given that I still have the same issue the above must be wrong some how. Either I've made a mistake or my troubleshooting tips guide are incomplete.

My next step is to use an oscilloscope, to make sure that Pi and sensor are both xmitting. If they are then I'd have to assume that the Pi is not able to measure the input, 5v burnout.

Return to “Automation, sensing and robotics”