# DS18b20 Temperature Sensor

**URL:** <https://forum.xod.io/t/ds18b20-temperature-sensor/2574>\
**Category:** Uncategorized\
**Created:** [September 10, 2019, 11:52am UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574 "2019-09-10T11:52:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmadnaweedxod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ahmadnaweedxod/32/1482_2.png) [@ahmadnaweedxod](https://forum.xod.io/u/ahmadnaweedxod)\
**Post date:** [September 10, 2019, 11:52am UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/1 "2019-09-10T11:52:42Z")

</div>

I have a problem regarding this ds18b20 hardware. It works fine with Arduino IDE but not with XOD.  
The problems is that readings (out of Tc pin) keep jumping between 3 different values, for example : 32.16 and 100.0 and 299.55 randomly. The correct one is of course 32.16 degrees Celsius but it doesn’t stay there.

---

<div class="post-metadata">

**Author:** ![microbios75](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@microbios75](https://forum.xod.io/u/microbios75)\
**Post date:** [September 11, 2019, 3:36pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/2 "2019-09-11T15:36:28Z")

</div>

Try slowing down the read time. Use the clock node and set the value to 5 or something else. Sensor’s sometimes are slow on reading stuff.

---

<div class="post-metadata">

**Author:** ![ahmadnaweedxod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ahmadnaweedxod/32/1482_2.png) [@ahmadnaweedxod](https://forum.xod.io/u/ahmadnaweedxod)\
**Post date:** [September 11, 2019, 4:17pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/3 "2019-09-11T16:17:44Z")

</div>

I did use clock. The result is the same. Slow or fast the same jumping.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [September 11, 2019, 4:59pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/4 "2019-09-11T16:59:23Z")

</div>

can you upload a screenshot of the patch?

---

<div class="post-metadata">

**Author:** ![microbios75](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@microbios75](https://forum.xod.io/u/microbios75)\
**Post date:** [September 11, 2019, 6:12pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/5 "2019-09-11T18:12:24Z")

</div>

Sorry bud, out of ideas 😕

---

<div class="post-metadata">

**Author:** ![ahmadnaweedxod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ahmadnaweedxod/32/1482_2.png) [@ahmadnaweedxod](https://forum.xod.io/u/ahmadnaweedxod)\
**Post date:** [September 13, 2019, 3:24pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/6 "2019-09-13T15:24:58Z")

</div>

![temp](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/99c5ffefa1108708c470fb97e5a8a613bbd1444f.jpeg)

---

<div class="post-metadata">

**Author:** ![ahmadnaweedxod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ahmadnaweedxod/32/1482_2.png) [@ahmadnaweedxod](https://forum.xod.io/u/ahmadnaweedxod)\
**Post date:** [September 13, 2019, 3:27pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/7 "2019-09-13T15:27:04Z")

</div>

Thanks for paying attention.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [September 13, 2019, 3:36pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/8 "2019-09-13T15:36:39Z")

</div>

connect “done” of ds18b20 to UPD lcd node

---

<div class="post-metadata">

**Author:** ![ahmadnaweedxod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ahmadnaweedxod/32/1482_2.png) [@ahmadnaweedxod](https://forum.xod.io/u/ahmadnaweedxod)\
**Post date:** [September 13, 2019, 3:43pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/9 "2019-09-13T15:43:57Z")

</div>

Thanks, it worked. Now the incorrect values show up only when the system boots up.  
This is a very simple patch but what if we have a very complex patch that we don’t want the sensor to update the lcd?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [September 13, 2019, 4:38pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/10 "2019-09-13T16:38:03Z")

</div>

you can choose when updating, using a clock, a pulse from another node or several pulses using “ANY”

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [September 13, 2019, 6:46pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/11 "2019-09-13T18:46:02Z")

</div>

If you don’t want bogus values from Temp sensor, you can add a buffer node between Temp Sensor node & LCD node. The Temp Sensor Done pin would then connect to the buffer UPD pin. This will keep a fixed value for the LCD to display until buffer is updated later.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [September 15, 2019, 6:46pm UTC](https://forum.xod.io/t/ds18b20-temperature-sensor/2574/12 "2019-09-15T18:46:08Z")

</div>

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