# Ds18b20 raspberry pi

**URL:** <https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689>\
**Category:** General\
**Created:** [28 April 2020 15:42 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689 "2020-04-28T15:42:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [28 April 2020 15:42 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/1 "2020-04-28T15:42:38Z")

</div>

I am using ds18b20 with the raspberry pi and I am using "node-red-contrib-sensor-ds18b20" node with inject and debug node and it shows the payload as mentioned in below picture.

 ![temp1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/6/3601adaef96574ae97fa8f65ebddd67427bc202c.jpeg)  
while I need temperature. Any suggestion.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [28 April 2020 16:05 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/2 "2020-04-28T16:05:52Z")

</div>

Hi, have you enabled 1-Wire in raspi-config?

---

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [28 April 2020 16:13 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/3 "2020-04-28T16:13:27Z")

</div>

Yes, I did. and that`s why I got Sensor Id. As shown in below picture.

 ![temp](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/ac865cca4d7332555e5999764f7271e4748ac837.jpeg)

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [28 April 2020 16:24 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/4 "2020-04-28T16:24:05Z")

</div>

When I set up node-red-contrib-ds18b20-sensor (different node but works great by the way) I had to enabled 1-Wire in raspi-config and

sudo nano /boot/config.txt  
add at bottom  
dtoverlay=w1-gpio

Perhaps this is your problem or go try node-red-contrib-ds18b20-sensor instead.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [28 April 2020 16:48 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/5 "2020-04-28T16:48:10Z")

</div>

Do you have a 4k7 resistor between data and vdd?

---

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [28 April 2020 16:51 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/6 "2020-04-28T16:51:14Z")

</div>

> [@Dave](#):
>
> node-red-contrib-ds18b20-sensor

"dtoverlay=w1-gpio" is already there.  
 ![error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/16699c47703ad40fc94a55e150fb66ba353f72fc.jpeg)

While I am using "node-red-contrib-ds18b20-sensor" node and getting the below message.

 ![error1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/db518905ad1d6a09c5c52c407bc80ee0b953ad14.jpeg)

---

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [28 April 2020 17:03 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/7 "2020-04-28T17:03:15Z")

</div>

Yes. Below is my circuit diagram.  
 ![95215564_588279365125138_3382854016290521088_n](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/718179be3358cc9e6e183bf1e98dc8e9339c7716.jpeg)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [28 April 2020 17:24 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/8 "2020-04-28T17:24:49Z")

</div>

I don't think you are getting good contact from the Dupont connectors attached to the sensor, I also noticed that in your screenshot of the node that there were more than 1 sensor ID's shown. Do you have a breadboard that you can use to connect to the sensor?

---

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [28 April 2020 17:48 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/9 "2020-04-28T17:48:35Z")

</div>

Now I am using breadboard, but still same result and two sensor ids show.

 ![95056020_241563157206154_214564776422932480_n](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38ecda2383246fd56635919cfbf3debb8a7b83fc.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 April 2020 21:13 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/10 "2020-04-28T21:13:42Z")

</div>

Does the sensor disappear from the dropdown if you disconnect it?

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [29 April 2020 12:12 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/11 "2020-04-29T12:12:49Z")

</div>

You need to double check your wiring, resistor size and that the device is actually a DS18B20  
Colin has a good point if you disconnect the device the id should disappear but the 3 sensor ID's shown in the 3rd post are not DS18B20 the family name / ID for all DS18B20's should start with 28- this is the output you should be seeing.

topic: "FF5E0F721704"  
payload: 21.625  
\_msgid: "171e7630.55f71a"  
file: "28-0417720f5eff"  
dir: "w1\_bus\_master1"  
family: "28"

---

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [29 April 2020 16:11 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/12 "2020-04-29T16:11:39Z")

</div>

I have changed the sensor and now it is work fine. How can I add humidity.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [29 April 2020 16:24 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/13 "2020-04-29T16:24:57Z")

</div>

Good that you got it sorted. Have you searched through the forum for "Humidity"? There are lot's of entries. It is also better to start a new thread when the question/topic changes, and not simply extend the thread.

---

<div class="post-metadata">

**Author:** ![usmanEmder](https://avatars.discourse-cdn.com/v4/letter/u/977dab/32.png) [@usmanEmder](https://discourse.nodered.org/u/usmanEmder)\
**Post date:** [29 April 2020 16:29 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/14 "2020-04-29T16:29:26Z")

</div>

Ok 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 May 2020 16:29 UTC](https://discourse.nodered.org/t/ds18b20-raspberry-pi/25689/15 "2020-05-13T16:29:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
