---
title: "IRIV IO Controller Series: RS-485 (Modbus) → Ethernet → Cloud (Blynk / ThingSpeak / MQTT) + Agricult"
url: "https://maker.wiznet.io/irina/projects/iriv-io-controller-series-rs-485-modbus--ethernet--cloud-blynk-thingspeak-mqtt-agricult/"
markdown_url: "https://maker.wiznet.io/irina/projects/iriv-io-controller-series-rs-485-modbus--ethernet--cloud-blynk-thingspeak-mqtt-agricult/md"
type: "UCC: User Created Content"
author: "Hussien Jawhar Sathik"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Hussien Jawhar Sathik"
published: "2025-08-27"
language: "en"
likes: 0
views: 2468
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# IRIV IO Controller Series: RS-485 (Modbus) → Ethernet → Cloud (Blynk / ThingSpeak / MQTT) + Agricult

> Read RS-485 Modbus sensors on IRIV, send data via WIZnet W5x00 to Blynk, ThingSpeak, and MQTT (Adafruit IO), then build an irrigation automation example.

Original author: Hussien Jawhar Sathik

## Article

This series shows how to read RS-485 (Modbus RTU) sensors on the **IRIV IO Controller** and send data over Ethernet using a **WIZnet W5x00** driver (CircuitPython) to three cloud paths—**Blynk**, **ThingSpeak**, and **MQTT (Adafruit IO)**—and then apply it to an **agriculture automation** example (moisture-based pump control).

H/W : IRIV IO Controller - <https://maker.wiznet.io/viktor/resellers/iriv%2Dio%2Dcontroller/>

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756370601%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756370658%2Epng)

## COMPONENTS

- IRIV IO Controller × 1 (RJ-45 Ethernet, RS-485, DO relay): with W5500

- RS-485 (Modbus RTU) Temp/Humidity Sensor × 1

- RS-485 Soil Sensor (Moisture/Temp/EC) × 1 (for automation section)

- 24 V DC Industrial Relay × 1 (pump/valve control)

- Ethernet network (DHCP recommended)

**Clicking the picture redirects you to the maker’s website.**

| [![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756372966%2Epng)](https://maker.wiznet.io/irina/projects/iriv%2Dio%2Dcontroller%2Diot%2Dgateway%2D%2Dblynk/) | [![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756372997%2Epng)](https://maker.wiznet.io/irina/projects/iriv%2Dio%2Dcontroller%2Diot%2Dgateway%2D%2Dthingspeak/) | [![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756373015%2Epng)](https://maker.wiznet.io/irina/projects/iriv%2Dio%2Dcontroller%2Diot%2Dgateway%2D%2Dmqtt/) | [![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756373026%2Epng)](https://maker.wiznet.io/irina/projects/automation%2Dof%2Dagriculture%2Dwith%2Diriv%2Dio%2Dcontroller/) |
| --- | --- | --- | --- |

## Table of Contents

1. Prerequisites & Common Architecture

2. Common Code Skeleton (W5x00 + Modbus)

3. Cloud Integrations and descriptions
  1. Blynk (Virtual Pins V0/V1)
  2. ThingSpeak (field1/field2)
  3. MQTT (Adafruit IO)

4. Agriculture Automation (Moisture-based Pump Control)

5. Which Platform When? (Quick Comparison)

6. Troubleshooting & Checklist

7. Future Content Directions

## 1. Prerequisites & Common Architecture

- **Hardware**: IRIV IO Controller; RS-485 sensors (T/RH, soil moisture/EC/temp); 24 V relay; Ethernet.

- **CircuitPython stack**: `adafruit_wiznet5k`, `adafruit_connection_manager`, `adafruit_requests`, `uModbus` (+ `adafruit_minimqtt` for MQTT).

- **Flow**: RS-485 Modbus read → scale/convert → upload (HTTP/MQTT) → visualize/control on cloud.

## 2. Common Code Skeleton (W5x00 + Modbus)

```python
import board, busio, digitalio
import adafruit_connection_manager, adafruit_requests
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
from umodbus.serial import Serial as ModbusRTUMaster

# Ethernet (DHCP)
cs  = digitalio.DigitalInOut(board.W5500_CS)
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
eth = WIZNET5K(spi, cs)
pool = adafruit_connection_manager.get_radio_socketpool(eth)
ssl  = adafruit_connection_manager.get_radio_ssl_context(eth)
requests = adafruit_requests.Session(pool, ssl)

# Modbus RTU master (UART)
host = ModbusRTUMaster(tx_pin=board.TX, rx_pin=board.RX)

# Example registers (may vary by sensor)
temperature = host.read_holding_registers(1, 1, 1)[0] / 10.0
humidity    = host.read_holding_registers(1, 0, 1)[0] / 10.0
```

## 3. Cloud Integrations and descriptions

### 3.1 Blynk (Virtual Pins V0/V1) : [link](https://maker.wiznet.io/irina/projects/iriv%2Dio%2Dcontroller%2Diot%2Dgateway%2D%2Dblynk/)

Create a Blynk device & dashboard, get your **Auth Token**, add V0=Temperature and V1=Humidity. Then push:

```plaintext
http://blynk.cloud/external/api/update?token=<TOKEN>&V0=<temp>&V1=<humi>
```

### Descriptions

The first example demonstrates integration with the **Blynk platform**.
The IRIV IO Controller reads sensor data via RS-485 and then sends it through Ethernet using simple **HTTP GET requests** to the Blynk cloud.
In the code, the values are mapped to **virtual pins V0 and V1** for temperature and humidity.
As a result, you can see the same data in both the local terminal and the Blynk mobile app.
The key point here is that **remote monitoring can be achieved with just a lightweight API setup**.

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756375028%2Epng)

