ESP32 Plant Monitoring Learning Kit · kit manual Back to the kit
DIYKITKit manual
Learn · Build · Make

ESP32 Plant Monitoring Learning Kit

7 projects · Intermediate · 90-150 minutes; calibration and repeat tests extra
Scan for code, photos & updates
diykit.ae/kits/esp32-plant-monitoring-learning-kit

Build a USB-powered ESP32 learning prototype that calibrates a capacitive soil sensor and a short-duration water sensor, reads a 3.3 V BME280, and reports local Serial Monitor data. The checked firmware includes guided calibration and fault handling; no pump, Wi-Fi dashboard, unattended control, or verified buzzer driver is included.

What's in the box Tick each part as you unpack
1×ESP32U DevKitC Type-C
1×Capacitive Soil Moisture Sensor Module v2.0
1×Water Level Sensor Module for Arduino
1×BME280 Temperature Humidity Pressure Sensor Module
1×Transparent 830 Points Solderless Breadboard Clear Prototype Circuit Board MB-102 High Quality DIY Electronic Testing Experiment PCB Base with Power Plane
1×Jumper Wire Assorted Pack 120 Pieces
1×Active Buzzer Module 5V DC (optional)
Projects in this manual
01Calibrated Plant-Monitoring Lab · 2–3 hours
02Soil-Moisture Calibration Study · 45–60 min
03Short-Duration Water-Level Experiment · 30–45 min
04BME280 Room Environment Station · 30 min
05Serial Data Logger and Charts · 1 hour + logging time
06Optional audible-alert investigation
07Future Wi-Fi dashboard
DIYKITESP32 Plant Monitoring Learning Kit
Getting started
Install the Arduino IDEFree from arduino.cc/en/software, for Windows, macOS and Linux.
Add ESP32 supportIn the IDE open Boards Manager, search “esp32” and install “esp32 by Espressif Systems”.
Install the USB driverLook at the small chip next to the USB port: CP2102 or CH340. Install the free driver for that chip if the board is not detected.
Connect and selectPlug in with a data USB cable. Choose Tools → Board → ESP32 Dev Module, then Tools → Port.
Upload a testOpen File → Examples → 01.Basics → Blink and upload. If the upload waits on “Connecting…”, hold the BOOT button until it starts.
3.3 V logicESP32 pins work at 3.3 V. Never connect 5 V to a GPIO pin; power sensors from 3V3 unless the guide says otherwise.
Get the codeEach project page has a QR code. Scan it to open the sketch on diykit.ae, then copy it into the IDE.
Wire with power offUnplug USB while you change wires. Check every connection against the wiring table before you plug back in.
Reading the wiring tables

Each project has a table with three columns: the part and its pin, where it connects on the board (the label printed next to the pin), and a note. “through 220 Ω” means a resistor sits between the board pin and the part. GND is ground — all GND pins and rails are connected together.

LEDs have a long leg (+, anode) and a short leg (−, cathode). Resistor values are coded in colours: 220 Ω is red-red-brown, 1 kΩ brown-black-red, 10 kΩ brown-black-orange.

Safety. Use only USB or the low-voltage supplies named in the guides — never mains electricity. Unplug before rewiring. If a part gets hot, smells or the board keeps resetting, unplug at once and recheck the wiring. Contains small parts: adult supervision for younger builders.
DIYKITESP32 Plant Monitoring Learning Kit · project 1 of 7
Project 01 · Sensing

Calibrated Plant-Monitoring Lab

Intermediate · 2–3 hours
The kit's main build. Soil moisture, water level, temperature, humidity and air pressure stream to your computer every 2 seconds. You calibrate the two analog sensors yourself with four simple captures, and the sketch flags DRY_SOIL or LOW_WATER from your own reference points.
Code & parts
You will learn
  • Reading analog sensors with the ESP32's 12-bit ADC
  • Why sensors need two-point calibration before a percentage means anything
  • Reading a BME280 environmental sensor over I2C
  • Controlling a sketch by typing commands into the Serial Monitor
  • Saving settings in the ESP32's flash so they survive a restart
