I have a ESP8266 that needs to switch a water valve that draws 500mA on 12V. What can I use to switch that load? Right now I think I will use a logic level Mosfet but I am a bit lost with choosing the right one and the right resistors.

  • 1
    \$\begingroup\$ Why not draw what you think might work instead of saying you are lost because saying you are lost doesn't constitute an answerable question because nobody except you knows why or where you are lost. Make an effort even if it's wrong. \$\endgroup\$
    – Andy aka
    Commented Jun 1, 2020 at 16:42

1 Answer 1


You want to choose a MOSFET with a low Gate threshold voltage as your logic level is limited to 3.3V, at 500mA there are alot of options including:

  • NDT3055L
  • NDT456P

Just to name a few, you probably want to add a flyback diode as I assume the valve will uses a coil that gets magnetised to engage the valve.

enter image description here

You do not need a current limiting resistor on the Gate of the MOSFET as MOSFETS draw almost no current into the gate. A pull down resistor is useful so as to ensure the gate is at a known state when the output of the ESP8266 pin is either disconnected or is in a high impedance state. A 10k will suffice as it is a strong enough pull down but will not draw too much current when the gate is high.

(The circuit shown above uses an N channel MOSFET and will be engaged when the gate signal is high, if the reverse is required, a P channel should be used.)

  • 1
    \$\begingroup\$ I think the limiting resistor is essential as the brief current flow to charge gate, may fry MCU's output drivers. \$\endgroup\$ Commented Jun 1, 2020 at 17:03
  • \$\begingroup\$ @TirdadSadriNejad are you saying that the output of the MCU is not current limited? \$\endgroup\$
    – Aaron
    Commented Jun 1, 2020 at 17:05
  • \$\begingroup\$ @Aaron yes. I think they are not. \$\endgroup\$ Commented Jun 1, 2020 at 17:27
  • 1
    \$\begingroup\$ The ESP8266 has a maximum current output of 12mA so I think it'll be fine without a current limiting resistor although you're right it wouldn't hurt to add one. \$\endgroup\$ Commented Jun 1, 2020 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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