I'm integrating a wind direction- and speed sensor with an Arduino. It communicates over RS485 Modbus RTU, which I don't have any experience with.

The documentation is very short, and it just says:

9600bps, 8 bit, stop bit: 1, check bit: no Slave address is FFH.

Host Scan Order( slave address 0xFF) FF 03 00 00 00 02 D1D5

Slave Response FF 03 04 00 09 00 3A 0401

The bold parts are fixed, the last two bytes are for checksum. So the data of the response is direction in the two first bytes (00 09), and then speed in the two after that.

So basically I gotta send that exact byte sequence to the sensor, and then decode what I get. I'm not gonna need to do anything more advanced with this, and so I'm trying to figure out what the most easy way to do this is.

There are different modes, like single, mutliple registry, discrete values, coils, I don't know which one I'm supposed to pick, would be grateful if someone could take the time to explain to me how to do it.

  • the 03 is Read Holding Registers
    – Juraj
    Jul 3 '19 at 12:11
  • Thanks, Juraj! That helps. Do you know what the 04 is, is it some kind of address? Jul 3 '19 at 12:44
  • 04 is length of data. 4 bytes
    – Juraj
    Jul 3 '19 at 13:44
  • en.wikipedia.org/wiki/Modbus
    – Juraj
    Jul 3 '19 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.