Projects / Vermicompost bin moisture keeper

Vermicompost bin moisture keeper

Beginner1 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANO

    Calibrate

    Print the raw reading in dry bedding and in damp bedding and choose DRY_RAW between them.

  2. NANOON21.8°C

    Wire the pump

    Pump through the relay's COM and NO from the AA pack, with the flyback diode.

  3. NANOON9.1 mA

    Wire the electronics

    Sensor on A0, relay on D7, LED on D13.

  4. NANO21.8°C

    Test the spray

    Temporarily lower DRY_RAW so it triggers, and check the pump runs for 2 seconds.

  5. NANO

    Fit the nozzle

    Run the tube to a drip nozzle above the bedding, with the reservoir below or beside the bin.

  6. NANO

    Set it up

    Return DRY_RAW and put the sensor in the middle of the bedding.

  7. NANOCAPACITIsoil 25%

    Watch for a day

    Check moisture and that the bedding is damp, not soaked.

In short

How do you build a vermicompost bin moisture keeper?

A soil sensor in a worm bin sprays a little water when the bedding gets too dry, keeping worms healthy in summer. You need Arduino Nano, Capacitive Soil Moisture Module, Relay Module 5V, Mini submersible water pump (3 to 6 V), Rectifier Diode 1N4007, LED 5 mm red, Resistor 220 Ω, Battery holder 4 × AA with switch, AA alkaline battery × 4 and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 60 minutes.

Level
Beginner
Time
About 60 min
Parts
10

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Soil sensor VCC, GND, AOUTNano 5V, GND, A0Moisture reading
Relay module VCC and GNDNano 5V and GNDSupply
Relay module INNano D7Pump control
Pump +AA pack + through the relay COM and NOSwitched 6 V
Pump -AA pack -Return
1N4007 across the pumpCathode on pump +, anode on pump -Flyback diode
Status LED anodeNano D13 through 220 ΩLit while spraying
AA packNano VIN and GNDPower for everything

Code

Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). No libraries. Calibrate the sensor by reading it in dry bedding and in damp bedding with the serial monitor, then set DRY_RAW between those values. Use a drip nozzle so the water spreads over a large area, and keep the water reservoir small so a fault cannot flood the bin. If your relay is active-high, swap the HIGH and LOW writes.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const byte SOIL = A0, RELAY = 7, LED = 13;
const int DRY_RAW = 520;                       // capacitive sensors read higher when drier: set from your own tests
const unsigned long SPRAY_MS = 2000;           // 2 seconds of water
const unsigned long WAIT_MS = 30UL * 60UL * 1000UL;   // wait 30 minutes before checking again
unsigned long lastSpray = 0;

void setup() {
  pinMode(RELAY, OUTPUT); digitalWrite(RELAY, HIGH);   // most relay modules are active low
  pinMode(LED, OUTPUT);
}

void loop() {
  long sum = 0;
  for (byte i = 0; i < 16; i++) { sum += analogRead(SOIL); delay(10); }
  int raw = sum / 16;
  if (raw > DRY_RAW && (lastSpray == 0 || millis() - lastSpray > WAIT_MS)) {
    digitalWrite(LED, HIGH);
    digitalWrite(RELAY, LOW);                          // pump on
    delay(SPRAY_MS);
    digitalWrite(RELAY, HIGH);                         // pump off
    digitalWrite(LED, LOW);
    lastSpray = millis();
  }
  delay(1000);
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Dry beddingPump runs for 2 seconds
Damp beddingPump stays off
After a sprayNo more spraying for 30 minutes
Sensor lifted outReads dry and sprays once only

If it does not work

Pump never runs

Check the relay wiring and that it clicks when you lower DRY_RAW.

Pump runs but no water

Tube kinked or the pump is dry. Prime it.

Over-watering

Increase the wait or shorten the spray.

Sensor reads strangely

The board's coating must be intact and only the probe tip in the bedding.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the vermicompost bin moisture keeper?

Arduino Nano, Capacitive Soil Moisture Module, Relay Module 5V, Mini submersible water pump (3 to 6 V), Rectifier Diode 1N4007, LED 5 mm red, Resistor 220 Ω, Battery holder 4 × AA with switch, AA alkaline battery × 4 and Jumper wires male to male (40 pcs, 20 cm).

How long does the vermicompost bin moisture keeper take to build?

About 60 minutes for a beginner maker, in 7 steps.

How do I know the vermicompost bin moisture keeper works?

Dry bedding: Pump runs for 2 seconds. Damp bedding: Pump stays off. After a spray: No more spraying for 30 minutes.

Pump never runs: what should I check?

Check the relay wiring and that it clicks when you lower DRY_RAW.

Pump runs but no water: what should I check?

Tube kinked or the pump is dry. Prime it.

Over-watering: what should I check?

Increase the wait or shorten the spray.

Sensor reads strangely: what should I check?

The board's coating must be intact and only the probe tip in the bedding.