Parts
ESP32U DevKitC board (your USB-C data cable)1
Capacitive soil moisture sensor v2.01
Water level sensor1
BME280 module1
830-point breadboard1
Jumper wiresabout 14
Pot of soil, glass and small container of water (yours)1
How it works

The capacitive soil sensor gives a voltage that changes as the soil around it gets wetter; the water sensor's exposed tracks conduct more the deeper they sit in water. The ESP32 reads each as a number from 0 to 4095, averaging 24 readings to smooth out noise.

Those raw numbers mean nothing on their own, so you teach the sketch four reference points: soil-dry, soil-wet, water-empty and water-full. It needs at least 150 counts between each pair, and saves them in flash so you only do this once.

In monitoring mode it converts each raw reading into a percentage between your two reference points. Soil under 30 % adds DRY_SOIL to the status; water under 20 % adds LOW_WATER. These are teaching defaults, not advice for any particular plant.

The BME280 adds temperature, humidity and pressure. If it fails three reads in a row, the sketch reports a fault instead of printing wrong numbers.

Every reading is printed as one DATA line with name=value pairs, easy to read and easy to import into a spreadsheet.

Wiring
Part / pinConnect toNote
ESP32 3V3Breadboard + rail3.3 V only — ESP32 inputs must not see 5 V
ESP32 GNDBreadboard − rail
BME280 VIN / VCC+ rail (3V3)
BME280 GND− rail
BME280 SDAGPIO21
BME280 SCLGPIO22
Soil sensor VCC+ rail (3V3)
Soil sensor GND− rail
Soil sensor AOUTGPIO34GPIO34 is input-only — ideal for an analog sensor
Water sensor + / VCC+ rail (3V3)
Water sensor − / GND− rail
Water sensor SGPIO35Keep this end of the board dry
Step by step
  1. In Arduino IDE install the ESP32 boards package (Boards Manager → esp32 by Espressif) and, from Library Manager, Adafruit BME280 and Adafruit Unified Sensor. Select the ESP32 Dev Module board and your USB port.
  2. Plug in the ESP32 alone and upload any example sketch to prove the cable and port work.
  3. With USB unplugged, fit the ESP32 across the breadboard centre gap (or beside it with female-to-male jumpers if it is too wide). Link 3V3 to the + rail and GND to the − rail. Check whether the long rails are split in the middle.
  4. Add the BME280 first: VIN to 3V3, GND, SDA to GPIO21, SCL to GPIO22. Upload the main sketch. Open Tools → Serial Monitor at 115200 baud, with the line ending set to Newline. It should report one BME280 at 0x76 or 0x77.
  5. Unplug USB. Add the soil sensor: VCC to 3V3, GND, AOUT to GPIO34. Plug back in and check the CAL lines show soil_raw changing when you touch the sensor's blade — not stuck at 0 or 4095.
  6. Unplug USB. Add the water sensor last: + to 3V3, − to GND, S to GPIO35. Keep it dry for now.
  7. Calibrate the soil: hold the probe in air (or truly dry soil) and type soil-dry. Then push it into wet soil up to the line on the board and type soil-wet.
  8. Calibrate the water: with the sensor dry type water-empty. Lower only the tracks into the water to a depth you mark, and type water-full. Lift it out, rinse and dry it.
  9. Type status. All four values must be present with each pair at least 150 apart. Type run to start monitoring.
  10. Push the soil probe into a plant pot and watch soil_pct. Water the plant and see it rise; let a test sample dry over a day and see it fall.
