Define
Measure
Analyse
Improve
Control

Define

Problem Statement

The fruiting environment humidifier was critical for mushroom development:

  • Requires consistent 90–95% relative humidity
  • Tank holds 20L and runs for ~1–3 days before empty (depending on ambient conditions)
  • Manual checks required visiting farm to verify water level
  • Operator visited farm at least every 2 days
  • Risk: Tank emptied mid-week without detection, humidity crash, crop loss

Observed incidents:

  • Feb 15: Tank empty, crop stressed (brown spots on caps)
  • Feb 22: Tank nearly empty, caught due to chance visit
  • Mar 1: Tank discovered empty again (coincidentally caught before fruiting blocks affected)

Project Goal: Eliminate risk of humidifier tank depletion and provide real-time visibility of tank water level.

Scope

  • In scope: Tank water level monitoring, alert system
  • Out of scope: Humidifier mechanics, humidity regulation

Measure

Baseline Data

Tank depletion incidents: multiple in 6 weeks

Detection method: Manual inspection (operator visit)

Time to detection: 0–2 days after depletion (luck-dependent)


Improve

Solution Design

Primary recommendation: make it a habit

The first suggestion was not to build a sensor. Someone was on-site at least six days per week, which meant the tank should never run dry if checking the water level became part of the daily routine. This is a well-worn lean principle - The Gold Mine by Freddy and Michael Ballé describes habitual, point-of-use checks as the most reliable way to prevent failures. A sensor doesn’t replace a habit; it catches the occasions where the habit slips.

The sensor and alerting system was built as a backup: low-cost, passive, and unobtrusive.

Hardware bill of materials:

ComponentCostPurpose
ESP32 microcontroller£5WiFi & BLE-enabled processor
XKC-Y26-V non-contact sensor£8Water level detection (binary)
USB power adapter£2.50Power supply
Enclosure (plastic)£1.00Environmental protection
Wiring/connectors£2.00Integration
Total£18-

System design:

XKC-Y26-V sensor (external, non-contact) → ESP32 → WiFi → Telegram Bot → Operator phone

Sensor logic:

  1. ESP32 reads XKC-Y26-V sensor state (binary: water detected at sensor level or not)
  2. If sensor reads low: send immediate Telegram alert
  3. If still low 6 hours later: send one follow-up reminder (avoids repeated notifications if the operator is asleep)
  4. Operator receives notification on phone

Installation:

  • XKC-Y26-V sensor mounted externally on the tank wall (non-contact; no drilling, no internal contact with water)
  • ESP32 mounted near the tank with short cable to sensor
  • ESP32 powered by USB adapter near fruiting tent

Alert messaging:

  • System booted: “System started”
  • Water present: no notification (no news is good news)
  • Water low: “Humidifier LOW ⚠️ - Check water level”
  • Still low after 6 hours: “Humidifier LOW - still needs water (reminder)”
  • Still low after 6 hours: “Humidifier LOW - still needs water (reminder)”
  • Water returned: “Water is back ok”

Control

Monitoring

Telegram group:

  • notifications and alerts were sent to a Telegram group chat which maintains history and uptime with 0 cost to the farm

Alert frequency:

  • Water present: no notification
  • Water low (first detection): immediate alert
  • Water low (still low after 6 hours): spaced-out follow-up reminders prevents spamming the operator repeatedly for the same unseen condition, allows for mitigation coordination using Telegram channel
  • Water level returned to high: immediate notification so other farm employees know the situation is no longer critical

Data Retention

  • Everything stored in a Telegram group chat
  • Farm workers can be added or removed from the chat as needed
  • Timestamp, state change

Maintenance

Daily: None (passive system)
Weekly: Check sensor mounting position; check light is on when water detected Monthly: Check ESP32 power adapter and WiFi connectivity


Results

Deployment period: Feb 18 – Mar 16 (4 weeks)

MetricBeforeAfterChange
Incidents per month4+0-100%
Time to detection (if empty)??<10 min-99%
Manual checks requireddailyweekly-86%
False alerts02*+200%
Crop loss from humidity1 batch0-100%

*False alerts were commonly due to the ESP32 not being unplugged when removed to allow cleaning the humidifier, however, as notifications go to a group chat, it is easy to send a quick message to explain so as not to trigger other farm workers into unnecessary action*.

Economic Impact

  • System cost: £18 (one-time)
  • Prevented crop loss value: ~€300 (estimated 12kg mushrooms, €25/kg retail)
  • ROI: 2,300%+

Lessons Learned

  1. Binary sensing is sufficient for binary constraints. Tank is either full or low; no need for continuous level granularity.
  2. Telegram was a great choice, free, no need for our own servers or app and can more sensors can be fed into the same channel, eg. regular rolling averages for tent conditions.
  3. WiFi connectivity matters. Farm location had a 5G mobile router with connection issues, and the system would only send an all ok message on first boot so it is hard to tell if the water level is fine or the connection has gone down in the farm if you would have expected a notification at a given time and had not received one yet.
  4. Future improvements:
    • Automatic logic to turn OFF humidifier when tank empty (prevent motor damage)
    • Predictive model: “At current usage rate, tank will empty in X hours”
    • Acknowledge message via Telegram to suppress follow-up reminders
    • A funny thing was that the WiFi router in the farm seemed to reconnect every morning at 6.50am, which effectively created a daily heartbeat message that, if I were to code this again, I would definitely include

Open source

I published the code and rough step by step as watermon so that others can use or fork for their own purposes.