Soil Moisture Monitor Project: OLED Build Step-by-Step

Soil Moisture Monitor Project: OLED Build Step-by-Step

This soil moisture monitor project is the second rung on our build ladder: a capacitive probe in your plant's pot, a 0.96-inch OLED showing live moisture percent, and an ESP32 doing the thinking. Six parts, Rs.861, no soldering — and a mid-project twist where we asked the assistant to evolve the build live.

Quick answer: Connect a Capacitive Soil Moisture Sensor V2.0 to GPIO32 of an ESP32-DEVKITC and an SSD1306 OLED to the I2C pins (SDA 21, SCL 22, address 0x3C), calibrate two numbers with a dry and a wet reading, and the display shows soil moisture as a percentage. The six-part tray costs Rs.861. Difficulty: 2/5, about 2–3 hours.

Proof of work: we built this exact project through Soldr, Compoden's AI build assistant, on 10 August 2026 — every screenshot below is from that session, including the moment we changed the design mid-conversation. Published 10 August 2026 · Last updated 11 August 2026.

What parts do you need for a soil moisture monitor?

You need six parts: an ESP32-DEVKITC development board, a Capacitive Soil Moisture Sensor V2.0, an SSD1306 0.96-inch OLED display, a 5V 2A power adapter, a Dupont jumper wire kit, and a SYB-170 mini breadboard. The full tray costs Rs.861 from Compoden.

This is the exact tray Soldr assembled for our session, verified against live catalog prices:

Parts list for the soil moisture monitor project (prices checked August 2026)
Part Qty Price (Rs.) Where to buy
ESP32-DEVKITC Development Board (WiFi + Bluetooth) 1 340 ESP32-DEVKITC Development Board
Capacitive Soil Moisture Sensor V2.0 (corrosion-resistant analog probe) 1 55 Capacitive Soil Moisture Sensor V2.0
0.96 inch OLED Display Module 128x64 I2C Yellow/Blue (SSD1306) 1 246 0.96 inch OLED Display Module 128x64 I2C (SSD1306)
5V 2A Micro-USB Power Adapter 1 140 5V 2A Micro-USB Power Adapter
Dupont Jumper Wire Kit (M-M, M-F, F-F, 20cm, 22AWG) 1 60 Dupont Jumper Wire Kit
SYB-170 Mini Breadboard (170 points) 1 20 SYB-170 Mini Breadboard
Total 861 Cash on delivery available across India

One tray, one honest note. Soldr's session describes the SYB-170 breadboard as "a passive, temporary platform for holding connections during prototyping" — true, but this build's seven wires connect straight module-to-module and do not strictly need it. Keep it for a steadier rig while you calibrate, or skip it and save Rs.20; the wiring and code below are identical either way. Unlike our first-project post, the power adapter genuinely matches this board: the ESP32-DEVKITC's stated power input is 5V via micro-USB, exactly what the adapter's plug is — though your laptop's USB cable covers you until the monitor moves to a shelf near the plants.

For the dry-soil warning LED upgrade in the "level it up" step you will also want an LED Variety Pack (50 pcs, 3mm and 5mm) (Rs.60) and a 220-ohm resistor from the Resistor Variety Pack (10 values, 1/4W) (Rs.75) — the resistor pack is genuinely the first item Soldr itself suggested in this session's "to complete this build" list too. Prefer everything in one box? The ESP32 Smart IoT Learning Kit with OLED Display (Rs.810) bundles an ESP32 and OLED with sensors to grow into.

Tools: a laptop with the free Arduino IDE, a micro-USB data cable, a glass of water for calibration, and a plant that deserves better.

Step 1: Describe the monitor to Soldr in one sentence

Open Soldr and type what you want in plain words. Our exact prompt was: "soil moisture monitor for my plants with an OLED display that shows moisture percent." One sentence, no part names — Soldr picked all six parts itself.

Soldr parts tray for a soil moisture monitor: 6 parts led by ESP32-DEVKITC Rs.340 and capacitive sensor Rs.55, all in stock
Proof from our 10 August 2026 session: one sentence became a 6-part tray with live Rs. prices, a per-part explanation, a ~530mA draw estimate for the active parts, and a build profile rating the project "Easy (one part must be calibrated before it reads correctly)".

The reply is worth reading slowly. It explains that the capacitive probe "measures soil moisture using capacitance, an electrical property that changes with the surrounding material," flags in advance that the sensor "must be calibrated before its readings mean anything, so the displayed percentage depends on that calibration," and notes that the sensor and OLED both run on 3.3V logic while the power adapter's micro-USB output "matches the controller's stated power input." It also states why the board was chosen: "the lowest-cost part that meets the requirement" — at Rs.340 the ESP32-DEVKITC undercuts even a Uno-class board here, and its WiFi radio is a free upgrade path. The build profile says: Difficulty Easy, suitable for roughly ages 11+, with an adult handling the wall adapter.

