Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Not able to read ds18b20 temp sensor

Fri Apr 03, 2015 1:33 pm

I do try to read the temp from a ds18b20 sensor.

I installed WiringPi by the way: http://wiringpi.com/download-and-install/
I installed the sensor and tried to read it by the: https://iada.nl/blog/artikel/temperatuu ... spberry-pi

I checked the connection between the sensor and the py several times. There is 3.3V at the sensor
The data is connected to pin 7 of the GPIO (GPIO 4). There is a resistor 0f 4.7KOhm between 3.3V and data pin
If I look in :
ewh@raspberrypi-2 /sys/bus/w1/devices $ ls -l
totaal 0

There are no sensors visible.
Beside this I'm able to switch off and on a LED on GPIO 17. So it looks like the GPIO is working correctly.
cd
What am I doing wrong?
Please advice
Last edited by Canedje on Fri Apr 03, 2015 1:49 pm, edited 1 time in total.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Not able to read ds18b20 temp sensor

Fri Apr 03, 2015 1:45 pm

If you are running a recent or updated version of Raspbian, this might be relevant: http://www.raspberrypi.org/forums/viewt ... 28&t=97314

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Not able to read ds18b20 temp sensor

Fri Apr 03, 2015 1:51 pm

Add

Code: Select all

dtoverlay=w1-gpio
to /boot/config.txt and reboot.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: Not able to read ds18b20 temp sensor

Fri Apr 03, 2015 2:01 pm

DougieLawson wrote:Add

Code: Select all

dtoverlay=w1-gpio
to /boot/config.txt and reboot.

Thanks a lot!!!
That was the solution.
I can read the ds18b20 now

I also have the dht22 sensor. Do I need to do something in advance for this sensor?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Not able to read ds18b20 temp sensor

Fri Apr 03, 2015 2:08 pm

For i2c and spi devices add

Code: Select all

dtparam=i2c_arm=on
dtparam=spi=on
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: Not able to read ds18b20 temp sensor

Fri Apr 03, 2015 2:40 pm

Thanks again
It all workes fine now!

Return to “Troubleshooting”