The code. Scan the QR code above to open this project's sketch on diykit.ae (diykit.ae/projects/esp32-calibrated-plant-monitoring-lab) and copy it into the IDE.
What you should see
If it doesn't work
Upload fails or no port appearsUse a USB cable that carries data, not a charge-only one. Hold the BOOT button while the upload starts if it stays at 'Connecting…'.
Garbled text in the Serial MonitorSet the baud rate to 115200.
'Need exactly one BME280 at 0x76 or 0x77'Check VIN on 3V3, GND, SDA GPIO21 and SCL GPIO22. Some modules label SDA as SDI and SCL as SCK.
soil_raw stuck at 0 or 4095AOUT is not on GPIO34, or the sensor has no power. Unplug USB and check the three wires.
'Calibration incomplete or a span is under 150 counts'The dry and wet readings were too close. Make the wet reference wetter (or use a glass of water) and capture again.
'Unknown command'Set the Serial Monitor line ending to Newline and type the command exactly, e.g. soil-dry.
Try next
DIYKITESP32 Plant Monitoring Learning Kit · project 2 of 7
Project 02 · Sensing

Soil-Moisture Calibration Study

Beginner · 45–60 min
Discover why a soil sensor never gives a 'real' percentage. Record the raw reading in air and in water, then test dry, damp and wet soil, probe depth and packing — and graph how much those choices change the number.
Code & parts
You will learn
  • How a capacitive soil sensor works
  • Raw ADC values versus calibrated percentages
  • Repeating a measurement to check it is reliable
  • Turning observations into a simple graph
Parts
ESP32U DevKitC board (your USB-C data cable)1
Capacitive soil moisture sensor v2.01
830-point breadboard1
Jumper wiresabout 5
Three cups of the same soil — dry, damp, wet — and a glass of water (yours)1
How it works

The sensor's blade is one plate of a capacitor; the soil around it is the material in between. Water changes how much charge the capacitor holds, and the module turns that into a voltage. The ESP32 reads the voltage as a number from 0 to 4095 — on most of these sensors the number goes down as the soil gets wetter.

Type d with the sensor in air and the sketch saves the dry end; type w with it in a glass of water and it saves the wet end. Every reading after that becomes a percentage between those two ends.

That is why two kits never agree on '40 %': the percentage depends on the soil type, how deep the probe sits, how tightly the soil is packed and the endpoints you chose. The sketch also keeps the lowest and highest raw values it has seen so you can judge how stable a reading is.

Wiring
Part / pinConnect toNote
ESP32 3V3Breadboard + rail3.3 V only — ESP32 inputs must not see 5 V
ESP32 GNDBreadboard − rail
Soil sensor VCC+ rail (3V3)
Soil sensor GND− rail
Soil sensor AOUTGPIO34GPIO34 is input-only — ideal for an analog sensor
Step by step
  1. In Arduino IDE install the ESP32 boards package (Boards Manager → esp32 by Espressif) and, from Library Manager, Adafruit BME280 and Adafruit Unified Sensor. Select the ESP32 Dev Module board and your USB port.
  2. With USB unplugged, wire the soil sensor: VCC to 3V3, GND to GND, AOUT to GPIO34.
  3. Upload the Soil-moisture calibration study sketch. Open Tools → Serial Monitor at 115200 baud, with the line ending set to Newline.
  4. Hold the probe in the air, wait for the raw value to settle, and type d. Then dip the blade in a glass of water up to the line (never over the electronics) and type w.
  5. Push the probe into the dry, damp and wet soil cups in turn, to the same depth. Wait 10 seconds in each and write down raw and percent.
  6. Repeat in the damp cup at half depth, and again with the soil pressed down firmly. Note how much the reading moves.
  7. Plot raw value against cup in a spreadsheet. Type r to reset the endpoints and try calibrating with dry and wet soil instead of air and water.
The code. Scan the QR code above to open this project's sketch on diykit.ae (diykit.ae/projects/esp32-soil-moisture-calibration-study) and copy it into the IDE.
What you should see
If it doesn't work
Upload fails or no port appearsUse a USB cable that carries data, not a charge-only one. Hold the BOOT button while the upload starts if it stays at 'Connecting…'.
Garbled text in the Serial MonitorSet the baud rate to 115200.
Raw value does not changeCheck AOUT is on GPIO34 and VCC on 3V3. Push the blade in deeper — only the lower part senses.
Percent stuck at 0 or 100The sketch clips the percentage to 0–100, so soil wetter or drier than your endpoints reads 0 or 100. Recalibrate with r, d and w.
Try next
DIYKITESP32 Plant Monitoring Learning Kit · project 3 of 7
Project 03 · Sensing