Checkpoint: your parts tray shows 6 parts, 100% in stock, totalling around Rs.861.

Step 2: Get the parts and lay them out

Order the tray (every part was in stock during our session; cash on delivery is available). Lay out the parts and identify them: the ESP32 board with its two rows of pins, the paddle-shaped moisture probe with a 3-pin header, the OLED with its 4-pin I2C header (GND, VCC, SCL, SDA), the SYB-170 breadboard, and the jumper wire bundle. All connections in this build are simple Dupont wires straight between module pins — the breadboard just gives the probe and OLED a steady base while you test, and no soldering is required anywhere.

Checkpoint: all six parts identified and laid out.

Step 3: Wire the sensor and the OLED to the ESP32

Three wires for the sensor, four for the display — seven wires total, and you are done. Note: pin-level wiring was not captured in our screenshots — this is standard-correct wiring for these exact modules, using the GPIO32 sensor pin and the I2C bus the build log names; verify against the wiring tab in your own Soldr session.

Wiring connections (standard wiring — verify against your Soldr session)
From To (ESP32) Why
Soil sensor VCC 3.3V The probe accepts 3.3–5.5V; 3.3V keeps its output inside the ESP32's ADC range
Soil sensor GND GND Common ground
Soil sensor AOUT GPIO32 Analog output into an ADC1 channel (ADC1_CH4) that keeps reading reliably even after you add WiFi — ADC2 pins can't be trusted once the radio is on
OLED VCC / GND 3.3V / GND The SSD1306 runs on 3.3V logic, ~25mA
OLED SDA / SCL GPIO21 / GPIO22 The ESP32's default I2C bus; the display answers at address 0x3C

Two practical tips. First, GPIO32 is one of the ESP32's ADC1 channels, so unlike the ADC2-block pins it keeps reading correctly even after you add WiFi code later. Second, only the probe's blade goes into the soil — keep the circuitry end and its 3-pin header well above the surface, and water the plant, not the electronics.

Checkpoint: seven wires placed, nothing on the screen yet — correct, there is no code on the board.

Step 4: Ask Soldr for the full code

Our second prompt was four words: "give me the full code." Soldr's build log ran 108 seconds across 2 steps and used sensible defaults — "moisture sensor on GPIO32, I2C OLED SDA=21 SCL=22 at 0x3C, serial 115200, calibration constants for a typical capacitive sensor (dry ~3400, wet ~1500)" — while telling us to "tune DRY_ADC/WET_ADC after you calibrate your sensor in air (dry) and in wet soil."

Soldr 108s build log: flash as ESP32-DEVKITC, install Adafruit SSD1306 and GFX Library, then calibrate two ADC values
Proof from the session: the 108-second build log with flash instructions — install Adafruit SSD1306 and Adafruit GFX Library via the Library Manager, then adjust DRY_ADC and WET_ADC after reading the serial monitor dry and in water. The side card shows Soldr's engineered-build estimate: a "Plant Watering System" at ~Rs.841, 57% confidence — a rough side estimate; the parts-tray total above (Rs.861) is the real cost.

Two libraries to install via the Arduino IDE's Library Manager, exactly as the session's flash instructions name them: Adafruit SSD1306 and Adafruit GFX Library (its dependency). No current-sensor library this time — the session's tray never carded one. The full code lives in your session's Firmware tab; the reference copy below matches the same design.

Checkpoint: flash instructions on screen, two libraries installed, "full code is in the Firmware tab" visible in your session.

Step 5: Calibrate with one dry reading and one glass of water

This is the step Soldr warned about from the very first reply: the probe's readings depend entirely on calibration, and the build log's own defaults are explicitly generic — "calibration constants for a typical capacitive sensor (dry ~3400, wet ~1500)." Flash the sketch, open the Serial Monitor at 115200 baud, and write down the raw ADC value with the probe completely dry in air — that is your DRY_ADC. Then stand the probe in a glass of water (blade only!) and note the new raw value — that is your WET_ADC. Put both numbers into the sketch and, as the session's instructions say, re-flash.

From now on the OLED maps every reading between those two endpoints to 0–100%. Soldr's own defaults (dry ~3400, wet ~1500) are a reasonable starting point on a 3.3V supply, but use your numbers, not a stranger's — every probe and pot differs, which is precisely why Soldr calls them defaults and tells you to tune them.

