Wiznet makers

irina

Published August 27, 2025 ©

109 UCC

5 WCC

88 VAR

0 Contests

0 Followers

0 Following

Original Link

Automation of Agriculture With IRIV IO Controller

Automate irrigation with IRIV IO Controller: read RS-485 soil & ambient sensors, drive a 24 V relay by moisture, and push data to Blynk over Ethernet.

COMPONENTS
PROJECT DESCRIPTION

This project uses an IRIV IO Controller to automate irrigation: it reads soil and ambient conditions from RS-485 (Modbus RTU) sensors and drives a 24 V DC relay (water pump) based on moisture thresholds. Data is visualized in a Blynk dashboard via Ethernet (WIZnet W5x00, CircuitPython). The tutorial lists the exact sensors, wiring, Modbus register map, and a working example. 


🔧 Project Overview

Project Name: Sample Application: Automation of Agriculture with IRIV IO Controller
Author (Tutorial): Hussien Jawhar Sathik (Cytron)
Platform: IRIV IO Controller (CircuitPython)
Networking: WIZnet W5x00 (adafruit_wiznet5k) over Ethernet
Field Bus: RS-485 (Modbus RTU)
Actuator: 24 V DC Industrial Relay on DO0 (water pump)
Cloud/App: Blynk (virtual pins for all measurements + pump status) 


⚡ How the Project Works

1) Hardware Setup

  • IRIV IO Controller
  • Industrial RS-485 4-in-1 Soil Sensor (pH, Moisture, Temperature, EC)
  • Industrial RS-485 Temperature & Humidity Sensor
  • 24 V DC Industrial Relay (driven from DO0)
  • Ethernet (DHCP recommended) 

2) Protocols & Control

  • Modbus RTU register map (example in tutorial):
  • Ambient: humidity=reg 0, temperature=reg 1
  • Soil: temperature=reg 6, moisture=reg 7, EC=reg 8
    Values are scaled (e.g., ÷10 or ÷100).
  • Decision logic: If SoilMoisture < 50%, pump OFF; otherwise ON (adjustable). Relay status is also sent to Blynk. 
  • Networking: W5x00 initialized via SPI, HTTP session created, and Blynk virtual pins (V0–V5) updated. 

3) Development Process

Wire sensors (both on RS-485) and relay to DO0; verify connections before power-up. 

Program IRIV in CircuitPython; confirm each sensor’s starting register addresses (ambient vs. soil). 

Create Blynk dashboard with datastreams: V0=Ambient T, V1=Ambient RH, V2=Soil T, V3=Soil Moisture, V4=EC, V5=Pump status. 


💡 Key Features & Benefits

Features

End-to-end automation: Sensing (Modbus RTU) → decision → actuation (relay). 

Clear register map & code: Ready-to-run example with Blynk V-pins.

Robust wired uplink: WIZnet W5x00 + HTTP updates.

Applications

Irrigation control, greenhouses, smart farms: Moisture-driven pump control with live telemetry. 


Code Highlights (Essentials)

The tutorial shows a complete CircuitPython example using adafruit_wiznet5k, adafruit_requests, and uModbus, updating Blynk V0–V5. Replace the token and adjust thresholds/registers as needed.

# Blynk + Modbus RTU + W5x00 (essentials)
BLYNK_TOKEN = "YOUR_BLYNK_TOKEN"                 # replace
UPDATE_URL  = "http://blynk.cloud/external/api/update"

# Read Modbus registers (addr 1): ambient RH=0, T=1; soil T=6, moisture=7, EC=8
AmbT  = host.read_holding_registers(1, 1, 1)[0] / 10.0
AmbRH = host.read_holding_registers(1, 0, 1)[0] / 10.0
SoilT = host.read_holding_registers(1, 6, 1)[0] / 100.0
SoilM = host.read_holding_registers(1, 7, 1)[0] / 100.0
EC    = host.read_holding_registers(1, 8, 1)[0]

# Moisture rule → drive DO0 (pump)
relay_on = SoilM >= 50.0
switch.value = relay_on
status = "PUMP ON" if relay_on else "PUMP OFF"

# Push to Blynk (V0..V5)
for v, val in zip(("V0","V1","V2","V3","V4","V5"),
                  (AmbT, AmbRH, SoilT, SoilM, EC, status)):
    requests.get(f"{UPDATE_URL}?token={BLYNK_TOKEN}&{v}={val}")

See the tutorial for the full script, including W5x00 init, session creation, and the V-pin table


Troubleshooting Tips

Wrong values? Confirm each sensor’s starting register and scaling (÷10/÷100). 

Pump never toggles? Check DO0 wiring, relay coil voltage (24 V), and threshold logic.

No dashboard updates? Verify Blynk token, V-pin names (V0–V5), and network reachability. 

 

Documents
Comments Write