An I2C port expander will use only 2 precious pins.
sure, if you want all three valves to do the same thing. Actually, there are several ways to control multiple things with a single wire but it takes more circuitry and potentially some clever s/w.There is the standardized Modbus interface, but those devices are expensive.It could be something custom like using analog voltages created from PWM signals, frequencies that are filtered using notch filters, or a simple serial (not async) interface that can be decoded using an RC network and a shift register.I have used the latter to control a hd44780 LCD from an ATTiny part.But all those are much more complex than just using multiple Arduino pins.--- bill
Actually...I went on to say in that post that you could conceivably create this with three relays, a uc, and some way to communicate from your first Arduino to the one with the relays.
And I did see that, but I was talking about solutions that didn't need another microcontroller on the other end.--- bill
How would you use modbus to control a valve without some controller to receive the modbus signal and physically switch the valve?
You can't, I guess I was a bit unclear. I actually meant having to use another Arduino type micro-controller requiring programming on the receiver end since I was assuming using an off the shelf modbus relay/pump/device which has a microcontroller built into the device - which is why they are so expensive.--- bill
Hmm but would still need valves to direct the water to different places as I want control over the exact amount going into each plant box (overenthusiastic gardener).
In any Arduino, the analog output pin can send out different levels of voltage.