Checkpoint (success state): OLED shows a moisture percentage; squeeze the probe in a damp cloth and the number climbs. Your monitor works.

Level it up: add a dry-soil warning LED mid-conversation

Here is this build's party trick. With the monitor already specced, we typed a third prompt into the same conversation: "add a red LED that turns on when the soil is too dry, and update the code." Soldr re-ran engineering for 40 seconds across 2 steps. You are not restarting a wizard; you are iterating on a design that remembers everything so far — including your exact six-part tray.

Soldr iteration turn: prompt asks for a red dry-soil LED, 40-second rebuild returns a free-preview hardware test sketch
Proof from the session: the live iteration. Our "add a red LED" prompt is in the chat, followed by Soldr's 40-second build log. Honest catch: our session had used its free-preview credits by this turn, so the returned sketch was the hardware-test preview — the complete updated project code unlocks with credits.

Full transparency, because the screenshot shows it: by this third turn our session had spent its free-preview credits (the "top up" badge is visible in the header), so Soldr returned its free hardware-test sketch — one that lists every part in its [INIT] lines, reads the input pin, and runs an I2C scan to verify wiring — rather than the complete updated project logic, which unlocks with credits. The tray also did not gain an LED row, which is why the LED pack and resistor pack sit in the parts section above as add-ons. The reference code below includes the finished dry-soil logic, so you lose nothing by following along.

The wiring for the upgrade is one line: red LED long leg through a 220-ohm resistor to GPIO26, short leg to GND (same standard-wiring caveat as Step 3). The code turns the LED on whenever moisture drops below 30% — change DRY_THRESHOLD to suit your plant.

Checkpoint: pull the probe out of the soil and the red LED comes on within a second; dunk-test it back off.

The full code

This is a standard sketch for exactly the wiring above, matching our session's flash instructions and summary (the session's own firmware lives in its Firmware tab — treat this as the reference copy and verify against yours). Libraries: Adafruit SSD1306 and Adafruit GFX Library, both installed from the Library Manager in the current Arduino IDE 2.x with the ESP32 board package.

// Soil moisture monitor with OLED + dry-soil warning LED.
// Board: ESP32-DEVKITC - select "ESP32 Dev Module" in the Arduino IDE.
// Libraries: Adafruit SSD1306, Adafruit GFX Library.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SOIL_PIN 32        // sensor AOUT -> GPIO32 (ADC1 channel, safe with WiFi)
#define LED_PIN  26        // red LED -> 220 ohm -> GPIO26 (Step 6 upgrade)
#define DRY_THRESHOLD 30   // percent: LED turns on below this

// CALIBRATE these two numbers for YOUR probe (see Step 5):
// read the Serial Monitor with the probe dry, then in a glass of water.
// Soldr's session defaults for a typical capacitive sensor: dry ~3400, wet ~1500.
#define DRY_ADC 3400 // raw ADC reading, probe dry in air
#define WET_ADC 1500 // raw ADC reading, probe in water

Adafruit_SSD1306 display(128, 64, &Wire, -1);

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  Wire.begin(21, 22);      // I2C: SDA = GPIO21, SCL = GPIO22
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println("SSD1306 not found at 0x3C - check SDA/SCL wiring");
    while (true) delay(1000);
  }
  display.clearDisplay();
  display.setTextColor(SSD1306_WHITE);
  Serial.println("Soil monitor ready");
}

void loop() {
  int raw = analogRead(SOIL_PIN);          // ESP32 ADC is 12-bit: 0-4095
  int pct = map(raw, DRY_ADC, WET_ADC, 0, 100);
  pct = constrain(pct, 0, 100);

  digitalWrite(LED_PIN, pct < DRY_THRESHOLD ? HIGH : LOW);

  display.clearDisplay();
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.print("Soil moisture");
  display.setTextSize(3);
  display.setCursor(0, 20);
  display.print(pct);
  display.print("%");
  display.display();

  Serial.print("raw="); Serial.print(raw);
  Serial.print(" moisture="); Serial.print(pct); Serial.println("%");
  delay(1000);
}

How does a capacitive soil moisture sensor actually work?

A capacitive probe measures how much the soil around it changes an electrical property — capacitance — which rises with water content, and outputs that as an analog voltage. Nothing conducts through the soil, which is why, unlike the older resistive forks, the V2.0 probe's traces don't corrode away in months. The ESP32 reads that voltage on GPIO32 with its 12-bit ADC (values 0–4095), your two calibration numbers anchor the scale, and map() turns everything between them into a percentage. The OLED then draws it over I2C — a two-wire bus where the display simply answers to address 0x3C. Total draw for the active parts, per Soldr's estimate in our session: roughly 530mA, dominated by the ESP32's ~500mA worst-case budget — comfortably inside the 2A adapter.