Short-Duration Water-Level Experiment

Beginner · 30–45 min
Lower the water sensor step by step into a container and watch the reading climb. The sketch learns the empty and full readings as you go, reports a level, and prints LOW WATER and water OK events — then you study how repeatable it really is.
Code & parts
You will learn
  • How a conductive water sensor turns depth into a voltage
  • Why the response is not a straight line
  • Detecting a threshold crossing as an event
  • Why exposed-copper sensors corrode, and how to care for them
Parts
ESP32U DevKitC board (your USB-C data cable)1
Water level sensor1
830-point breadboard1
Jumper wiresabout 5
Shallow plastic or glass container of clean water, ruler, paper towel (yours)1
How it works

The board has interleaved copper tracks. Water bridges them, and the deeper it goes the more track is bridged, so the voltage on S — and the ESP32's raw reading — rises with depth.

The sketch remembers the lowest raw value it has seen as 'empty' and the highest as 'full', and reports the level as a percentage between them. Below 20 % it prints EVENT: LOW WATER once; rising back above, EVENT: water OK.

The response is not linear, and the tracks slowly corrode in water, so readings drift over time. That is why this sensor suits short supervised tests, not a permanent tank gauge.

Wiring
Part / pinConnect toNote
ESP32 3V3Breadboard + rail3.3 V only — ESP32 inputs must not see 5 V
ESP32 GNDBreadboard − rail
Water sensor + / VCC+ rail (3V3)
Water sensor − / GND− rail
Water sensor SGPIO35Keep this end of the board dry
Step by step
  1. In Arduino IDE install the ESP32 boards package (Boards Manager → esp32 by Espressif) and, from Library Manager, Adafruit BME280 and Adafruit Unified Sensor. Select the ESP32 Dev Module board and your USB port.
  2. With USB unplugged, wire the water sensor: + to 3V3, − to GND, S to GPIO35. Use longer jumpers so the electronics stay well away from the water.
  3. Mark depths on the sensor with a pen: 0.5, 1, 2, 3 cm from the bottom of the tracks.
  4. Upload the Short-duration water-level experiment sketch. Open Tools → Serial Monitor at 115200 baud, with the line ending set to Newline. Start with the sensor dry.
  5. Lower it to each mark and hold it still for a few seconds. Write down raw and level_pct at each depth.
  6. Lift it back out step by step and note whether the readings match on the way up. Watch for the LOW WATER and water OK events.
  7. Unplug USB, rinse the tracks in clean water and dry them with a paper towel.
  8. Plot raw against depth. Is it a straight line? Repeat tomorrow and compare.
The code. Scan the QR code above to open this project's sketch on diykit.ae (diykit.ae/projects/esp32-short-duration-water-level-experiment) and copy it into the IDE.
What you should see
If it doesn't work
Upload fails or no port appearsUse a USB cable that carries data, not a charge-only one. Hold the BOOT button while the upload starts if it stays at 'Connecting…'.
Garbled text in the Serial MonitorSet the baud rate to 115200.
Raw stays near 0 in waterCheck S is on GPIO35 and + on 3V3. Make sure the tracks, not the connector end, are in the water.
Readings creep up while held stillNormal for this kind of sensor — water wicks up and the tracks polarise. Note it as part of the experiment.
Try next
DIYKITESP32 Plant Monitoring Learning Kit · project 4 of 7
Project 04 · Basics

BME280 Room Environment Station

Beginner · 30 min
One small chip, four readings: temperature, humidity, air pressure and estimated altitude every 2 seconds, with the day's minimum and maximum temperature. Then test how fast it reacts and where it reads most honestly.
Code & parts
You will learn
  • Reading a BME280 over I2C with a library
  • What relative humidity and air pressure mean
  • How altitude can be estimated from pressure
  • Sensor settling time and self-heating
