This is a web based sprinkler system, that has gone through multiple versions. It has been a great source of learning, frustration, and a has been a 'project-in-the-works' for at least a couple of years. The reason for this project is to replace two sprinkler boxes that i use to control the water on my property, about 0.2 acres. WHAT??? for 0.2 acres? Why bother? Well...
I'm an avid gardener, and because i wanted a highly configurable watering system for my garden, I put in a custom 14 zone sprinkler system (5 for the main yard, and 9 in the gardening area.
I was unsatisfied with the klunky interface, and no web interface, and want to replace them with a much more functional device. It was my first project beyond the 'blink' testing stuff.
Version 1 (April 8, 2016)
This was a much simpler version of this project, (earlier version), It used a Raspberry Pi 2, had a LCD display device , and LED's showing which zone was on and the LCD showing the timing. It suffered from significant circuit noise, and was not stable enough for production. It was also the first circuit that I semi documented.
Version 2 (sometime in 2017's summer)
This version was an attempt to simplify some of the aspects of the device. The first change to the system was the NodeMCU, adding WiFi capabilities, as well as 'Classifying' the Relay Driver. This project documents the Relay part, and this project demonstrates the WiFi and Web Server Parts.
The final version of the NodeMCU Sprinkler wasn't documented in a project, nor was it ever tested as a replacement.
Version 3 (April 2018)
There was a processor change again to the ESP32. A slight change in libraries over time and updated libraries were used for WiFI and WebServer.
ESP32 - Relay Driver Test Project
Specifically the Relay Drivers will use three pins on the ESP32S (D25,D26,D27), for the two sn74hc595 shift registers, to control a 16 channel 5v relay board.
ESP32 - DS3231 RTC Test Project
The DS3231 uses two pins for the SDA, SCL interface (D21, D22), to allow us to accurately keep track of time and allow the handling of multiple schedules.
PCB Fabrication (April 2018)
This is the first project that i'd fabricated the PCB and used an outside source to create one for me. I've had a lot of Chemistry classes in my life, so i wasn't really worried about the safety of the process, and I felt the ramp up to PCB's may require some new tools.... and who doesn't like new tools.
Fitment - Etched PCB - Proto A
The above was my PCB using Ferric Chloride as echant. It was mainly a first 'run thru' to see if parts fit, check out the echant process, my ability to drill pcbs, etc. I found out that I needed a tool to drill a pcb. (See? I told you this would come up!) I managed to break five drill bits attempting by hand, in thirty minutes drilling seven or eight holes. I ordered a jewelers drill and a set of drill bits on Amazon and problem solved. The next attempt was ZERO drill bits destroyed, and all the holes drilled. I used glossy paper and an iron as an ink transfer method, and this worked... ok... sort of. Then i got some paper out of China that is made for this (think super glossy), that transferred 100% of the ink to the PCB. I was impressed, as the paper i had printed to had NO ink left on it.
Fitment - Etched PCB - Proto B
Transfer Paper Test
Etched Using Special Transfer Paper
Everything looked good, fit correctly! Time to got to the next level. I ordered 10 pcb made from seeedstudio.io, and had them delivered. Why 10? because that is the number of circuits they make for $5. I only used like 3 or 4 for testing and for soldering practice. I don't know how those SMD favoring folks can do it. I felt like a ham-fisted clown trying to solder things up. "Part Thru hole" for my fat hands... I got it done, and i'm just not ready for SMD yet.
Base board from China! Looks really clean! Oh my! The next picture is it all soldered, and hooked up for testing. Version 3's color was black.
This version suffered from much less noise, but still had noise that made unsuitable to 'set and forget', like most sprinkler systems. It also included three capacitors, 10mF at power supply and 0.1mF at power to ground on each sn74hc595. This really helped a lot. I found a direct solder of the capacitor from VCC to Ground of the chip itself instead of hooked to pin 13 (also hooked to ground), in an attempt to quiet the noise. I don't exactly know why, but a problem to look into with some testing another time. Also the original 10k resistor(for the flow meter) was added. At this point I designed version 4, a fritz file was converted to Gerber and sent to SeeedStudio.io for production.
Version 4 (May 2018)
Version 4's color was green. This version had a lesson in it. I made up all the files for the PCB, and sent it off to production. It returns, i'm all excited, fire up the soldering iron, get everything soldered on, and attempt to put the ESP32 on.... DOH! it's one width too narrow. I must of accidentally moved the pinset at some point. The lesson in this is, when you are done, and ready to push to have it made, take the simple step and print the circuit, and lay your main parts on it at least. Simple to avoid, silly to make this mistake.
Version 4.5 (May 2018)
Adjusted PCB layout to version 4.5 to match needs, and some minor mods. This time I chose red for the version color.
The next pic shows the circuit soldered and wired up.
I removed the second .1 caps, and it didn't seem to help and slowed the signal down enough that sometimes it was missed. Overall, this version ran pretty well, but i was bothered about the code mess, and wanted to add a few more components.
Version 5 (June 2018)
Redesigned the code, and add a couple of components, including an OLED display, for on device HUD, and a SD Card Reader to allow an upgrade in the web page delivery. Eventually, i'll add some on device buttons, but for now it'll use web control, and scheduling, for handling the watering. On the code side of things, a single messy program file was segmented into nine modules.
- ESP32-WiFi_SprinklerSystemController_v5.ino
- FlowSensor.h
- OLEDDriver.h
- RTC_Schedule.h
- RelayDriver.h
- RelayDriverControl.h
- SDReader.h
- Utility.h
- WebServer.h
This segmenting put the code in more functional groupings, and made it a LOT easier to work with.











Comments