Wiznet makers

irina

Published August 27, 2025 ©

109 UCC

5 WCC

88 VAR

0 Contests

0 Followers

0 Following

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.

COMPONENTS
PROJECT DESCRIPTION

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/

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.

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)

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

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

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.

3.2 ThingSpeak (field1/field2): link

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

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.

3.3 MQTT (Adafruit IO): link

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

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

4. Agriculture Automation (Moisture-based Pump Control): link

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


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

5. Which Platform When? (Quick Comparison)

GoalPlatformWhy
Mobile dashboard / quick UIBlynkVirtual pins + widgets; fast setup
Time-series logging / chartsThingSpeakField-based HTTP updates; built-in plots
Real-time events / two-wayMQTT (Adafruit IO)Pub/Sub; scalable & controllable
Edge automation (pump)Blynk + local logicCloud 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)

 

 

Documents
Comments Write