Skip to content

FarmTracka is a comprehensive agricultural monitoring platform that leverages sensor data and machine learning algorithms to predict plant health and provide actionable recommendations to farmers, ultimately enhancing crop yield and sustainability.

License

Notifications You must be signed in to change notification settings

salimcodes/FarmTracka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FarmTracka: Your Farm's Digital Guardian

Up to 40% of farmers in Nigeria lose their crops due to preventable factors. FarmTracka is an intelligent web application designed to help farmers monitor the health of their plants based on environmental conditions such as light intensity, temperature, and humidity. Using machine learning and AI-powered advice, FarmTracka provides predictions on plant status and offers AI-enabled personalized advice to maintain plant health.

Table of Contents

Installation

Before you begin, ensure you have Python 3.7+ installed. Follow these steps to set up the environment and install the necessary packages:

  1. Clone the repository:

    git clone https://github.com/yourusername/farmtracka.git
    cd farmtracka
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt

Data Preparation

To prepare the data for training, follow these steps:

  1. Load the dataset from an Excel file using pandas.
  2. Handle any missing values by dropping or imputing them.
  3. Split the data into features (light intensity, temperature, humidity) and the target (plant growth status).
  4. Encode the target variable using LabelEncoder from scikit-learn.

Model Training

The model underneath was trained using the RandomForest classifier:

  1. Initialize the RandomForest Classifier model.
  2. Train the model on the prepared dataset.

Streamlit App Development

Develop the Streamlit app to interact with the model and get advice:

  1. Set up the Streamlit app structure.
  2. Create input fields for light intensity, temperature, humidity, and API key.
  3. Implement the prediction logic to display the predicted plant status.
  4. Fetch advice using the Snowflake Arctic Instruct API and display it in the app.

Running the Application

To run the application, use the following command:

streamlit run app.py

This command starts the Streamlit server and opens the app in your default web browser.

Hardware

  • For Humidity:

image

  • For Light Intensity:

image

  • For Temperature:

    image

Usage

  1. Open the Streamlit app in your web browser.
  2. Enter the light intensity, temperature, and humidity levels.
  3. Provide your Snowflake Arctic Instruct API key.
  4. Click the 'Predict Plant Status and Advice the Farmer' button to get the plant status and personalized advice.

Acknowledgements

  • The machine learning model was trained using the RandomForest Classifier.
  • The app fetches advice using the Snowflake Arctic Instruct via the Replicate API.
  • Special thanks to the open-source community for providing the tools and resources used in this project.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

This is the hardware part of the solution!

Description

FarmTracka is an application designed for agricultural monitoring and management. It utilizes two hardware components: a light intensity sensor - a Photoresistor (a LDR - Light Dependent Resistor) and a DHT11 sensor (i.e. Digital Humidity and Temperature Sensor) for temperature and humidity sensing. These sensors are interfaced with an Arduino microcontroller to collect environmental data, which is then displayed on an LCD screen. The project consists of two main components: sensing.ino for data collection and actuating.ino for displaying sensor values on the LCD screen.


Folder Structure

  • sensing:

    • sensing.ino: Arduino code for collecting data from sensors and sending it to the serial monitor and then exported to a spreadsheet using Coolterm, a freeware serial port terminal app and networking program.
  • actuating:

    • actuating.ino: Arduino code for displaying sensor data on the LCD screen.

Hardware Requirements

  • Arduino Uno Microcontroller
  • DHT11 Temperature and Humidity Sensor
  • Light Intensity Sensor- Photoresistor i.e. a LDR - Light Dependent Resistor
  • LCD Screen
  • Resistors, wires, and breadboard (for circuit connection)

Setup Instructions

  1. Connect the DHT11 Temperature and Humidity Sensor to the designated pin on the Arduino board.
  2. Connect the Light Intensity Sensor to the analog pin of the Arduino board.
  3. Wire the LCD screen according to the pin configurations specified in the code (rs, en, d4, d5, d6, d7).
  4. Upload the sensing.ino code to the Arduino board to read sensor data.
  5. Upload the actuating.ino code to the Arduino board to display sensor data on the LCD screen.

Operation

  1. Upon powering the Arduino board, the sensing.ino code starts collecting data from the sensors.
  2. The temperature, humidity, and light intensity readings are displayed on the serial monitor.
  3. Simultaneously, the actuating.ino code displays the sensor data on the connected LCD screen.
  4. The data is updated at regular intervals, providing real-time environmental information.

About

FarmTracka is a comprehensive agricultural monitoring platform that leverages sensor data and machine learning algorithms to predict plant health and provide actionable recommendations to farmers, ultimately enhancing crop yield and sustainability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages