Arduino and solenoid valve

Hi everyone,

First I'd like to say that I'm not very advanced in using Arduino and in control/command, so I'm sorry in advance if my questions are not relevant.
I would like to control a 12 or 24V solenoid valve using an Arduino device.
The Arduino is giving 3 or 5V but the valve needs 12V (or 24), so my question is how can I do that?
Is it something I could do using the Arduino MKR Relay Proto Shield ?(Arduino MKR Relay Proto Shield — Arduino Official Store ; I've got a MKR 1010 but I could sue other arduino boards if needed). Or should I use something else and what would you suggest?

Thanks a lot for your guidance :slight_smile:

The pins of a Arduino board are for sensors, or a single led or to control modules, they deliver only a few milli-amperes. You solenoid might need a lot of amps.

It starts with your solenoids. How big and how strong do you need them to be ? What is the maximum peak current that they need ?
A project with a few small solenoids is easier than a project with many big solenoids. Don't buy the strongest solenoids that you can get, just because you can :grimacing:

Can you tell us about your project ? What is it for ?

Relais can cause sparks between the contact points and the contact points can melt to each other. That is why we prefer mosfets or transistors.

You can build something yourself with mosfets or buy modules.

May I warn you in advance ? Please don't buy the cheapest dirt from Amazon/Ebay/AliExpress. They sell modules with fake components. They sell for example relay modules for 10A, but in real life they are not even good for 1A.

Thank you Koepel for your detailed answer!
That's for a professionnal project (research) so I won't go for very cheap material and only referenced ones.
I'd like the arduino to control solenoid valve connected to a gas tubing transporting air.
For the solenoid, i can use any, like these ones for example:https://ca01.smcworld.com/catalog/New-products-en/pdf/es70-51a-vxz.pdf
For the mosfet, when I was looking for something, I came upon that (Module à MOSFET 5 A GT1168 - Optocoupleurs et transistors | GO TRONIC), sorry this is in French. Would that be useful ?
Thanks again

Just a comment. As I said, it's for a research project si I have some budget for that. But not an unlimited one and I'd like to do it by myself son that's why I'm going for Arduino :grin:

Something like this will work. It's overkill for a solenoid valve, but that's not a problem.

A motor driver like this one would also work, but may be harder to understand.

Thanks a lot!
Would that Mosfet could work also: Gravity: MOSFET Power Controller - DFRobot?
Or perhaps I could use this MKR shield that can drives motors: https://docs.arduino.cc/hardware/mkr-motor-carrier?
Thanks!

That looks fine. I've had good luck with DF Robot parts.

The 24V DC valves are perhaps more common.
They are 7.5 to 15 Watt.
For 24V that is 0.3A to 0.6A, that is very reasonable.

Because it is not a test on your desk, but a real project with a "industrial" look, I suggest to use optocouplers. Everything else can go out the window :stuck_out_tongue_closed_eyes:

Keep the Arduino circuit separated from the power circuit.
That also means you need two different power adapters.

That DF Robot MOSFET Power Controller module seems to be the right module for you. It has a optocoupler. They also provide a schematic.
The mosfet seems to be a HM70P04K. It is a p-channel 40V mosfet.
:point_right: You need to add a flyback diode :point_left:
Just a common 1N4007 as flyback diode is okay. Sometimes I add a flyback diode near the mosfet and one at the motor, just to be sure.

There are other options, and modules that can drive more than one valve, but this is straightforward without hassle.

Thanks a lot, to both of you!
Actually I'll probably have to control three valves but I'll triple the mosfet.
You helped me a lot

Your link shows both piloted and direct valves. The piloted valves have very low power solenoids because the pressure differential actually operated the valve. BUT they are very slow in operation.
Direct operating solenoid valves take a lot of power because they do ALL the valve movement. But they are very fast operation. Design accordingly.
Paul

1 Like

Thanks Paul. I indeed saw something like that on the document but I did not know what it was relating too. Now I do!
I do not need for the valve to open or close very fast (something like à few seconds or even minute will Be Ok).

In my opinion the choice is not for speed, but for what you need for your project.

If you have a pressurized system (such as pressurized air in a workshop) then you can use piloted valves. Or for a pressurized water system. A piloted valve also means that the flow can go only in one direction.

If you want to open and close a valve, no matter what, then you better use a direct acting valve. The biggest ones that I tested are such as these: https://www.amazon.com/Beduan-Electric-Solenoid-Normally-Colsed/dp/B07N6246YB/.
With a direct acting valve, the flow can go in both directions, but it can only withstand the specified pressure from one direction.

If you want to open a valve really wide, then you can use a motorized valve.

Really? I can not believe that they omitted such a basic thing, what are they thinking?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.