Skip to content

saniya196/smart-farming-assistant-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌾 Smart Farming Assistant

🌱 About the Project

Smart Farming Assistant is a Java-based application built to help farmers monitor field conditions and make better decisions using simple data analysis.

The system takes inputs like moisture, temperature, humidity, pH, and light intensity, then suggests suitable crops, watering schedules, and fertilizer actions. It also detects risky conditions and generates alerts and daily reports.

This project combines core Java concepts, multithreading, file handling, and basic UI elements to simulate a real-world farming support system.


💡 Why I Built This

Farmers often don’t have access to real-time guidance for their crops. Most decisions are based on experience, which can lead to inefficiencies.

This project is a small step toward:

  • making farming decisions data-driven
  • reducing crop failure risks
  • improving resource usage

⚙️ What It Can Do

  • 🌾 Suggests crops based on field conditions

  • 💧 Recommends watering based on moisture levels

  • 🌿 Gives fertilizer advice based on environment

  • ⚠️ Detects and logs alerts for risky conditions

  • 📊 Calculates a simple field health score

  • 📁 Stores:

    • raw data
    • recommendation history
    • alerts
    • daily reports

🖥️ Interface

The project includes:

  • Console-based interaction (menu-driven system)
  • Basic GUI components for better usability

🛠 Tech Used

  • Java
  • OOP (Classes, Objects)
  • Multithreading (BlockingQueue, MonitorThread)
  • File Handling
  • Collections (ArrayList, Queue)

🧠 How It Works (Simple Flow)

  1. User enters field data

  2. Data is stored as a record

  3. It is passed into a queue

  4. A separate thread processes it

  5. System generates:

    • crop recommendations
    • watering advice
    • fertilizer suggestions
    • alerts
  6. Results are saved into files


📂 Project Structure

SmartFarmingAssistant-java/
├── SmartFarmingAssistant.java
├── DataRecord.java
├── RecommendationEngine.java
├── MonitorThread.java
├── SensorSimulator.java
├── FileManager.java
├── data.txt
├── history.txt
├── alerts.txt
├── daily_report.txt

▶️ How to Run

git clone https://github.com/saniya196/SmartFarmingAssistant-java.git
cd SmartFarmingAssistant-java
javac *.java
java SmartFarmingAssistant

📌 Example

Input:

Moisture: 35
Temperature: 29
Humidity: 55
pH: 6.8
Light: 450

Output:

Recommended Crops: Rice, Maize
Watering: Required
Fertilizer: Normal usage
Health: Good

🚀 Future Improvements

  • Better GUI using JavaFX or Swing
  • Integration with real sensor/IoT data
  • Database instead of text files
  • More accurate crop prediction logic

🎯 What I Learned

  • How to design a real-world problem using Java
  • Working with multithreading (producer-consumer flow)
  • Managing data using files
  • Structuring a modular application

👩‍💻 Author

Saniya Asreen GitHub: https://github.com/saniya196

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages