Skip to content

ConnerWill/esp32-plant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 Plant Monitoring System

ESP32 Plant Monitoring Project Image

Arduino Lint Python Black ShellCheck


Table of Contents


Overview

This project implements a monitoring system using an ESP32 microcontroller to measure and display temperature, humidity, and CO2 levels in real-time.

This is designed to be used to monitor the environment when growing plants


Shopping List

Here is a list of parts used in this project

Note

Amazon links are non-affiliate

NAME PRICE COUNT DESCRIPTION LINK NOTE
ESP32 $5 1 Microcontroller Amazon USB-C ESP32 Amazon
DHT22 $3 1 Temp/Humidity Sensor Amazon
MQ-135 $3 1 CO2 Sensor Amazon
OLED Display $3 1 0.96" OLED Display 128x64 SSD1306 Amazon
Kasa Smart Plug $7.50 2 TP-Link Kasa Smart Plug HS103 Amazon Intake and exhaust fans smart plugs
Rocker Switch $0.60 2 Rocker Switch On/Off 2 Pin Amazon
1K Ω Resistor $0.25 1 1K Ohm Resistor Amazon MQ-135 analog pin
10K Ω Resistor $0.25 0/1/2 10K Ohm Resistor Amazon Most DHT22 sensor modules have a built-in resistor
Wire/Breadboard $1 0/1 Jumper wire or breadboard Amazon Optional depending on setup
Breakout Board $4 0/1 ESP32 Breakout Board GPIO Amazon Optional depending on setup
Buck Converter $1 0/1 LM2596 DC-DC Buck Converter Step Down Amazon Optional depending on setup
Barrel Jack $1 0/1 Female DC Barrel Jack Panel Adapter Amazon Optional depending on setup
1N5819 Diode $0.1 0/1 1N5819 Schottky Diode Amazon Optional depending on setup
1000µF Capacitor $0.4 0/1 1000uF 10V 8x12mm Capacitor Amazon Optional depending on setup

Tip

Lower prices can be found if you shop around


Setup

Once you have all the required parts in hand, you can start wiring

Circuit Schematic

ESP32 Plant Wiring

ESP32 Plant Monitoring Circuit Schematic Image

ESP32 OLED Circuit Schematic Image

ESP32 Pin Destination Type Power Requirements (Volts) ESP32 VCC Pin ESP32 GND Pin
27 DHT22 Digital 3.3 - 5 3.3V GND
35 CO2 Sensor Analog 5 5V GND
21 OLED SCL SCL 3.3 3.3V GND
22 OLED SDA SDA 3.3 3.3V GND
19 Rocker Switch GPIO GND

Note

Feel free to change the pins used on the ESP32, just note, if you change the pins, you will need to update the values in the code.

ESP32 Pinout

30 Pin

ESP32 30 pin Pinout Image

38 Pin

ESP32 38 pin Pinout Image

Configuration

You will need to define values to suite your needs. Variables are defined in config.h

WiFI Configuration

Here is a list of WiFi variables that must be defined and their descriptions...

WIFI_SSID : WiFi SSID (network/WiFi name)

WIFI_PASSWORD : WiFi password

WIFI_HOSTNAME : Hostname of ESP32 to set

Other Configuration

Other variables in the code can be changed to suite your needs

Libraries

You will need to install additional libraries.

In Arduino IDE, go to library manager and search and install the required libraries listed in the DEPENDENCIES section in main.ino

External Libraries


Uploading

I use Arduino IDE to upload the code to the board. I had to install additional drivers (Download) to get connected to my board.

I installed the ESP32 boards and selected ESP32dev board.


Images

ESP32 Plant Monitoring Project Image 1 ESP32 Plant Monitoring Project Image 2
ESP32 Plant Monitoring Project Image ESP32 Plant Monitoring Project Image

3D Print

ESP32 Plant Monitoring Housing 3D Image

The housing to hold the ESP32 can be 3D printed.

The 3D model files are located under the 3D-models directory.

Name Image Link Author
ESP32-Plant Case ESP32-Plant Case Image ESP32-Plant Case Case ConnerWill
DHT22 Case DHT22 Case Image Over-engineered DHT22 / AM2302 Board Case SciMonster
MQ-135 Case MQ-135 Case Image MQ-2 Sensor Case RJGII

TODO

  • [] Improve wiring/setup instructions
  • [] Finish 3D models
  • [] Add finished product images
  • [] Improve code

Links