📓
Enginique Docs
HomeHow-to
  • Documentation Home
  • Single Board Computers
    • Engage
  • Industrial Devices
    • Evolve
      • Calibration
      • Reprogramming
    • Evolve 'R
    • Energy Analyzer
    • R'IO: Mini PLC
  • Sensor Modules
    • Bioacoustics Module
    • CO2 RHT Module
    • Environmental Module
    • Hall Effect Module
    • I2C Adapter Module
    • IMU Module
    • Irradiance Module
    • Positioning Module
    • Presence Module
    • RTD Module
  • Extension Boards
    • NFC Broker
  • Connectivity Modules
    • M.2 BLE 802.15.4 Module
    • M.2 CAT-M NB-IoT Module
    • M.2 Developer Module
    • M.2 LEO Satellite Module
    • M.2 LoRa Module
    • M.2 WiFi Module
  • Robotics
    • Wheeled Robot Controller
  • Environmental Monitoring
    • Air Quality Sensor
      • Modbus Protocol
    • Environmental Sensor
      • Modbus Protocol
    • Depth Sensor
      • Modbus Protocol
    • Irradiance Sensor
      • Modbus Protocol
    • Mechanical Wind Sensor
      • Modbus Protocol
    • Rain Gauge
      • Modbus Protocol
    • Soil Sensor
      • Modbus Protocol
    • Ultrasonic Wind Sensor
      • Modbus Protocol
  • Value-Line Devices
    • Sensor Carrier BLE
    • Sensor Carrier LoRa
  • Communication Protocols
    • CoAP
    • LoRaWAN
    • Matter
    • Modbus
    • MQTT
  • Libraries
    • ACS71240 Current Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • Adrastea-I Cellular Module
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • BME280 Env Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • BME688 Env Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • BGT60TR13C Radar Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • DS18B20 Temp Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • EEPROM Memory
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • Elara-I Positioning Module
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • Irradiance Meter
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • LIS3DH IMU
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • MAX31865 RTD Converter
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • MCP23 Series Expander
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • SCD4x CO2 Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • SEN5x Air Quality Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • ST25R3916 NFC Device
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • SX1262 LoRa Transceiver
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • TMAG5273 Hall Effect Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • TSL2540 Light Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WL-ICLED
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WSEN-HIDS Humidity Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WSEN-PADS Pressure Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
    • WSEN-TIDS Temperature Sensor
      • Arduino / ESP32
        • Arduino (C/C++)
        • MicroPython
      • Raspberry Pi OS
        • Go
        • Python
      • STM32
        • C
        • MicroPython
  • Important Notice
Powered by GitBook

Copyright (c) 2024 Enginique.

On this page
  • Device Address
  • Modbus Function Codes
  • Device Registers
  • Communication Syntax
  • Reading sensor data
  • Reading configuration register
  • Writing single configuration register
  • Writing multiple configuration registers
Export as PDF
  1. Environmental Monitoring
  2. Environmental Sensor

Modbus Protocol

This device communicates using the Modbus RTU protocol over the RS-485 standard.

Device Address

This device's preconfigured user-definable address is 0x18. Users can change the address using the holding registers.

Modbus Function Codes

The following Modbus function codes are functional with this device.

Command Register
Function
Description
Bytes

0x03

Read holding registers

Returns configuration parameters

2

0x04

Read input registers

Returns measured readings and statistics

2

0x06

Write single register

Writes a single configuration parameter

2

0x10

Write multiple registers

Writes multiple configuration parameters

2 x N

Device Registers

The following registers are available with this device.

Register Type
Register Address
Description
Bytes

Input Register (R)

0x0001

Temperature (Actual)

2

Input Register (R)

0x0002

Temperature (Average)

2

Input Register (R)

0x0003

Temperature (Min)

2

Input Register (R)

0x0004

Temperature (Max)

2

Input Register (R)

0x0005

Temperature (Std. Dev.)

2

Input Register (R)

0x0006

Relative Humidity (Actual)

2

Input Register (R)

0x0007

Relative Humidity (Average)

2

Input Register (R)

0x0008

Relative Humidity (Min)

2

Input Register (R)

0x0009

Relative Humidity (Max)

2

Input Register (R)

0x000A

Relative Humidity (Std. Dev.)

2

Input Register (R)

0x000B

Pressure (Actual)

2

Input Register (R)

0x000C

Pressure (Average)

2

Input Register (R)

0x000D

Pressure (Min)

2

Input Register (R)

0x000E

Pressure (Max)

2

Input Register (R)

0x000F

Pressure (Std. Dev.)

2

Input Register (R)

0x0010

Device Pitch (Actual)

2

Input Register (R)

0x0011

Device Roll (Actual)

2

Input Register (R)

0x0012

Device Temperature

2

Holding Register (R/W)

0x0101

Device Address

2

Holding Register (R/W)

0x0102

Baud Rate

2

Holding Register (R/W)

0x0103

Statistics Period (Secs)

2

Holding Register (R/W)

0x0104

IMU Correction (Pitch)

2

Holding Register (R/W)

0x0105

IMU Correction (Roll)

2

Holding Register (R/W)

0x0106

Temperature Correction 1

2

Holding Register (R/W)

0x0107

Temperature Correction 2

2

Holding Register (R/W)

0x0108

Temperature Correction 3

2

Holding Register (R/W)

0x0109

RH Correction 1

2

Holding Register (R/W)

0x010A

RH Correction 2

2

Holding Register (R/W)

0x010B

RH Correction 3

2

Holding Register (R/W)

0x010C

Pressure Correction 1

2

Holding Register (R/W)

0x010D

Pressure Correction 2

2

Holding Register (R/W)

0x010E

Pressure Correction 3

2

Communication Syntax

Reading sensor data

The host device can read one or more sensor data by calling the starting register address.

Request from the host: Device address [1 Byte] + Function code (0x04) [1 Byte] + Input register start address [2 Bytes MSB first] + Requested register length [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Response from the device: Device address [1 Byte] + Function code (0x04) [1 Byte] + Response register length in Bytes [1 Byte] + Register 1 [2 Bytes MSB first] + Register N [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Reading configuration register

The host device can read one or more configuration registers by calling the starting register address.

Request from the host: Device address [1 Byte] + Function code (0x03) [1 Byte] + Holding register start address [2 Bytes MSB first] + Requested register length [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Response from the device: Device address [1 Byte] + Function code (0x03) [1 Byte] + Response register length in Bytes [1 Byte], Register 1 [2 Bytes MSB first] + Register N [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Writing single configuration register

The host device can write one configuration register.

Command from the host: Device address [1 Byte] + Function code (0x06) [1 Byte] + Holding register address [2 Bytes MSB first] + Value to be set [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Response from the device: Device address [1 Byte] + Function code (0x06) [1 Byte] + Holding register address [1 Byte] + Value set [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Writing multiple configuration registers

The host device can write multiple configuration registers.

Command from the host: Device address [1 Byte] + Function code (0x10) [1 Byte] + Holding register start address [2 Bytes MSB first] + Requested register length [2 Bytes] + Configuration values length in Bytes [1 Byte] + Value to be set 1 [2 Bytes MSB first] + Value to be set N [2 Bytes MSB first] + CRC [2 Bytes MSB first]

Response from the device: Device address [1 Byte] + Function code (0x10) [1 Byte] + Holding register start address [1 Byte], Value set [2 Bytes MSB first], CRC [2 Bytes MSB first]

Last updated 1 year ago