Plant thirst monitor

With the same board, monitor up to 12 plants.

These parts on their own: $100.

  • 10-Port Motherboard×1
  • USB-C×1
  • Soil Sensor×2
  • Screen×1
  • Light Grid×1

Smart Home · Wi-Fi · Bluetooth

What it does

A sensor in each pot. The screen shows how wet the soil is.

The light grid is green while the plant is fine and turns red when it is thirsty.

How to build it

  1. 1Slide the screen into ports 7 and 8.
  2. 2Slide the soil sensor into port 6.
  3. 3Slide the soil sensor into port 3.
  4. 4Slide the light grid into port 4.
  5. 5Slide the USB-C into port 10 and plug the cable into your computer.
  6. 6Plug it in and press Upload to board.

Uploading works from Chrome or Edge on a computer. Open this page there with the board plugged in.

On the board

  • 7+8ScreenSoil moisture as a number and a bar
  • 6Soil SensorInto the first pot
  • 3Soil SensorInto the second pot
  • 4Light GridRed thirsty, amber, green fine
  • 10USB-CPower and programming

The code

soil.cpp · 158 linesDownload
// Plant monitor: small (10-port) board, TWO Soil modules, Screen, Button.
// Two faces side by side, one per plant: happy, thirsty (tongue out) or soaked. Bar under each = moisture.
// Button: tap = big view of plant A / plant B / both · hold 1 s = store "dry" (probes in air) · double tap = store "wet" (probes in water).
// The board's 14 onboard lights follow the thirstier plant: green ok, orange dry, blue soaked.
// Optional Light Grid on port 4: the same as a traffic light, red (thirsty) / amber (getting dry) / green (fine), blue when soaked.
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#include "drivers/i2c_software.h"
#include <Preferences.h>
#include "modules/display/st7735_tft.h"
#include "modules/input/button.h"
#ifdef GRID_A
#include "modules/led/neopixel.h"
NeoPixelGrid grid(GRID_A, GRID_B);
#endif

ST7735_TFT   screen(SCR_SCLK, SCR_CS, SCR_MOSI, SCR_DC);
SoftwareI2C  busA(SOILA_SDA, SOILA_SCL), busB(SOILB_SDA, SOILB_SCL);
// The soil modules answer at 0x42 and ignore the register address: every read returns
// [raw lo, raw hi, status, 01, 01]. raw is ~0xFF00 with the prongs in air (open) and drops as the soil gets wetter
// (wet fingers: 0x6300 -> 0x3800). status 0x03 = prongs open, 0x02 = conducting. Read directly, no library.
struct RawSoil {
    SoftwareI2C* bus; uint16_t raw = 0xFF00; uint8_t status = 0; bool present = false;
    explicit RawSoil(SoftwareI2C* b) : bus(b) {}
…