Reference

The RS485 Wind Direction Transmitter V2 utilizes Modbus RTU protocol for communication, providing accurate wind direction data through a low-inertia wind vane and hall sensor. The library supports initialization and reading of wind direction via core methods, ensuring precise measurements in outdoor environments with a durable design.

Library

  • Library Name: RS485_Wind_Direction_Transmitter_V2
  • Download Link: GitHub Repository
  • Installation: Extract the library ZIP file and copy it to your Arduino IDE’s libraries folder (usually located at Documents/Arduino/libraries). Restart the IDE to load the library.

Communication Protocol Description

  • The default communication parameters are: baud rate 9600bps, one start bit, 8 data bits, no parity, and one stop bit.

  • Modbus Register

Parameter Register Add. Function Type Function No. Parameter Range & Description Default Value
Wind Direction of 360° 0x0000 INT16 RO 0x03/reading 0x00-0xE10 (hexadecimal) None
16 Wind Directions 0x0001 INT16 RO 0x03/reading 0x00-0x0F (hexadecimal) None
Modbus Slave Address 0x1000 INT16 reading-and-writing 0x03/reading
0x10/writing
0x00-0xFF (hexadecimal) 2
  • Modbus Register Parameter Instruction
Wind Direction of 360°
Parameter Range 0x00-0xE10 (hexadecimal) Default Value: none
Parameter Storage None

Indication: the wind direction measured in degrees (°) from 0° to 360°

Example: If the returned value is 02 8F (hexadecimal) = 655 (decimal) ÷ 10 = 65.5°, the degree is the angle with the true north (i.e. 0°).

16 Wind Directions
Parameter Range 0x00-0x0F (hexadecimal) Default Value: none
Parameter Storage None

Indication: the wind value of 16 directions

Example: If the returned value is 00 04 (hexadecimal, true form), the high byte of the first byte is 00, the low byte of the second byte is 04, and the measured wind direction value is (00*256+04)=4, 0 for true north and clockwise 4 for true east.

Modbus Slave Add. (ADDRESS)
Parameter Range 0-255 Default Value: 2
Parameter Storage Immediate storage

Modbus address can be set to 0-255. You can use 0 address to set any address.

Example

  1. Read the 360° wind direction angle (Modbus slave address 0x02)

    Host query frame (hexadecimal): 02 03 00 00 00 01 84 39 (8byt)

    Slave Add. Function Code Register Start Add. Length of Register High Bits of Check Code Low Bits of Check Code
    1byt 1byt 2byt 2byt 1byt 1byt
    0×02 0x03 0x00 0x00 0x00 0x01 0x84 0x39

    Slave response frame (hexadecimal): 02 03 02 02 8F BC 80 (7byt)

    Slave Add. Function Code Number of Valid Bytes Data Aera High Bits of Check Code Low Bits of Check Code
    1byt 1byt 1byt 2byt 1byt 1byt
    0×02 0x03 0x02 0x02 0x8F 0xBC 0x80

    Wind angle value = 02 8F (hex) = 655 (decimal) ÷ 10 = 65.5°, which is the angle with the true north (i.e. 0°).

  2. Read the 16 wind directions (Modbus slave address 0x02)

    Host query frame (hexadecimal): 02 03 00 01 00 01 D5 F9(8byt)

    Slave Add. Function Code Register Start Add. Length of Register High Bits of Check Code Low Bits of Check Code
    1byt 1byt 2byt 2byt 1byt 1byt
    0x02 0x03 0x00 0x01 0x00 0x01 0xD5 0xF9

    Slave response frame (hexadecimal): 02 03 02 00 03 BC 45 (7byt)

    Slave Add. Function Code Number of Valid Bytes Data Aera High Bits of Check Code Low Bits of Check Code
    1byt 1byt 1byt 2byt 1byt 1byt
    0×02 0x03 0x02 0x00 0x03 0xBC 0x45

    16 directions value = 00 03 = 3, the direction is east-northeast according to the table below.

    Correspondence Table

    Direction 16 Directions Value 360°
    North 0 0° - 11.2°
    North-northeast 1 11.3° - 33.7°
    Northeast 2 33.8° - 56.2°
    East-northeast 3 56.3° - 78.7°
    East 4 78.8° - 101.2°
    East-southeast 5 101.3° - 123.7°
    Southeast 6 123.8° - 146.2°
    South-southeast 7 146.3° - 168.7°
    South 8 168.8° - 191.2°
    South-southwest 9 191.3° - 213.7°
    Southwest 10 213.8° - 236.2°
    West-southwest 11 236.3° - 258.7°
    West 12 258.8° - 281.2°
    West-northwest 13 281.3° - 303.7°
    Northwest 14 303.8° - 326.2°
    North-northwest 15 326.3° - 348.7°
    North 16 348.8° - 360°
  3. Read device Modbus slave address

    You can query the devices at any address using 0x00 address (broadcast address).

    Host query frame (hexadecimal): 00 03 10 00 00 01 81 1B (8byt)

    Slave Add. Function Code Register Start Add. Length of Register High Bits of Check Code Low Bits of Check Code
    1byt 1byt 2byt 2byt 1byt 1byt
    0x00 0x03 0x10 0x00 0x00 0x01 0x81 0x1B

    Slave response frame (hexadecimal): 00 03 02 00 15 8C D8 (7byt)

    Slave Add. Function Code Number of Valid Bytes Data Aera High Bits of Check Code Low Bits of Check Code
    1byt 1byt 1byt 2byt 1byt 1byt
    0×00 0x03 0x02 0x00 0x15 0x8C 0xD8

    Current device Modbus slave address = 00 15 (hex), i.e. the current device Modbus slave address is 0x15.

  4. Change register 0x1000, i.e. change Modbus slave address (ADDRESS)

    Change Modbus slave address to 03

    You can set the devices at any address using the 0x00 address (broadcast address).

    Host query frame (hexadecimal): 00 10 10 00 00 01 02 00 03 FA 00 (11byt)

    Slave Add. Function Code Register Start Add. Length of Register Number of Valid Bytes Slave Add. to Be Written High Bits of Check Code Low Bits of Check Code
    1byt 1byt 2byt 2byt 1byt 2byt 1byt 1byt
    0x00 0x10 0x10 0x00 0x00 0x01 0x02 0x00 0x03 FA 00

    Slave response frame (hexadecimal): 00 10 10 00 00 01 04 D8 (7byt), and that indicates the modification is successful.

    Slave Add. Function Code Register Add. Length of Register High Bits of Check Code Low Bits of Check Code
    1byt 1byt 2byt 2byt 1byt 1byt
    0x00 0x10 0x10 0x00 0x00 0x01 0x04 0xD8

Principle

The sensor uses a low-inertia wind vane to detect wind direction. When the wind changes direction, the vane’s tail wing rotates, driving an axle magnet through the shaft. A built-in hall sensor detects the magnet’s position and outputs digital wind direction data (360° angle or 16-point direction). The aluminum alloy shell and military-grade connector ensure durability in harsh outdoor environments.

Other Supplementary Information

  1. Wire Color Definition:

    Color Function
    Red Positive (+)
    Black Negative (-)
    Yellow RS485+/A/T+
    Green RS485-/B/T-
  2. Installation Guidelines:
    The white dot on the sensor must face true north during installation to ensure accurate wind direction readings.

  3. Dimension Diagram:
    Product Dimensions

Was this article helpful?

TOP