Controlling 12v solenoid



  • I want to use an M5 to switch a 12v DC solenoid valve. I was hoping the GoPlus2 which takes a 12v input, but only outputs the motor voltage at 5v.
    Is there an 'off the shelf' solution?



  • I don't know that the Goplus2 module would work. Could you maybe not use a relay module triggered from one of the GPIO on the M5 to operate the relay and then feed 12 volts to the solenoid valve that way? If you're using the goplus2 module in addition, you could just maybe split the 12 volt power off and route one leg through the relay so that when you make and break that relay you energize your solenoid valve.



  • @ksprayberry That's a good suggestion, bit I should have mentioned that I may need to 'pwm' the output at 20-30Hz so a relay won't last long.



  • If you need to PWM the output, you can use a mosfet module. You can find a cheap one on eBay or AliExpress.

    0_1610017280844_4cf5d38c-ba95-4ae3-886d-db7c5321ab59-image.png