What if it doesn't work? Real troubleshooting

The first two entries below are the exact "common problems" Soldr predicted in our session before we had wired anything; the rest are the classics for this parts combination.

Why does the moisture percentage look wrong or stuck?

Almost always calibration — the session called "incorrect sensor calibration, which makes the percentage misleading" the number-one problem for this build. Re-do Step 5: dry reading, water reading, both re-entered, re-flash. The session also flagged "unstable readings caused by changing sensor placement or soil conditions" as the second most likely problem — re-seat the probe once, bury only the blade, and leave it undisturbed; readings shift with soil compaction.

Why is the OLED blank?

Check three things in order. Power: VCC to 3.3V, GND to GND. Bus: SDA to GPIO21 and SCL to GPIO22 — swapping them is the single most common mistake. Address: this module answers at 0x3C, which the sketch expects; if you suspect the address, Soldr's free hardware-test sketch conveniently runs an I2C scan and prints every device it finds — that is what it is for.

Why do my raw readings go above 1023?

Because the ESP32's ADC is 12-bit. Tutorials written for the Arduino Uno describe a 0–1023 range — the session's spec sheet lists the probe's "raw 0-1023" in that same convention — but on an ESP32 analogRead() returns 0–4095. It is not a fault; it is a finer ruler. Calibrate on the ESP32 itself and the numbers take care of themselves.

Why does the ESP32 randomly reset or reboot?

Usually a weak power source, not a code bug. The session's own draw estimate for the active parts is roughly 530mA, dominated by the ESP32's ~500mA worst case — some laptop USB ports and most USB hubs cannot sustain that under WiFi load, and the board's brownout detector resets it the moment the 3.3V rail sags. Plug straight into a rear laptop port (skip hubs), try a second USB cable — thin "charge-only" cables are a common culprit — or switch to the 5V 2A wall adapter, which was carded into this tray precisely because it comfortably clears the estimated draw.

Can I leave the probe in the pot permanently?

Yes — that is the point of a capacitive probe, and this V2.0 module is sold as corrosion-resistant. Keep the electronics end above the waterline, wipe the blade when you repot, and expect to re-check calibration seasonally as soil composition changes. If you are choosing between sensor types for a long-term install, our capacitive-vs-resistive corrosion comparison (queued next on this blog) shows why resistive forks lose this fight.

What should you build next?

If you landed here without the basics, rung one of the ladder is your first Arduino project: a button-controlled LED in 30 minutes — same Soldr workflow, simpler circuit. From this build, the natural next rung is a WiFi upgrade: your board already has the radio, so a temperature-and-humidity dashboard on your phone is mostly code, not new parts. And since you now own a calibrated moisture probe, read our capacitive vs resistive soil moisture sensor comparison (queued next on this blog) before you buy probes for every pot in the house.

Or evolve this build right now: open Soldr, Compoden's AI build assistant, describe your monitor in one sentence, and then do what we did — keep talking. "Add a pump." "Make it log to my phone." The tray, wiring, and code follow the conversation.

Frequently asked questions

Soil moisture monitor banane ke liye kya kya chahiye?

You need six parts: an ESP32-DEVKITC board (Rs.340), a Capacitive Soil Moisture Sensor V2.0 (Rs.55), an SSD1306 0.96-inch OLED display (Rs.246), a 5V 2A power adapter (Rs.140), a Dupont jumper wire kit (Rs.60), and a SYB-170 mini breadboard (Rs.20). Total: Rs.861 from Compoden, cash on delivery available across India.

How much does this soil moisture monitor cost in India?

Rs.861 for the full six-part tray from Compoden. The dry-soil LED upgrade adds about Rs.135 (LED pack Rs.60 + resistor pack Rs.75). Prices checked August 2026; cash on delivery is available.

Can I build this with an Arduino Uno instead of the ESP32?

Yes, with three changes: the sensor's AOUT goes to A0, I2C moves to A4 (SDA) and A5 (SCL), and your calibration numbers land in the Uno's 0–1023 ADC range instead of 0–4095. But note why Soldr carded the ESP32 in our session: it was "the lowest-cost part that meets the requirement" at Rs.340, and its built-in WiFi means the phone-dashboard upgrade later needs no new board.

Do I need the SYB-170 breadboard for this build?

No. This build's seven wires connect straight module-to-module — Soldr's own session describes the breadboard as "a passive, temporary platform for holding connections during prototyping," which is a convenience, not a requirement. Keep it for a steadier rig while you calibrate, or skip it and save Rs.20; the wiring and code are identical either way.

Back to blog