I’m looking to set up an automatic watering system for my avocado orchard. I have commercial sized irrigation taps that run on 24v solenoids and want to build a controller system that is run by a raspberry pico. Ideally the system will be able to tell the tap to turn on for 2 hours twice a week, as well as have a manual override button when you want to switch the tap on manually. The system should ideally use as little power as possible because it is not close to a source of mains power so the solenoid and the raspberry pico will run on battery.
The system will also live outdoors so needs a weatherproof box.
This problem reminds me of James’ Smart Watering System project, but with a smaller and more approachable set of requirements.
I’ll start with a couple quick questions to make sure I’m on the right page:
Just checking, I’m assuming these are the usual “sprung” kind that require DC current in a particular direction to open, and return to closed when current is removed?
The only reason I mention this is that your solenoids will probably use hundreds of times the current of the Pico and accessories if they are set up like this, so low power programming won’t be too imperative.
This won’t be too hard, at first glance I think all you will need is a main loop in your code that just repeats forever, checking which “state” the system is in (on, off, auto), and acting accordingly, with changes in state triggered by a check of the 3 buttons.
Are you comfortable with soldering? That changes the options available for hardware choices - no worries if you’re not.
I’ve just been and checked the solenoids, they are actually 9-12v ‘latching’ solenoids, so they only require a pulse to turn on and a pulse to turn off. They also have a manual override built into them so the manual button isn’t a must but I would still like to add it.
Yes I have done a fair amount of soldering in the past so that’s not a problem.
Excellent! No worries, should be easy enough to use a latching solenoid for that purpose, the only major problem now is the power supply (I’d suggest looking into using some SLABs or Sealed Lead Acid Batteries) as well as being able to both power the Pico/Solenoids and finally being able to drive the solenoids from the Pico.
The two main options in this case are a couple buck voltage regulators or two separate power supplies (likely one for the Pico and another for the solenoids unless the solenoids can all happily run on 12V and you just regulate it down for the board) as well as some MOSFETs or relays for the Pico to be able to drive those solenoids without turning into a smoke machine.
What’re the specs on those solenoids? Do you know how much power you need to drive them or the max-current draw?
Glad to hear those solenoids are latching! That should greatly reduce the power consumption of this system.
Do you have any info on how the latching operates, or a part number so we can go have a look for that info?
I’m mainly wondering whether the pulse on and pulse off are the same polarity, or whether they need to be opposite. This decides whether simple relays or MOSFETS are enough, or whether repurposing a small motor driver is appropriate.
Do you know the current draw of the solenoids when engaged?
A small point but current (A) is amps, voltage (V) is volts. 6V is not current.
Just to point you in the right direction, not being critical. James should get the info he needs from the data sheet once the operating voltage (6V) is known.
Yes, that looks better. Looks like you may have actually measured the resistance, as good as or possibly better than finding your way around a data sheet which probably caters for several different solenoid models.
Great, that gives us the specs we need to pick drivers for those solenoids.
Since they have to be driven in reverse as well, motor drivers seem to be more appropriate.
Since the manufacturer specifies a 4.8 Ohm nominal resistance, you’re looking at a current draw of ~1.8A per solenoid at 9V (I = V/R), likely with a big spike when first turned on.
Our Makerverse Motor Driver is capable of 2A in short bursts, or longer if you add a heatsink, and features current limits to make sure nothing is blown due to inrush current. You could control 2 solenoids from each driver. It even comes with a basic 5V regulator to power the Pico (so you only need one supply for this whole project.
We stock quite a few Pololu regulators that can generate 6 or 9V, Are you able to supply 6V or 9V directly? Or do you need to step down?
Hi James, Chris.
James. That motor driver you suggest, while the idea is good, does not leave any headroom for 9V operation. Personally for me it is sailing a bit too close for comfort. I think a bit more robust H bridge would be better. But that is me. At the end of the day it is up to the user. I would tend to use a DPDT relay for solenoid direction and a single Mosfet and 1 schottky diode for flywheel suppression. 2 signals would be required. One for direction and one to operate the solenoid.
What sort of batteries were you considering. 9V seems an odd value for the larger ones you will probably required and I wondered if you were thinking of the small 9V units as used in things like multimeters, smoke alarms etc. I don’t think that type would have a very long life even if they actually worked.
Probably would not supply the current for 1 operation.
James’ idea has merit. I would go for a 12V solar system and massage down from there. If you need to distribute voltage over some distance the higher voltage would be preferred as there will be less power lost in the distribution wire. It boils down to whichever is most convenient under the conditions prevailing. Only you will know that.
Tip for selecting battery and charging capacity… Work out what you will need then DOUBLE it. Start from there. That way you should have plenty of head room.
Folks - those solenoids are AC. I have the same ones… Arduino, pico, pi can drive them but I think (at least the way I do it) a relay or relay module. Signals are usually 5VDC to those relay modules and then you need to switch on/off 24VAC with the relay(s) to turn on/off the solenoid valves.