IoT Sensor Network for Lion's Mane, Kale and Spinach
A small-scale IoT sensor network to monitor and optimize growing conditions for lion's mane mushrooms, kale and spinach, with real-time data tracking and alerts.
A compact IoT sensor network designed to monitor environmental conditions for lion's mane mushrooms, kale and spinach. This project tests the feasibility of smart farming by tracking temperature, humidity, light and soil moisture, with data accessible via a web dashboard and automated alerts for suboptimal conditions.
Features
- Real-Time Monitoring: Tracks temperature, humidity, light and soil moisture for lion's mane (15–22°C, 85–95% humidity, low light) and kale/spinach (18–24°C, 60–70% humidity, high light).
- Web Dashboard: Visualises live and historical data using a React interface.
- Automated Alerts: Sends notifications (email/SMS) when conditions deviate from optimal ranges.
- Manual Control: Relay controls a fan (mushrooms) or water pump (greens).
- Scalable Design: Modular setup supports additional sensors or crops.
- Low-Cost: Built with affordable components (< $100).
Implementation
The project uses an Arduino Uno (or ESP8266 for Wi-Fi) to collect data from a DHT22 (temperature/humidity), photoresistor (light) and capacitive soil moisture sensor. A 5V relay controls a fan or pump. Node.js with Express powers the backend, MongoDB stores data and AWS IoT Core enables cloud connectivity. A React dashboard displays data. The setup runs on USB power for testing, with plans for solar scalability.
Two grow zones are configured: one for lion's mane (high humidity, low light) and one for kale/spinach (moderate humidity, high light). Data is logged locally (SD card) or sent to AWS for remote access.
Challenges
- Sensor Calibration: Fine-tuned DHT22 for high humidity in the mushroom zone using manual gauges.
- Connectivity: Wi-Fi reliability issues mitigated with offline SD card logging and retry logic.
- Power: USB power limits scalability; solar integration planned for future iterations.
- Cost vs. Performance: Balanced affordability with reliability through modular design.
Feasibility Testing Goals
- Confirm accurate monitoring for lion's mane (85–95% humidity, low light) and kale/spinach (60–70% humidity, 6+ hours light).
- Verify alerts and actuator response (fan/pump) to real-time data.
- Evaluate scalability by testing sensor additions.
- Keep prototype costs under $100.
Scaling Up
- Add CO₂/pH sensors or Raspberry Pi for advanced processing.
- Integrate solar power (10W panel, battery) for sustainability.
- Enhance dashboard with machine learning for yield prediction or weather API integration.
- Expand to multiple grow zones or a full greenhouse with AWS IoT Core.
Getting Started
- Hardware: Buy Arduino Uno ($25), DHT22 ($5), photoresistor ($2), soil moisture sensor ($5), relay ($5). Set up in a grow box with lion's mane spawn and kale/spinach seedlings.
- Software: Clone repo (placeholder:
iot-crop-monitor
), install Node.js/MongoDB/React, flash Arduino firmware. - Test: Monitor for 2–4 weeks, adjust based on alerts/dashboard.
Considerations for Scalability
- Real-time monitoring of temperature (18–24°C), humidity (60–70%), light (6+ hours) and soil moisture.
- Next.js dashboard with Grafana for analytics.
- Automated irrigation, lighting and climate control via PLCs.
- LoRaWAN for long-range, low-power connectivity.
- Solar-powered with battery storage for off-grid operation.
- Machine learning for yield prediction.
Implementation
Uses Raspberry Pi for central processing, ESP32 for sensor nodes and BME680/TSL2591/VH400 sensors. Node.js with FastAPI and TimescaleDB manages data, hosted on AWS IoT Core with Kubernetes. LoRaWAN ensures connectivity. Hydroponics and LEDs optimise growth, powered by 500W solar arrays.
Challenges
- Connectivity in rural areas mitigated with LoRaWAN/5G hybrid.
- Sensor calibration automated via software.
- Data overload managed with edge computing and TimescaleDB.
- Security enforced with TLS and zero-trust policies.
Scaling Strategy
- Add sensor nodes and gateways for larger farms.
- Integrate TensorFlow Lite for predictive analytics.
- Expand solar capacity for full off-grid operation.
Iteration 2: Precision IoT Crop Monitoring System
Building on the insights from the initial prototype, Iteration 2 upgrades critical components to improve reliability, accuracy and scalability. This version replaces suboptimal sensors like the DHT22 and photoresistor with industrial-grade alternatives, integrates more powerful microcontrollers and expands cloud capabilities for long-term feasibility testing.
Key Improvements
-
High-Accuracy Sensors:
- Replaced DHT22 with Sensirion SHT45 (±0.1°C, ±1% RH).
- Replaced photoresistor with TSL2591 (up to 88,000 lux).
- Replaced capacitive moisture sensor with Vegetronix VH400.
- Optional: MH-Z19B CO₂ sensor and DFRobot analog pH sensor.
-
Microcontroller Upgrade:
- Moved to ESP32 (integrated Wi-Fi, deep sleep, ADC).
- Optional central node: Raspberry Pi 4 for data logging and edge processing.
-
Improved Architecture:
- Sensor nodes send data to a Pi gateway and onward to AWS IoT Core.
- Real-time alerting and data backup with TimescaleDB and Grafana.
- Offline logic for local actuator control using ESP32 or Pi.
-
Dashboard Upgrade:
- Next.js + Grafana dashboard with responsive UI, live and historical data, zone controls and actuator status.
-
Power:
- Outdoor zones run on 10W solar + battery.
- Indoor testing continues with USB/AC power.
Updated Feature Set
- Accurate sensor data across all ones.
- Configurable thresholds for fan/pump actuation.
- Modular plug-and-play sensor nodes.
- Edge logic for resilience during Wi-Fi dropouts.
Revised Challenges Addressed
- Replaced unreliable sensors with calibrated, industrial-grade hardware.
- Reduced false positives via precision readings.
- Better Wi-Fi stability with ESP32 retry logic and local fallback.
- Enabled off-grid operation with solar and battery management.
Feasibility Testing Goals – Round 2
- Compare new sensor data to manual gauges.
- Validate automated control of actuators.
- Test full system uptime for 4–6 weeks.
- Add and manage new sensor nodes dynamically.
Next Steps
- Add waterproof enclosures for outdoor deployment.
- Integrate CO₂ and pH monitoring for enhanced accuracy.
- Begin training machine learning models using local sensor data.
- Evaluate LoRa or Thread for future mesh scalability.