
Here is the general diagram of the whole system.

Final Project summary page
What did you design?
My final project is an irrigation system controller. It allows me to schedule irrigation events by zone and time, and it also shows humidity and temperature. The PCB has extra pins for expansion.
There are a number of companies that sell irrigation controller systems.
On the Alibaba website, we can see many options with an almost infinite price range, as well as capabilities.

JOGIN FRANCIS made a really nice automatic valve for irrigation automation that could definitely add to my project, but for now, I will focus more on the interface and controller and use commercial valves.

João Milheiro also made an irrigation system. He is using it to control the environment of a mushroom growing kit.

I designed the PCB that has at its center an ESP32, relays for the activation of various equipment like solenoid valves and a pump, and a sensor.
I also designed the waterproof enclosure as well as a gasket.
Finally, I designed the web interface to allow connectivity and operation of the system.
I did not design valves, sensors, actuators, or power supplies. These were commercially available items that were integrated into my final project.
To answer the questions above, I made a spreadsheet.
| Materials and components | Purpose | Source | Links | Quantity | Unit Price | Total Cost |
|---|---|---|---|---|---|---|
| MDF Forescolor | for the enclosure | Fablab Stock | forescolor.com | 90000mm2 (30 × 30 cm) | $0.000027/mm2 | $2.43 |
| Silicone | for the gasket | Fablab stock | amazon.es | 50g | $0.05/gram | $2.39 |
| Epoxy resin | to further waterproof the interior of the enclosure and help with the light diffusion of the LEDs | Fablab stock | amazon.es | 50ml | $0.01/ml | $0.60 |
| Total | $5.42 |
Electronics Board
| Value | Package | Description | Source Links | Quantity | Unit Price | Total Cost |
|---|---|---|---|---|---|---|
| PCB blank | Proto Board Copper Clad FR1, Single Sided, 1 oz. 5.00" x 4.00" (127.0mm x 101.6mm) | digikey.com | 1 | $2.44 | $2.44 | |
| FTDI-SMD-HEADER | 1X06SMD | CONN HEADER R/A 6POS 2.54MM | digikey.com | 1 | $0.18 | $0.18 |
| 22-23-2021 | 22-23-2021 | CONN HEADER VERT 2POS 2.54MM | digikey.com | 1 | $0.17 | $0.17 |
| header2x6 | 2X03 | CONN HEADER VERT 6POS 2.54MM | digikey.com | 2 | $0.48 | $0.96 |
| SWITCH | SWITCH TACTILE SPST-NO 50MA 12V | SWITCH TACTILE SPST-NO 50MA 12V | digikey.com | 2 | $0.20 | $0.40 |
| 0.1uF | C1206FAB | CAP CER 0.1UF 50V X7R 1206 | digikey.com | 2 | $0.11 | $0.22 |
| 100uF | C1206FAB | CAP CER 100UF 10V X5R 1206 | digikey.com | 1 | $1.49 | $1.49 |
| 15pf | C1206FAB | CAP CER 15PF 50V 1206 | digikey.com | 2 | $0.19 | $0.38 |
| 1nF | C1206FAB | CAP CER 1206 1NF 250V X7R 10% | digikey.com | 1 | $0.27 | $0.27 |
| ESP32-WROOM-32 (16MB) | ESP-WROOM-32 | WIFI MODULE 128MBITS SPI FLASH | digikey.com | 1 | $4.50 | $4.50 |
| LED | LED1206 | Standard LEDs - SMD 1206 Blue | eu.mouser.com | 7 | $1.45 | $10.15 |
| 100ohm | R1206 | RES SMD 100 OHM 1% 1/4W 1206 | digikey.com | 5 | $0.57 | $2.85 |
| 10k | R1206 | RES SMD 10K OHM 1% 1/4W 1206 | digikey.com | 3 | $0.57 | $1.71 |
| 1.2Mohm | R1206 | RES SMD 1.2M OHM 5% 1/4W 1206 | digikey.com | 1 | $0.10 | $0.10 |
| 1.5Mohm | R1206 | RES SMD 1.5M OHM 1% 1/4W 1206 | digikey.com | 1 | $0.18 | $0.18 |
| 150ohm | R1206 | RES SMD 150 OHM 5% 1/4W 1206 | digikey.com | 2 | $0.10 | $0.20 |
| 1K | R1206 | RES SMD 1K OHM 1% 1/4W 1206 | digikey.com | 4 | $0.57 | $2.28 |
| 220ohm | R1206 | RES SMD 220 OHM 1% 1/4W 1206 | digikey.com | 4 | $0.10 | $0.40 |
| SRD-05VDC-SL-C | RELAY_SRD-05VDC-SL-C | SRD-5VDC-SL-C 5 Pin PCB Type | banggood.com | 4 | $1.99 | $7.96 |
| ACS712 | SO08 | SENSOR CURRENT HALL 20A AC/DC | digikey.com | 1 | $2.32 | $2.32 |
| Diode | SOD123 | DIODE GEN PURP 100V 200MA SOD123 | digikey.com | 4 | $0.13 | $0.52 |
| EL817(S)(D)(TU)-V | SOIC254P1030X460-4N | OPTOISOLTR 5KV TRANSISTOR 4-DIP | digikey.com | 4 | $0.18 | $0.72 |
| BCX70SMD | SOT23 | TRANS NPN 45V 0.1A SOT23 | digikey.com | 4 | $0.19 | $0.76 |
| MCP1700T-3302E/TT | SOT95P237X112-3N | IC REG LINEAR 3.3V 250MA SOT23-3 | digikey.com | 1 | $0.37 | $0.37 |
| TEMP-HUM-SENSOR-DHT22 | TEMP-HUM-SENSOR-DHT22 | SENSOR HUMID/TEMP 5V DTL 5% MOD | digikey.com | 1 | $5.00 | $5.00 |
| Screw Clamp | W237-102 | WAGO SCREW CLAMP | aliexpress.com | 4 | $0.10 | $0.40 |
| ECS-.327-12.5-13X | XTAL_ECS-.327-12.5-13X | CRYSTAL 32.7680KHZ 12.5PF TH | digikey.com | 1 | $0.24 | $0.24 |
| Total | $47.17 |
How to make a web interface that communicates smoothly with C++? I used the ArduinoJson library, which serialized and deserialized the communication between the HTML, JavaScript, and C++.
How to set the time and keep it from being lost with a power loss? That's still a challenge to be tackled, as I am not completely happy with how the system keeps time. Right now, it relies heavily on the battery in case of power failure.
The firmware has worked for 3 months so far, irrigating my plants. What I am not very happy with is that if the battery runs out, because it is in a remote location, we need to bring a hotspot so it connects to the Internet automatically to get the Internet time.
I did not have time to create a safety routine to check the pump amperage. The board has the components, but the software is not developed yet.
My objectives with my final project were to have an irrigation controller on my Fab Farm and at the same time learn code and electronics.
Let's see my evaluation questions:
Yes
Yes
Yes
Yes
Yes
Yes and no. I don't believe a non-technical person can install it, but anyone can operate it.
Yes! It improved mine! We don't need to go and water the plants like before, having to open and close valves about 8 times a day.
Yes, I am much more confident programming in C++ now.
Yes, I feel like I can move on to many more projects in electronics.
The MCP1700 regulator gives up to 250 mA, and the ESP32 can pull around 500 mA in short peaks when the Wi-Fi transmits, which can reset the board. Next time I would use a regulator of 500 mA or more, like the AP2112 or the AMS1117.
Interface and Application Programming
Attribution-NonCommercial-ShareAlike.
license fileI would like to thank my local instructor Luis Carvão for all the tips and the time dedicated to helping me finish this project and the Fab Academy course.
I would also like to thank my friend Jeff Knight for the instructions on C++ during one day and a late night he spent helping me implement the ArduinoJson library in my project.
Jeff also contributed the following commits to the firmware here: