# Multiple DS18B20 Thermometers on Single OneWire Bus

**URL:** https://forum.xod.io/t/multiple-ds18b20-thermometers-on-single-onewire-bus/4317
**Category:** Hardware Interfacing Questions
**Created:** [August 18, 2020, 5:28pm UTC](https://forum.xod.io/t/multiple-ds18b20-thermometers-on-single-onewire-bus/4317 "2020-08-18T17:28:44Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)
#### Post date: [September 11, 2020, 9:58pm UTC](https://forum.xod.io/t/multiple-ds18b20-thermometers-on-single-onewire-bus/4317/6 "2020-09-11T21:58:34Z")

</div>

@spuj, I’ve just published a library for working with multiple DS18B20 thermometers on a single 1-wire bus:  
[https://xod.io/libs/wayland/ds18b20/](https://xod.io/libs/wayland/ds18b20/)

I followed the wiring instructions in this guide:

> **[Interfacing Multiple DS18B20 Digital Temperature Sensors with Arduino](https://lastminuteengineers.com/multiple-ds18b20-arduino-tutorial/)**
>
> Learn 2 Methods(by Index & by Address) to Interface Multiple DS18B20 Digital Temperature Sensors On Single Bus along with its Wiring & Arduino Code

I have the waterproof version of the thermometers:  
 ![ds18b20](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e0d5ccd8a0e8c0d170398010016258ee603842ac.jpeg)  
red = VDD  
black = ground  
yellow = signal

The first thing you need to do is determine the eight byte address of each of your thermometers. Connect just one of your thermometers and run the **example-read-address** patch in the debugger:  
 ![Screenshot 2020-09-11 at 18.01.15](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/3/30fff4af7d71db5525930bf70d31a52aa9d5c9a0.png)  
Make a note of the eight byte address of your thermometer. Repeat process for each of your other thermometers. I label my thermometers so that I can match them to their addresses.

Once you know the addresses of all of your thermometers you can connect them all in parallel. To check that you can get a temperature reading from all thermometers, use patch **example-read-temp-multi-devices** :

 ![Screenshot 2020-09-11 at 18.43.51](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/2/20a9e73feb52496d3cb7d55546360f5844e15314.png)  
The **ds18b20-bus** node represents the 1-wire bus connecting your thermometers. You can change the resolution of all thermometers on the bus using the **set-resolution** node. The **request-temperatures** node has to be pulsed before using the **get-temp-c** nodes to read each thermometer. You’ll obviously need a **get-temp-c** for each of your thermometers. **get-temp-c** output the temperature in degrees Celsius. If you prefer Fahrenheit you can use **get-temp-f**.

A note of caution: if any of the **get-temp-c** nodes output the value **85** , check your wiring (see discussion here: [https://www.raspberrypi.org/forums/viewtopic.php?t=63085](https://www.raspberrypi.org/forums/viewtopic.php?t=63085)). Initially I was using relatively heavy test leads in my circuit and I frequently got these erroneous **85** readings. After replacing the test leads with short dupont wires the dodgy readings disappeared. If a sensor becomes disconnected its **get-temp-c** will output **-127**.

---

_[View the full topic](https://forum.xod.io/t/multiple-ds18b20-thermometers-on-single-onewire-bus/4317)._
