Solenoid Valves (control). Can I use solenoid valves in different positions by microcontroller?

Best regard

  • \$\begingroup\$ i have no idea what you are asking. ... what do you mean by different positions? ... downvote for poor explanation \$\endgroup\$
    – jsotola
    Commented Dec 15, 2017 at 3:53
  • \$\begingroup\$ Three words: Pulse width modulation (PWM) \$\endgroup\$
    – user103380
    Commented Dec 15, 2017 at 4:43
  • \$\begingroup\$ @jsotola I think the user is asking about how to control different positions of the solenoid (how much the spring is compressed). \$\endgroup\$
    – user103380
    Commented Dec 15, 2017 at 4:51
  • \$\begingroup\$ @KingDuken, there is no description of the valve. there is no way to even guess what kind of valve it is and how the valve operates. all we know is that there is a solenoid involved. \$\endgroup\$
    – jsotola
    Commented Dec 15, 2017 at 5:04

1 Answer 1


Most solenoid valves are typically either normally closed or normally open, like relays, so you'll only get two positions. However (it was unclear in your question) a search does turn up true multiple position solenoid valves; here's a patent on one of them:


... but I'm a bit hard pressed to know where you might find one.

Controlling solenoids or solenoid valves of any size will usually require a transistor or other device, since an Arduino will only put out 40 mA per pin. For example, Adafruit has a small 5V solenoid that requires 1.1 Amps to drive it, and so therefore, a transistor:


In theory, you could turn on the solenoid for N time periods and and off for M time periods to control some sort of process (pulse width modulation (PWM), as some have noted). A true proportional valve, controlled by a variable voltage or current can also be used. Proportional solenoids do exist, for example:


and http://deltrol-controls.com/products/proportional-valves.

PWM is used to control the position of those valves. One reference for the details on construction are here:


The key element is:

With electro proportional solenoid valves, the power to the coil is controlled with a current control device, a proportional amplifier.

On how to drive a simple solenoid:

MOSFET as a switch to control 12 solenoid valves using arduino

The canonical answer to this sort of question seems to be here:

Proportional Solenoid Valve + Arduino

  • \$\begingroup\$ That's not true. You can control the compression of the solenoid spring depending the magnetic field produced by the current. In other words, a solenoid's position is not limited by two positions (spring fully uncompressed, spring fully compressed). This answer also doesn't answer the OP's question. The asker is not asking how to drive a solenoid with a microcontroller. The asker is asking how the position of a solenoid can be controlled. \$\endgroup\$
    – user103380
    Commented Dec 15, 2017 at 4:46
  • \$\begingroup\$ @KingDuken, that is incorrect. the OP has failed to specify if the reference is to the position of the solenoid or to the position of the valve. .... with such a vague question, any answer provided is a valid answer. \$\endgroup\$
    – jsotola
    Commented Dec 15, 2017 at 5:10
  • \$\begingroup\$ @KingDuken - Yes, there are proportionally controlled solenoid valves. I've updated the answer. \$\endgroup\$
    – asylumax
    Commented Dec 15, 2017 at 11:50
  • 2
    \$\begingroup\$ This disaster of a question should not have been answered at all. \$\endgroup\$ Commented Dec 15, 2017 at 12:01
  • \$\begingroup\$ That is true. The question is rather vague. So I apologize. \$\endgroup\$
    – user103380
    Commented Dec 15, 2017 at 21:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.