Reinforcement learning · IoT · In progress
Hydroponics AI
A hydroponics controller in which a reinforcement-learning policy decides nutrient dosing from live sensor readings, instead of fixed thresholds.
- Year
- 2026 · in progress
- Funding
- STEAM research grant, Ministry of Education, Science and Technology, Nepal
- Hardware
- Sponsored by DFRobot
01 Problem
Hydroponic farms dose nutrients on fixed thresholds, which wastes nutrients and caps yield.
The research goal is closed-loop control: Q-learning and PPO policies that keep pH and EC on target against environmental drift, deciding each dose from what the sensors report.
02 How it works
- Sensors
- 2× ESP32
- MQTT
- FastAPI
- RL policy
- Pumps & dosing
Embedded control
Two ESP32 boards and a Raspberry Pi run six sensing and control workflows, reading pH, EC, temperature and humidity sensors.
Pumps and dosing over MQTT
Sensor readings and actuator commands travel over MQTT to drive the pumps and nutrient dosing.
RL dosing policy
A reinforcement-learning policy built with PyTorch and Gymnasium decides the dosing.
Real-time backend
A FastAPI service with MQTT and WebSocket support handles live monitoring and automation, and backs the computer-vision pipeline.
Live video
LiveKit streams the plants in real time, so growth can be monitored remotely.
Mobile app
A Flutter app shows sensor data and live video, and controls the system remotely.
Edge deployment
The system runs on a local edge server for real-time processing and device communication.
03 DFRobot sponsorship
When the project needed hardware, I asked for it.
I emailed DFRobot directly with the research vision for Hydroponics AI. After reviewing the proposal and the project’s STEAM grant selection, DFRobot came on board as hardware sponsor and provided the components below.
Sensors
- pH probes
- CO₂ sensor
- DHT22 temperature & humidity
- Spectrometer sensor
- Waterproof ultrasonic sensor
Compute
- ESP32-S3 AI camera
- ESP32-P4
04 Stack
Machine learning
- PyTorch
- Gymnasium
Embedded
- ESP32 (C++)
- Raspberry Pi
- MQTT
Backend & app
- FastAPI
- WebSockets
- LiveKit
- Flutter
05 Next project
Computer vision · Android · Nepal ICT Award 2024