Automating watering of home garden for an extended holidays will keep away holyday makers from worrying of plants at home.

The ESP32 watering system Cost of Goods does not exceed MYR130.
Here are the list of cost, MPN/CPN (Manufacturer Part Number, Customer Part Number), the website I had used to purchase the parts.

| CPN/MPN | Description | Supplier URL | Quantity | Cost |
| BB-AHALR-3V-01 | 1CH Active H/L 3V OptoCoupler Relay Module | https://my.cytron.io/p-1ch-active-h-l-3v-optocoupler-relay-module | 1 | 7.00 |
| MAKER-SOIL-MOISTURE | Maker Soil Moisture Sensor (Capacitive) | https://my.cytron.io/p-maker-soil-moisture-sensor | 1 | 20.58 |
| WR-GROVE-2561 | Grove 4 Pin Buckled to Female Cable | https://my.cytron.io/p-grove-4-pin-buckled-to-female-cable | 1 | 1.50 |
| WR-JW-40FF | 40 Ways Female to Female Jumper Wire | https://my.cytron.io/p-40-ways-female-to-female-jumper-wire | 1 | 2.50 |
| WR-JW-40MF | 40 Ways Male to Female Jumper Wire | https://my.cytron.io/p-40-ways-male-to-female-jumper-wire | 1 | 2.50 |
| MO-SMWP-5V | Micro Submersible Water Pump DC 3V-5V | https://my.cytron.io/p-micro-submersible-water-pump-dc-3v-5v | 1 | 3.90 |
| 40-Casebox | Battery Holder With Connector Or Case Box | https://shop.techmakers.com.my/1-2-3-4-battery-holder-with-connector-dc-jack-or-case-box-with-on-off-switch-cover-aa-aaa-3-7v-18650-9v | 1 | 1.80 |
| 40-500272 | JST Connector Wire Cable 1 Pair | https://shop.techmakers.com.my/jst-male-female-connector-wire-cable | 1 | 0.90 |
| ESP32-WROVER-IE | ESP 32 NODEMCU IOT | https://shop.techmakers.com.my/arduino-nodemcu-iot-esp32-esp-32-wifi-bluetooth-development-board | 1 | 32.80 |
| 40-17Core | 1 meter 17/0.2mm 20AWG White | https://shop.techmakers.com.my/jumper-wire-multi-strand | 1 | 1.50 |
| 40-17Core | 1 meter 17/0.2mm 20AWG Blue | https://shop.techmakers.com.my/jumper-wire-multi-strand | 1 | 1.50 |
| 40-ESP32/S | 38Pin Base(purple) | https://shop.techmakers.com.my/esp32-ultra-low-power-consumption-dual-core-wifi-bluetooth-development-board | 1 | 14.50 |
| 1N5819 | Schottky Rectifier, 40 V, 1 A, Single, DO-41 (DO-204AL), 2 Pins, 550 mV | https://my.element14.com/stmicroelectronics/1n5819/diode-schottky-1a-40v-do-41/dp/9801219 | 5 | 9.30 |
| Total | 100.28 |
The cost of main materials are MYR 100.28, the diode that will act as flyback to prevent current flow in opposite direction has a MOQ (Minimum Order Quantity) of 5. Hence, any buyer needs to buy at least 5 units from Element14.
MOQ is an usual term when item is purchased, especially when it comes to ordering item that the courier cost, or cost of operations requires a bare minimum quantity that a manufacturer or a vendor are willing to provide to complete a business transact with the buyer/customer.

Espressif ESP32-Wrover-IE, I prefer to use this as it is affordable for any hobbyist that looking for a IoT dev board. It comes with 38 pins that has a wide numbers of GPIO. On top of that, it has built-in WiFi and BlueTooth to this SoC. IE is chosen for the ESP32-Wrover variant as it allows developers to attach an external antenna to extend the range of the built in anteanna. At MYR33 ~ it is a good board for developers and students alike.

This is a good board to complement the ESP32-Wrover-IE. This board allows neater interface of supplier voltage, ground and data pin next to each other. On top of that the clear labelling of the pins help developers to work more effective and efficiently. Color code black means ground, red means supplier voltage and lastly yellow are the data pin. Color code allows easier wiring of sensors on to the board under development. The extender board 38 pins are more reliable than the conventional breadboard. Spend more on this as its really reflects of you get what you paid for.


Relay were selected instead of a MOSFET as motor operations does not requires high precision time. The pump allows error in miliseconds and it will not cause any form of critical failure. And it is a simpler and cheaper solution, the click sound makes the switch appears more authentic and functional to see how the entire system works.

To prevent wear and tear well as corrusion from elements, added rubber to the exposed parts. Capacitive soil moisture sensor is more expensive, but non capacitive type will wear out faster. For reliability use the more expensive sensor.

Assembling sensors to ESP32 board is easy. Make program is even easier using AI assistance. The first challenge was how to assemble the relay, motor to the ESP32 without shorting the ESP32.
After seeking consultation from a friend and more research from the guidance. Here is the final diagram.

Another challenge is soldering the parts and to ensure that the soldered part are properly insulated. Item used are straws, and hot glue. Below are the results.

Adding solid straws from vitagen can act as support as well to the soldered wires.

Not pretty but utility enough to make the prototype to work.

To finish the make shift system with a simple enclosure that is easily available for any food that order as take away.

Then added MYR21.00 worth of plumbling bought from pet shops.

Before completing the entire system, learn how to soil sensor returns value from dry soil or wet soil. In my case any value more than 2400 it is dry, anything less than 2000 is wet.

Let the sensor starts sending the data from dry soil to verify the value, then after 1 hour, add a good amount of water to verify the wet soil value is correct.
With the value known, assemble the system and have the first prototype software that waters the plant when the soil reaches the dry threshold.



Then it run into the first major roadblock. Deep sleep ESP32 on paper is good idea to conserve the battery pack power. But wrong was I, found out later that modern external battery pack for smartphone has a smart circuit that will stop charging or power if there is no load or very low load on the battery. ESP32 when sleep will cause the external battery to sleep with it.
So, for ESP32 using modern battery pack, do not use deep sleep. Make a simple WiFi heartbeat every 2 seconds. Not efficient way to use power but it will ensure the external battery does not sleep. A sleeping external battery will not be able to power up a sleeping ESP32.
Then leave it over the night, encounter roadblock number 2, the water bucket were emptied over the night. Later discovered that the controller were over watered. So, downloaded the data and pump into QWEN.
The new discovery were made that what made the sensor fails to notify the controller.

Term discovered is Ghost Spike. Apparently, the soil in my pots can causes gap in between soil and sensor at a micro level. The sensor will sense that the soil as dry as the water puts itself in between the soil and capacitive soil sensor causes a gap that simulate dry condition.
Since, I have no time to update the hardware or to solve soil mixture of my pots. A decision were made to only water the plant at 20.00 hours everyday, with 10 seconds of water flow. Added a data to record 1 to mark the pump has run. Maintain the sensor only to read.


Lastly, the system were rushed to production, a simpler approach were used. Added cover to prevent mosquito breeding into water bucket.
Improvement that can be made into this system are not limited to :
- Adding 2 solar panel
- Adding 2 rechargable battery pack
- Discover what is better way to prevent ghost spike