Parts
ESP32U DevKitC board (your USB-C data cable)1
BME280 module1
830-point breadboard1
Jumper wiresabout 6
How it works

The BME280 measures temperature, relative humidity and barometric pressure inside one chip and sends the results over the I2C bus (two wires, SDA and SCL).

Pressure falls as you go up and changes with the weather. Sea level on an average day is about 1013 hPa; the sketch uses that to estimate altitude, so the altitude figure moves when the weather changes even if you do not.

Each row also keeps the lowest and highest temperature since start-up. Breathe gently near the sensor and watch humidity jump and slowly settle — that settling time is part of what you are measuring.

Wiring
Part / pinConnect toNote
ESP32 3V3Breadboard + rail3.3 V only — ESP32 inputs must not see 5 V
ESP32 GNDBreadboard − rail
BME280 VIN / VCC+ rail (3V3)
BME280 GND− rail
BME280 SDAGPIO21
BME280 SCLGPIO22
Step by step
  1. In Arduino IDE install the ESP32 boards package (Boards Manager → esp32 by Espressif) and, from Library Manager, Adafruit BME280 and Adafruit Unified Sensor. Select the ESP32 Dev Module board and your USB port.
  2. With USB unplugged, wire the BME280: VIN to 3V3, GND, SDA to GPIO21, SCL to GPIO22. Place it at the far end of the breadboard, away from the ESP32, which gets warm.
  3. Upload the BME280 room environment station sketch. Open Tools → Serial Monitor at 115200 baud, with the line ending set to Newline.
  4. Leave it for 5 minutes and note where temperature and humidity settle.
  5. Breathe gently towards the sensor once. Note how high humidity goes and how many seconds it takes to come back.
  6. Move the board near a window, a fan or a plant and compare. Keep it out of direct sun and away from water.
  7. Compare the pressure with a local weather report for your city.
The code. Scan the QR code above to open this project's sketch on diykit.ae (diykit.ae/projects/esp32-bme280-room-environment-station) and copy it into the IDE.
What you should see
If it doesn't work
Upload fails or no port appearsUse a USB cable that carries data, not a charge-only one. Hold the BOOT button while the upload starts if it stays at 'Connecting…'.
Garbled text in the Serial MonitorSet the baud rate to 115200.
'BME280 not found at 0x76'Check the four wires. If they are right, change the address to 0x77. Some modules label SDA as SDI and SCL as SCK.
Temperature reads several degrees highThe sensor is picking up heat from the ESP32 or your hand. Move it away on longer wires.
Not found at 0x76 or 0x77, wiring correctThe chip may be a BMP280 (no humidity sensor), which the BME280 library will not accept. Check the marking on the chip.
Try next
DIYKITESP32 Plant Monitoring Learning Kit · project 5 of 7
Project 05 · Basics

Serial Data Logger and Charts

Beginner · 1 hour + logging time
Use the whole kit as a data logger: one CSV row of soil, water, temperature, humidity and pressure every few seconds. Paste it into a spreadsheet and chart what happens to a plant pot over an afternoon of watering and drying.
Code & parts
You will learn
  • Logging sensor data as CSV
  • Importing Serial Monitor output into a spreadsheet
  • Making line charts from time-series data
  • Calibrating after the fact, in the spreadsheet
Parts
ESP32U DevKitC board (your USB-C data cable)1
Capacitive soil moisture sensor v2.01
Water level sensor (optional for this project)1
BME280 module1
830-point breadboard1
Jumper wiresabout 14
Plant pot, computer with spreadsheet software (yours)1
How it works

Every LOG_EVERY_S seconds the sketch prints one comma-separated row: row number, seconds since start, soil raw, water raw, temperature, humidity and pressure. If the BME280 is missing it prints NA in those columns instead of stopping.

Raw soil and water values are logged on purpose. You can convert them to percentages later in the spreadsheet using your dry/wet endpoints, without running the experiment again.

