Project Overview:

The problem: Plants are important, but sometimes growing plants can be hard!

The proposed solution: Gather copious amount of data to observe a plant's health and find out when their health starts to decay.

The focus of this project is to collect environmental data and analyze the NDVI (photosynthesis) value of a plant. With this data on a plant's life, one can learn what is good, or bad for their plants (For example, figure out when the plant health starts to decay).

The objective for this project is to have a system which will connect to WiFi, collect and store images/data, and display them to a user via a GUI. Depending on the user's preference, PlantAnalyzer will also send email alert notifications as well as trigger physical action, such as automated watering or shielding from the sun.

PlantAnalyzer's uses could range from teaching children about growing plants, to agricultural uses on crops.

Highlights of this project are:


Hardware:

This project will utilize an Arduino MKR1000 to collect environmental data/images and then send them to a Flask WebApp.

A complete list of hardware can be found (and will be updated) in the "Components" section.

Schematic for PlantAnalyzer (In work, potentially need to add extra sensors):


Software:

Arduino Code:

For this project, I plan on using the following Arduino libraries:

- "Default" Libraries:

- Custom Libraries:

Flowchart for PlantAnalyzer's Arduino Code:


Python Flask Web Application:

The Python Flask web application will be used to process HTTP request from the MKR1000 and process infrablue images. Flask can be used to execute Python scripts, such as image processing scripts, and store images.

Flowchart for PlantAnalyzer's Flask WebApp:


Graphical User Interface (GUI):

The intended GUI for this project will be a Universal Windows Application (UWA) coded in C#. The GUI will have three modes (Live Mode, Project Mode, and Configure).

Sample layout of GUI:
Sample GUI


Technologies:

Normalized Difference Vegetation Index (NDVI):

A plant's NDVI is a graphical representation of a plant's photosynthesis capacity. Thanks to various open communities (such as Public Lab) technology once confined to outerspace is now able to be used by Makers/Hackers using open source technology. Utilizing a modified infrablue camera, PlantAnalyzer will be able to gauge how stressed a plant is based on the plant's photosynthesis value.

Hypertext Transfer Protocol (HTTP):

In order to send data and images to the flask webapp this project will use HTTP POST requests sent from the Arduino MKR1000.

Sample POST request to send image to Flask WebApp:

POST / HTTP/1.1
HOST: FLASK_HOSTNAME
Content-Type: multipart/form-data; boundary = AaBb00
Content-Length: (length of content)

--AaBb00
Content-Type: image/jpeg
Content-Disposition: form-data; name="file"; filename=imagefilename
Content-Encoding: binary

<Binary data of the image!>
--AaBb00--

Sample POST request to send data to Flask WebApp:

POST /tables/table_name HTTP/1.1
HOST: mobile_app_name
X-ZUMO-APPLICATION: moible_app_key
Content-Type: application/json
Content-Length: (length of content)
"index":"table_index_var","soilmoisture":"soilmoisture_var","airtemp":"airtemp_var",....

Serial Peripheral Interface (SPI):

Will be used to control both the camera as well as an Adafruit SD card reader. SPI works off of three "control" wires and a slave select that the "MASTER" uses to indicate which "SLAVE" it wants to talk to.


I2C (pronounced I-squared-C):

Used to write to the camera's registries for configuration and also to communicate with SparkFun's weather shield (currently only used for temperature and humidity). I2C is a two wire protocol that also uses a MASTER/SLAVE relationship, but instead of a slave select, each SLAVE has an address to which the MASTER can "address".


Firmata:

Firmata protocol will be used to allow communication between the Arduino MKR1000 and the GUI. The send string function will be used to communicate.


Open-source Licenses / Third-party Licenses / Restrictions:

- Arduino Code Libraries (Open-source):

[To be updated as more licenses are added]


Challenges:

Some potential challenges for this project could be:

- Need to properly calibrate the infrablue camera to accurately obtain a plant's photosynthesis value. To accomplish this I have found to possible solutions:

  1. Manually adjust the Auto White Balance (AWB) calibration of the Arducam module to adjust for the blue filter
  2. Merge the normal image and the infrablue image, with an QR code to overlay the two, to better process the image

- Need to figure out a design for measuring the soil's nutrient level.