# Modbus sensors positing data at same address

**URL:** <https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033>\
**Category:** General\
**Tags:** modbus\
**Created:** [4 September 2023 10:21 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033 "2023-09-04T10:21:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paca](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@paca](https://discourse.nodered.org/u/paca)\
**Post date:** [4 September 2023 10:21 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/1 "2023-09-04T10:21:07Z")

</div>

Hi.

I have a few Modbus RTU RS485 SHT20 Temperature Humidity Transmitter Sensors. [https://www.aliexpress.com/item/32966097805.html?spm=a2g0o.order\_detail.order\_detail\_item.4.4d7af19cw7ZS6K](https://www.aliexpress.com/item/32966097805.html?spm=a2g0o.order_detail.order_detail_item.4.4d7af19cw7ZS6K)

All of them are posting data from address 0. How can this be changed?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 September 2023 10:33 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/2 "2023-09-04T10:33:19Z")

</div>

> [@paca](#):
>
> All of them are posting data from address 0

I assume you mean from "slave" address 0 and you want multiple devices on the same RS485 network?

From that link:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f363f55ff6131807977a042d7efcd0707ca95f2.jpeg)

Seems you need to update register 0x1 using modbus FC 0x10 (i.e. FC 16) which is essentially "write multiple holding registers"

TBH, if you dont have them already, I would definitely suggest getting zigbee modules or MQTT capable modules to greatly simplify your life.

---

<div class="post-metadata">

**Author:** ![paca](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@paca](https://discourse.nodered.org/u/paca)\
**Post date:** [4 September 2023 19:46 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/3 "2023-09-04T19:46:36Z")

</div>

Maybe I was not unclear what I want to do.... 🙂 . I want to connect multiple temperature/humidity sensors to same serial network.

Problem is how do I address the different sensors? For example temperature in bedroom and living room.

 ![Screenshot 2023-09-04 at 21.32.23](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d219d4962bb180eb37ab534c4975b79da729c91.png)  
 ![Screenshot 2023-09-04 at 21.30.09](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/44b5b7e5d1499165daed84996ecabe6f3a900c10.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 September 2023 20:27 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/4 "2023-09-04T20:27:30Z")

</div>

> [@paca](#):
>
> Maybe I was not unclear what I want to do.... 🙂 . I want to connect multiple temperature/humidity sensors to same serial network.

I guessed that and my response was exactly that.

> [@Steve-Mcl](#):
>
> I assume you mean from "slave" address 0 and you want multiple devices on the same RS485 network?
> 
> From that link:
> 
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f363f55ff6131807977a042d7efcd0707ca95f2.jpeg)
> 
> Seems you need to update register 0x1 using modbus FC 0x10 (i.e. FC 16) which is essentially "write multiple holding registers

As I am certain you know, to have multiple modbus devices on the same network (rs485 is a serial network) the devices need unique slave/device numbers.

Your problems don't end here. Requesting data from multiple devices is slow and laborious which is why I then said...

> [@Steve-Mcl](#):
>
> TBH, if you dont have them already, I would definitely suggest getting zigbee modules or MQTT capable modules to greatly simplify your life.

Because multiple of these ☝ type of device is super simple

---

<div class="post-metadata">

**Author:** ![Billy\_C](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/billy_c/32/74647_2.png) [@Billy\_C](https://discourse.nodered.org/u/Billy_C)\
**Post date:** [5 September 2023 03:24 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/5 "2023-09-05T03:24:03Z")

</div>

You will need to plug in one at a time and assign each one a unique address using the holding register shown in the documentation. As soon as you write the new address the device might not be accessible through the default address. Once all the devices have been reprogrammed they can be added to the serial bus together and read individually using the addresses assigned.

---

<div class="post-metadata">

**Author:** ![Billy\_C](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/billy_c/32/74647_2.png) [@Billy\_C](https://discourse.nodered.org/u/Billy_C)\
**Post date:** [5 September 2023 03:31 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/6 "2023-09-05T03:31:20Z")

</div>

In regards to switching protocols, modbus is a very robust protocol but limited in the amount of data that can be realistically transferred. As long as you keep reads to reasonable intervals you shouldn’t have an issue. I don’t know what the limits are precisely but I misplaced a decimal trying to read a batch of 24 or so inputs, something like 10ms vs 100ms or maybe 1000 vs 100, can’t remember exactly. That lead to some very buggy behavior on that device.

---

<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:** [4 November 2023 03:32 UTC](https://discourse.nodered.org/t/modbus-sensors-positing-data-at-same-address/81033/7 "2023-11-04T03:32:14Z")

</div>

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