The kit has no clock chip, so time is 'seconds since start'. Note the real start time and add it in the spreadsheet.

Wiring
Part / pinConnect toNote
ESP32 3V3Breadboard + rail3.3 V only — ESP32 inputs must not see 5 V
ESP32 GNDBreadboard − rail
BME280 VIN / VCC+ rail (3V3)
BME280 GND− rail
BME280 SDAGPIO21
BME280 SCLGPIO22
Soil sensor VCC+ rail (3V3)
Soil sensor GND− rail
Soil sensor AOUTGPIO34GPIO34 is input-only — ideal for an analog sensor
Water sensor + / VCC+ rail (3V3)
Water sensor − / GND− rail
Water sensor SGPIO35Keep this end of the board dry
Step by step
  1. Build the main project wiring (or keep it from the main build): BME280 on GPIO21/22, soil on GPIO34, water on GPIO35.
  2. For a quick test leave LOG_EVERY_S at 5. For a real afternoon, change it to 300 (one row every 5 minutes).
  3. Upload the Serial data logger and charts sketch. Open Tools → Serial Monitor at 115200 baud, with the line ending set to Newline. Write down the clock time when it starts.
  4. Push the soil probe into a pot of dry-ish soil and leave the computer running. Keep the water sensor out of water unless you are doing a short test.
  5. After a few rows, water the plant and keep logging for an hour or more.
  6. Untick 'Show timestamp' in the Serial Monitor, then copy all the text and paste it into a spreadsheet. Use Data → Split text to columns (comma) if it lands in one column.
  7. Make a line chart of soil_raw against t_s, and another of temperature and humidity.
The code. Scan the QR code above to open this project's sketch on diykit.ae (diykit.ae/projects/esp32-serial-data-logger-and-charts) and copy it into the IDE.
What you should see
If it doesn't work
Upload fails or no port appearsUse a USB cable that carries data, not a charge-only one. Hold the BOOT button while the upload starts if it stays at 'Connecting…'.
Garbled text in the Serial MonitorSet the baud rate to 115200.
Rows stop when the laptop sleepsTurn off sleep while logging — the data only exists in the Serial Monitor window.
Spreadsheet puts everything in one columnUse the split-text-to-columns tool with a comma separator.
Try next
DIYKITESP32 Plant Monitoring Learning Kit · project 6 of 7
Project 06 · Basics

Optional audible-alert investigation

Characterize the buzzer's current, trigger threshold, and active level before choosing a transistor or driver. Write and compile a separate alert sketch only after the interface is reviewed. This project is not wired or implemented by the supplied main firmware.
Code & parts
Parts

Optional DIY-016 5 V buzzer, ESP32U, and additional user-supplied driver/protection parts selected after measurement

Full step-by-step instructions and the code are on the project page: scan the QR code above or open diykit.ae/projects/esp32-optional-audible-alert-investigation.
DIYKITESP32 Plant Monitoring Learning Kit · project 7 of 7
Project 07 · Network

Future Wi-Fi dashboard

Add networking only after the USB/Serial build is stable. Keep credentials out of shared code and review privacy, reconnection behavior, power, enclosure, and unattended-operation risks. No cloud service or dashboard is included.
Project page
Parts

Completed local main build and user-supplied Wi-Fi network

Full step-by-step instructions are on the project page: scan the QR code above or open diykit.ae/projects/esp32-future-wi-fi-dashboard.
DIYKITESP32 Plant Monitoring Learning Kit
Keep going

Every project in this kit uses the same parts, so you can combine them: add the display to a sensor project, or a buzzer to a measuring one. The project pages on diykit.ae have the code, the parts list and ideas to take each build further.

Need help?

Stuck on a wire, a library or an error message? Send us a photo of your wiring and the error text on WhatsApp — we answer build questions.

Code, photos & updatesScan the QR code on the cover
Help on WhatsApp+971 50 125 3600
More kits & partsdiykit.ae
DIY KIT FZE LLC · ESP32 Plant Monitoring Learning Kit · printed 01 Nov 2026