Table of Contents

Smart Plant Monitoring System

Student: Nicusor-Mirel Drogeanu
Master: ACES II
Git repository: https://github.com/DrogeanuNicu/iot_project
Demo link: https://drive.google.com/file/d/1pQIGBkYDs_wFQoDo-eFxLSXitbUCK-s_/view?usp=sharing
Presentation: https://docs.google.com/presentation/d/1S5WGhz_DkgjawbWLUeJ0xflm8HtqspAb/edit?usp=drive_link

Project Description

The aim of the project is to create an intelligent system for monitoring a plant that can be used when you are away from home for long periods of time. The system consists of an ESP32 and a raspberry PI5 used as an HTTP server. The ESP32 is connected to: a DHT11 sensor, a soil moisture sensor, an LCD, a fan and a submersible water pump. The collected data is:temperature, humidity and soil moisture. The data is sent via MQTT to the server. The server has a web interface through which the user can monitor the plant in real time, download all collected data or update environmental limits. Based on the limits set by the user via the web interface, the ESP32 will turn on/off the fan and pump to maintain optimal conditions for the installation.

Hardware Description

The hardware components needed for the project are:

Architecture Diagram:

Setup:

Software Description

Software prerequisites: ESP-IDF was used for the ESP32 code(https://github.com/espressif/esp-idf).
ESP32 uses freeRTOS to easily use the 2 available cores.

ESP32 software diagram:

“Init” functions have their own tasks, because the init process for some components requires delays (e.g. LCD). In this way, the workload is split and freeRTOS can switch from one component to another when one of them needs to wait.

In the main loop there are 3 tasks that are running:

Backend software diagram:

A flask application runs on RPI5, it communicates with the MQTT broker, Mosquitto, and responds to the user's HTTP requests. A virtual python environment was used for development, so porting the application is easy.

Frontend software diagram:

React was used for the frontend. The application does fetch for the limits already set and also a dataset to render on the graphical components like table and graph. Then an interval is set to fetch the data every second.

Web interface

The web interface presents a chart, a table, one fan status switch, one pump status switch and a download button. The chart allows to enable or disable the characteristics to allow observations only on a certain characteristic Each characteristic in the table has an upper and a lower limit option, which can be changed according to the plant's needs. By pressing the “Download” button, the user will get all the collected data in a “csv” format.

Conclusions

In conclusion, ESP32 is a fantastic option for an IoT project because of the different connection options it has. Using ESP-IDF compared to Arduino has proven to provide more support for handling tasks on ESP32, thus allowing efficient use of hardware resources. Using a web framework like Flask for the backend was a good choice, considering the scalability of this application.