Why? A D1 Mini has 8 Digital I/O ports that could drive a 3.3.v relay module.
Still looks like you could redefine RX to a GPIO and still have 8 if you didn't need serial input. I vaguely remember running into this issue with some load cell AMPs.
A Shift Register or IO Expander seem like the more interesting and less frustrating route. I'd probably end up using an ESP01 and i2c IO Expander because I'm a masochist and love trying to squeeze as much as I can out of the ESP01.
> $20 in parts
With how much ESPs go for right now I kinda doubt that, what's the whole BOM?
The cost of an irrigation system is making it user friendly for a customer.
Example: https://www.amazon.com/Hunter-Sprinkler-XC400-4-Station-Cont...
Like the OP's solution, it is a microcontroller hooked up to a relay array, but it also has:
* AC/DC Transformer
* Real-Time-Clock
* Battery backup
* User Interface
* Secure, weather proof housing
* Printed Instructions
And it costs less than $90. They're making a profit on them, so the BOM is probably closer to $20-30.
The solution is completely plug-n-play compared to building from scratch, setting up a home automation system, and programming a microcontroller.
D1 Minis are like $1.50 and ESP01s are $0.95.
The 01s are cheap for a reason - they're useless for most projects, hell I'm always running out of pins even on the esp32-cams.
8 pins, half of those gnd, vin, reset, and something else. 4 are usable I think.
You can get those in bulk for less than a dollar each and are my most used microcontroller. They're so easy to deploy and ear easily powered of USB wall warts with a regulator.
If you really need more GPIO you can get an I2C based IO Expander to add 10 more GPIO.
I suppose in this case you could do it in that roundabout way by stacking two of those for relay control since it's as basic as it gets.
I recently got rtlsdr to read my water meter so I can detect leaks, which is pretty cool
as long as you don't run several at once, can power from old wall wart with a few amps rating. I'm using a meanwell PSU so I can power a few other things - IR lights mostly
Take a look at the Spec for a valve from Rainbird:
https://www.rainbird.com/sites/default/files/media/documents...
Electrical Specifications:
• Power: 24 VAC 50/60 Hz (cycles/second) GBS25 Solenoid
• Inrush Current: 0.41 A (9.84 VA)
• Holding Current: 0.20 A (4.80 VA) at 60 Hz, 0.23 A (5.40 VA) at 50 Hz
If you have a sprinkler system, you can replace the on/off valve with a solenoid valve and then you're able to control the system electronically using a 24 VAC power supply and a switch. The OP replaced the switch with a relay, which is a switch that can be actuated by the lower voltage from something like a microcontroller.