Automatic Irrigation using d1 mini

Hi Everyone,
I reviewed different automatic irrigation system projects here in instructables and other sites as well and i decided to gather parts to do a simple small project myself. One thing that comes hard is the programming part as I don't know any programming language. I'm looking for some help with code merging, explanation and some general guidance. Could you please let me know, point me to right direction and tell me what you think and if requirements are actually achievable?

What I would like to achieve:

Intention of this project is to have manual and auto irrigation system which will:

1. Measure soil moisture and dependently on the value activate the usb pump which will water the plant (preferably analog output that will show the measurements in %)
2. Manual activating the pump via hardware button and via mobile phone with internet connection
3. Distance sensor which should measure how much water is left in the tank
4. Email notification with info when to water the plants and soil sensor data regardless of the automatic process that has already started
5. Email notification with info about the water in the tank when it’s near empty
6. Dashboard preferably inside the network (not using third party like blynk or others) with access from the internet (I have QNAP that I think can be used).
7. If possible – have amazon echo (Alexa) read the sensor data to tell me the values and comment if the plant should or shouldn’t be watered or the tank should be refiled or not as well as ability to ask Alexa to start or stop the irrigation

D1 mini:

Wemos V2 Relay shield:
My relay is slightly modified:
2 small wires soldered to the vcc and ground so that when it receives the signal on d1 pin it opens and current flows to female usb connector supposedly activating the usb water pump. All this can be stacked together even with soldered wires

YL-69 sensor:

Ultrasonic Distance Sensor (HC-SR04):

USB mini water pump:

Button x4 if needed:

Board x4 if needed:

sample codes used in other projects:


Alexa enabled homemade cat feeder example:

Thank you very much in advance for your help and support.

wube (author) 17 days ago

Here is how the relay shield for d1 mini after modification looks like..