Soil Sensor System

A two-tier intelligent soil monitoring system. Zone sensors track full soil health. Plant-level sensors drive automated watering. All data publishes live to nahsfarmbot.org.

Arduino Nano RS485 ยท Modbus RTU Capacitive Sensors Flask ยท Python FarmBot REST API
Project Overview

System Architecture

An Arduino Nano acts as a sensor hub, reading zone-level soil health data via RS485 multi-sensors and plant-level moisture data via capacitive sensors. The Nano reports to the FarmBot Raspberry Pi over USB serial. The Pi uses the data to trigger automated watering sequences and publishes all readings live to nahsfarmbot.org.

๐ŸŒฑ
Soil Sensors
โ†’
๐Ÿ”ง
Arduino Nano
โ†’
๐Ÿ–ฅ๏ธ
FarmBot Pi
USB Serial
โ†’
๐Ÿ’ง
Auto Watering
REST API
โ†’
๐ŸŒ
Web Dashboard
Flask

Sensor Tiers

Zone Sensors RS485 ยท 7-in-1

One per growing zone. Provides a full soil health picture for maintenance decisions and long-term trend monitoring.

  • Moisture ยท Temperature ยท EC
  • pH ยท Nitrogen ยท Phosphorus ยท Potassium
  • Modbus RTU over RS485 via MAX485
  • 12V DC โ€” powered from bed supply
  • 120ฮฉ termination resistor at far end
Plant Sensors Capacitive

One per plant location. Measures soil moisture only. Drives individual automated watering decisions via FarmBot REST API.

  • Analog moisture reading per plant
  • Mapped to FarmBot XY coordinates
  • Calibrated dry/wet threshold per soil type
  • Up to 6 sensors per Arduino Nano (A0โ€“A5)
  • Expand with second Nano for more plants

Bill of Materials

Component
Qty
Purpose
RS485 7-in-1 Soil SensorALOUTSNOC TH-EC-PH-NPK โ€” amazon.com/dp/B0CXLHMYZX
2
Zone soil health โ€” moisture, temp, EC, pH, NPK
Capacitive Soil Moisture SensorsAITRIP 10-pack โ€” amazon.com/dp/B094J8XD83
1 pack
Plant-level moisture โ€” 8โ€“12 plants + spares
MAX485 TTL to RS485 ModulesDORHEA 12-pack โ€” amazon.com/dp/B094MKRTRC
1 pack
RS485 interface for Nano โ€” use 2, 10 spares
Arduino Nano
1
Sensor hub โ€” already on hand
Cat5 Cable
As needed
Sensor wiring loom โ€” already on hand
12V Power Supply
1
Zone sensor power โ€” already at bed
Weatherproof Enclosure
1
Houses Nano + MAX485 โ€” 3D printed at school

โš  Wiring Notes

Build Phases

1
Single capacitive sensor read
Nano reads one capacitive sensor and prints to Serial Monitor โ€” basic analog read confirmed.
2
Multi-sensor JSON output
Nano reads all capacitive sensors and formats labeled JSON output โ€” multi-sensor read working.
3
RS485 zone sensor via Modbus
Nano reads RS485 zone sensor through MAX485 module using Modbus RTU protocol via ModbusMaster library.
4
Pi reads Nano over serial
Python script on FarmBot Pi requests and parses all sensor readings from Nano via USB serial.
5
Automated watering
Pi compares readings to calibrated thresholds and triggers FarmBot watering sequences via REST API, moving to saved XY coordinates per plant.
6
Live web dashboard
Flask endpoints added to nahsfarmbot.org โ€” live moisture per plant, zone NPK/pH/EC readings, and watering history displayed on a public dashboard.

Calibration Notes

3D Printed Enclosure

The junction box housing the Nano and MAX485 modules is a good candidate for the school 3D printer. Design it to mount cleanly on the FarmBot bed frame with neat cable management.

๐Ÿ”ฉ Mounting bosses for Nano + 2x MAX485
๐Ÿ”Œ Strain relief holes for Cat5 jacket
๐Ÿ’ป Cutout for USB cable to Pi
๐Ÿ”’ Lid with overlap lip for moisture resistance
๐Ÿ“Ž Mounting tabs for bed frame attachment
๐Ÿ—‚ Cable management channel along frame