Build an Arduino plant moisture monitor
ActivitiesProjects
Use a soil sensor to display moisture readings and compare what it reports before and after watering.
A basic Arduino plant moisture monitor needs only an Arduino-compatible board, a soil-moisture probe, and a short sketch that prints live numbers from a pot to your computer. You do not need a water pump, a display, or a Wi-Fi module to get a working readout—those are optional add-ons once the probe itself gives reliable numbers.
Capacitive vs. resistive probes
The first hardware choice is how the probe senses moisture. Two-prong resistive sensors push current through the soil to measure conductivity, which leaves bare metal exposed to damp dirt where it can oxidize and cause readings to drift. Capacitive probes, such as Seeed's Grove capacitive moisture sensor and Adafruit's STEMMA soil sensor, measure changes in capacitance instead, keeping the metal electrodes covered rather than directly exposed to the soil. That design avoids bare-prong corrosion, though it does not guarantee that every capacitive board is fully waterproof or maintenance-free.
Two ways to wire and read the sensor
How you wire the board and read its output depends on whether your probe uses an analog signal or a digital I2C bus.
- Analog path (Grove capacitive sensor): Connect black GND to GND, red VCC to 3.3 V or 5 V, and yellow SIG to `A0`, leaving the white NC wire unconnected—or plug the cable into a Grove Base Shield's `A0` port. Wire everything before applying power, because hot swapping is unsupported, and stop pushing the probe into the pot before the soil reaches its marked white line. On an Arduino UNO, a DC power supply helps avoid VCC ripple that can otherwise exceed 100 mV. Connect the board to your computer with a four-wire USB cable capable of transferring data, since a two-wire charging cable will not work. A minimal sketch initializes `Serial.begin(9600)`, reads `analogRead(A0)` in a loop, prints the value, and pauses 100 milliseconds; open the Arduino IDE's Serial Monitor or Serial Plotter at 9600 baud to watch the numbers update.
- I2C path (Adafruit STEMMA soil sensor): Wire VIN to your board's logic voltage, GND to GND, and SDA and SCL to the board's I2C pins. On an Arduino UNO or other ATmega328-based board, SDA is `A4` and SCL is `A5`; boards such as the Mega, Leonardo, and Micro use different pins. Install the `Adafruit seesaw` library through the Arduino Library Manager, open its example sketch, and set the serial console to 115200 baud.
Testing and calibrating in the actual pot
Before trusting a number in dirt, verify that the sensor reacts. On a STEMMA probe, touching the sensor body should make the reading climb; if the output stays flat or unreadable on either setup, recheck power, ground, and signal or I2C connections and confirm that the serial console baud rate matches the sketch.
Pay attention to which direction the numbers move, because opposite models behave in opposite ways. The Grove analog probe's output drops as soil gets wetter and rises as it dries out. The STEMMA sensor does the reverse, climbing from roughly 200 in very dry conditions toward 2000 in very wet conditions, with potted soil often landing around 300 to 500 as a rough illustration.
Even with the same probe model, individual units can produce different numbers in the same environment, and how tightly or loosely the soil is packed around the blade shifts the reading. Rather than copying someone else's cutoff value, bury the probe in the pot you plan to monitor, note the reading when the soil is dry enough for that plant to need water, and note it again after a thorough watering. Picking a threshold between those two observations gives you a practical local trigger for that pot. Because these capacitive probes deliver qualitative readings rather than a guaranteed volumetric water-content measurement, any percentage you map between your dry and wet endpoints should be treated as a relative scale for that specific pot and potting mix.
