Smart Irrigation System
A camera, a soil sensor, and a CNN — plants get the right amount of water without human guesswork.
In Kuwait, plants are watered on guesswork or fixed timers. In a region where water is a limited resource, that wastes liters per cycle and damages plants through over- and under-watering. We set out to build an automatic irrigation system that observes the soil, recognizes the plant, and only waters when both conditions agree.
Existing commercial controllers in the Gulf (e.g. Hunter X2-401 at ~70 KWD) handle scheduling but cannot sense soil moisture and cannot recognize what they are watering. They water on a clock, not on a need.
A two-microcontroller design: Arduino UNO reads a soil moisture sensor and drives the pump via a relay; a Raspberry Pi runs a CNN over a USB camera and tells the Arduino which species-specific threshold to apply. Pump only fires when species + soil dryness both vote yes.
The CNN is trained on three plant classes — mango, aloe vera, and pepper — each with its own moisture threshold (40%, 60%, 50% respectively). Images go through filtering and augmentation (rotation, scaling, brightness) so the model holds up under varied outdoor lighting. The two devices talk over serial; the Pi handles vision and decisioning, the Arduino handles the low-level sensor read and pump actuation. The whole loop runs continuously, so changes in soil or lighting are picked up in seconds.
Three test plants validated the classifier end-to-end. Each was identified correctly under varied lighting; the relay fired only when the soil reading fell below the matched threshold. Pepper's smaller, sharper leaves were the hardest case — early datasets confused them with mango — and a more balanced training set fixed it.
Sudden moisture readings caused the pump to chatter on and off — sensor noise was creating false decisions.
Moving-average filter on the moisture stream plus a short decision delay before the pump fires. Smoothed unstable readings and prevented rapid switching without sacrificing real-time response.
Two parallel processes on the Raspberry Pi (image capture + decision dispatch) occasionally caused a watering command to lag in real-time tests.
Rearranged the message order, dropped non-essential background work, and switched some delays to asynchronous timing so the Pi didn't block waiting for prior tasks.
- IEEE 802.11 — Wireless data transport for sensor readings to cloud/dashboard
- IEEE 1451.0 — Smart transducer interface — applied to sensor/actuator wiring
- IEC 61131 — Programmable controller standard — applied to Arduino + Pi control logic
The system delivered on its goal: water only when both plant type and soil moisture agree. Future work — more plant species, weather-proof enclosure, mobile dashboard, cloud-stored history, and longer outdoor field trials — would harden it for real farms. The 55 KWD bill of materials makes it cost-competitive against off-the-shelf controllers that do less.