Modbus sensors positing data at same address


I have a few Modbus RTU RS485 SHT20 Temperature Humidity Transmitter Sensors.

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

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

From that link:

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.

Maybe I was not unclear what I want to do.... :slight_smile: . 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.

I guessed that and my response was exactly that.

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...

Because multiple of these :point_up: type of device is super simple

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.

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.

1 Like

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