### 3.2 ThingSpeak (field1/field2): [link](https://maker.wiznet.io/irina/projects/iriv%2Dio%2Dcontroller%2Diot%2Dgateway%2D%2Dthingspeak/)

Create a **ThingSpeak Channel**, copy the **Write API Key**, map fields, then call:

```plaintext
http://api.thingspeak.com/update?api_key=<WRITE_KEY>&field1=<temp>&field2=<humi>
```

### Descriptions

The second example uses **ThingSpeak**.
After creating an account, you generate a channel and obtain a **Write API Key**, which is placed in the code.
Like Blynk, the IRIV IO Controller reads sensor data over RS-485 and sends it via Ethernet with **HTTP requests**.
The main difference is that ThingSpeak automatically **plots the data as graphs** and stores it for analysis.
This shows that ThingSpeak is well-suited for **data logging and analytics-focused IoT services**.

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756375048%2Epng)

### 3.3 MQTT (Adafruit IO):[link](https://maker.wiznet.io/irina/projects/iriv%2Dio%2Dcontroller%2Diot%2Dgateway%2D%2Dmqtt/)

Create an Adafruit IO account, copy the **AIO Key**, put credentials in `settings.toml`, create feeds *Temperature*/*Humidity*, then publish:

```plaintext
# Topics
username/feeds/Temperature  ← <temp>
username/feeds/Humidity     ← <humi>
```

## Descriptions

The third example highlights the **MQTT protocol**.
Here, **Adafruit IO** is used as the MQTT broker.
Sensor data is published to dedicated feeds, for example, **‘Temperature’** and **‘Humidity’**.
The advantage of MQTT is its **lightweight publish/subscribe model**, which makes it highly scalable and reliable for large IoT deployments.
So while the first two methods rely on HTTP, this example demonstrates a more **industrial, scalable IoT architecture**.![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756375066%2Epng)

## 4. Agriculture Automation (Moisture-based Pump Control): [link](https://maker.wiznet.io/irina/projects/automation%2Dof%2Dagriculture%2Dwith%2Diriv%2Dio%2Dcontroller/)

- **Registers (example)**: Ambient RH=reg0 (÷10), T=reg1 (÷10); Soil T=reg6 (÷100), Moisture=reg7 (÷100), EC=reg8.

- **Actuation**: Drive a 24 V relay from DO0 to control a pump/valve.

- **Rule**: If `SoilMoisture ≥ threshold` → PUMP ON, else OFF. Report values & relay state to dashboard (e.g., Blynk V0–V5)

### Descriptions

“The final example is a **real-world application: agricultural automation**.
Multiple RS-485 sensors, measuring soil moisture, temperature, pH, and EC, feed data into the IRIV IO Controller.

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756377907%2Epng)
Based on the conditions, the controller **drives a relay to activate a water pump**.
Meanwhile, the same sensor data is also forwarded to** Blynk** for visualization.
This completes the cycle of **sensing → control → monitoring**, showing how IRIV IO Controller can be applied directly in agriculture.
It demonstrates not just data acquisition, but **closed-loop automation** in practice.”![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756375277%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756375310%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/860796700%5F1756375331%2Epng)

## 5. Which Platform When? (Quick Comparison)

| Goal | Platform | Why |
| --- | --- | --- |
| Mobile dashboard / quick UI | **Blynk** | Virtual pins + widgets; fast setup |
| Time-series logging / charts | **ThingSpeak** | Field-based HTTP updates; built-in plots |
| Real-time events / two-way | **MQTT (Adafruit IO)** | Pub/Sub; scalable & controllable |
| Edge automation (pump) | **Blynk + local logic** | Cloud viz + on-device decisions |

## 6. Troubleshooting & Checklist

- **Modbus values off**: Check slave addr, registers (0/1/6/7/8), baud/parity/stop, scaling (÷10/÷100).

- **No network**: Cable/switch/router; try static IP on W5x00 to isolate DHCP.

- **Blynk no updates**: Token + V-pins (V0/V1/…V5) + URL.

- **ThingSpeak no updates**: Write API Key + field mapping.

- **MQTT no publish**: AIO username/key in `settings.toml`, feed names, broker `io.adafruit.com`.

### 7. Future Content Directions

These four tutorials highlight that IRIV IO Controller can cover the full chain:
**sensor data acquisition → network transfer → cloud integration → automation control.**

The next steps of content we can expect include:

- **Security and Encryption**

Using TLS for MQTT, HTTPS data transfer, certificate management.

- **Edge AI Integration**

Running lightweight AI models on the controller for **predictive control**, not just monitoring.

- **Large-Scale IoT Platform Integration**

Connecting to AWS IoT Core, Azure IoT Hub, or Google Cloud IoT.

- **Expanded Industrial Applications**

Beyond agriculture: smart factories, building automation, energy management demos.

## Documents / Sources(Original Link)

- IRIV IO Controller IoT Gateway :[**Blynk**](https://my.cytron.io/tutorial/iriv-io-controller-iot-gateway-blynk)

- IRIV IO Controller IoT Gateway : [**ThingSpeak**](https://my.cytron.io/tutorial/iriv-io-controller-iot-gateway-thingspeak)

- IRIV IO Controller IoT Gateway : [**MQTT**](https://my.cytron.io/tutorial/iriv-io-controller-iot-gateway-mqtt)

- Sample Application: [**Agriculture Automation with IRIV**](https://my.cytron.io/tutorial/sample-application-automation-of-agriculture-with-iriv-io-controller)

---

Source: https://maker.wiznet.io/irina/projects/iriv-io-controller-series-rs-485-modbus--ethernet--cloud-blynk-thingspeak-mqtt-agricult/
