Skip to content

IshaanAyaan/GreenhouseAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GreenhouseAgent

GreenhouseAgent is a greenhouse monitoring and control stack that combines Arduino sensor ingestion, a FastAPI control service, a lightweight dashboard, and model-driven recommendations.

It keeps the operating loop in one place. Read sensor data. Pull weather context. Suggest or issue control actions. Keep an operator-visible log of what happened.

Greenhouse architecture

System

  • Arduino firmware reads temperature, humidity, and light
  • server/serial_relay.py bridges the serial stream into the API
  • server/main.py tracks live state, weather context, and actuator commands
  • web/ provides the operator dashboard
  • Online mode uses an OpenAI prompt path and local mode falls back to a Random Forest model

Project structure

  • arduino/ firmware for the sensor and actuator loop
  • server/main.py API server and greenhouse state manager
  • server/serial_relay.py serial bridge between the Arduino and the API
  • server/rf_recommendation.py offline recommendation path
  • web/ dashboard for readings, actuator state, weather, and recommendations
  • data/ sample readings and the shipped local model artifact

Setup

  1. Install dependencies
python3 -m pip install -r requirements.txt
  1. Flash arduino/greenhouse_uno/greenhouse_uno.ino to the Arduino

  2. Create a .env file with the keys below

OPENAI_API_KEY=sk-...
SUPABASE_URL=https://...
SUPABASE_KEY=...
SERIAL_PORT=/dev/ttyUSB0
  1. Start the API server
python3 server/main.py
  1. Start the serial relay
python3 server/serial_relay.py
  1. Open http://127.0.0.1:8000

Recommendation flow

  • A live reading becomes the current greenhouse state
  • Weather data is fetched for the configured coordinates
  • Online mode builds a recommendation from sensor state and forecast context
  • Local mode uses data/rf_model.joblib for offline fallback
  • Commands are normalized before they are sent to the actuator queue

Hardware

  • Arduino Uno or compatible board
  • DHT temperature and humidity sensor
  • Analog light sensor
  • Two servos for vent and shade control

Limitations

  • This is a single-greenhouse prototype
  • Operator review still matters for watering and hardware safety
  • The default weather coordinates point to Boston until changed in the dashboard

About

Greenhouse monitoring and control stack with sensor ingestion, actuator commands, weather context, and model-driven recommendations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors