Wiznet makers

Benjamin

Published November 30, 2023 ©

28 UCC

10 WCC

1 VAR

0 Contests

0 Followers

1 Following

Smart Farm Station (Basil cultivation)

This project aims to develop a smart farm system for basil cultivation. It utilizes an AI-based monitoring system and automated environmental control to achieve

COMPONENTS Hardware components

WIZnet - W5100S-EVB-Pico

x 1


ArduCam - Arducam Mini 2MP Plus

x 1

Software Apps and online services

Adafruit - Circuitpython

x 1


Streamlit - Streamlit

x 1


Python - Python

x 1


PROJECT DESCRIPTION

Basil Cultivation Smart Farm Station

Introduction

This project aims to develop a smart farm system for basil cultivation. It utilizes an AI-based monitoring system and automated environmental control to achieve efficient plant cultivation.

Begin by asking ChatGPT about the best conditions for growing basil.

Technology Stack & Tools

  • Programming Language: Python
  • Web Framework: Streamlit
  • AI Modeling: YOLOv8 for image detection
  • Hardware Control: W5100S-EVB-Pico board, TCP communication for smart farm control

Team Composition & Roles

My Role:

  • AI Modeling: Using YOLOv8 for analyzing plant growth and health status
  • Web Application Development: Building an interface with Streamlit
streamlit run main.py
  • Camera Server Setup: Capturing and transmitting real-time images from the smart farm

Theo's Role:

  • Smart Farm Control System Development: Managing hardware and sensor data integration for the smart farm 

 

Web Application Design & Features

Real-Time Monitoring

  • The web application, developed using Streamlit, enables users to view real-time images and sensor data (temperature, humidity, brightness) of the smart farm.
  • Supports database reset functionality.
  • Code Example:
st.image(img, use_column_width=True)
df = pd.DataFrame(sensor_data, columns=['Date', 'Temperature', 'Humidity', 'Brightness'])
st.table(df)

Start Cultivation Button

  • Pressing the 'Start Cultivation' button sends optimal initial values for basil cultivation (Temperature: 23°C, Humidity: 55%, Brightness: 500, Watering Cycle: 36 hours) to the TCP Client controlling the sensors via the Pico.
  • Initiates the display of growth information (e.g., time elapsed since cultivation start, current growth stage)
  • Code Example:
if st.button('🌱 재배 시작!', key='start_growing_button'):
    st.session_state['start_time'] = datetime.now()
    tcp_client_send_data()

Current Status Button

  • The 'Current Status' button fetches and displays the latest image from the Camera server, updating the on-screen visuals with the current status of the smart farm.
  • Code Example:
if 'refresh_image' in st.session_state:
    img_url = "http://192.168.0.10/16"
    response = requests.get(img_url)
    new_image_path = os.path.join(image_save_path, f'image_{st.session_state["refresh_image"].strftime("%Y%m%d%H%M%S")}.jpg')
    with open(new_image_path, 'wb') as file:
        file.write(response.content)
    st.session_state.pop('refresh_image

 

Results & Future Plans

As of the current date (November 28, 2023), the smart farm system has been set up, and basil has been planted. It is expected that cotyledons (seed leaves) will develop around 7 to 10 days after planting. Updates will be provided as the plants grow and reach different stages of development. Stay tuned for further updates on the progress and growth of the basil in our smart farm system.

Additionally, we plan to incorporate an AI model into the system. This AI feature will detect the condition of basil leaves, identifying whether they are healthy, affected by fusarium, or showing signs of powdery mildew. This enhancement aims to provide more precise and automated monitoring of plant health within the smart farm environment.

Documents
  • webui - Streamlit app

  • Camera Server - W5100S-evb-pico with Arducam

Comments Write