I'm building a pump for which I need 4 medium strength solenoids (20-50N). 24V is probably the minimum I will need to put through them, but this is something I need to test, once I've got them working. At 24V they draw 400mA.
I've found various posts with very useful info, especially https://playground.arduino.cc/Learning/SolenoidTutorial and https://forum.arduino.cc/index.php?topic=417030.0
Will the attached sketch below work for one? If so what resistance should R1 be? And if so can you see any problems with hooking up 4 working at different intervals?
The power supply is an LRS-350-24RS, and the Mosfet has a max gate source voltage of 35V. The 5v-24v optocoupler is off ebay - https://www.ebay.co.uk/itm/152904980799
Many thanks for your help!!