0
\$\begingroup\$

I am trying to control a 12V solenoid valve with an ESP 3266 microcontroller. I have connected the device to an IRFZ44N MOSFET, a 12V NiMH battery pack and a 12V LED for testing as shown here:

enter image description here

I have written a simple blink sketch to turn the switch on and off every second and tested it with a simple 5V LED. I also have the built in LED turning off and on at the same time. When I connect the 12V bulb, it stays on continuously. When I hook up a multimeter, the voltage reading seems to be moving from 13.13V, which is the voltage of the battery when connected directly, down to about 12.7V on the same cycle as the sketch.

I have worked with these MOSFETs before but I am stumped as to what I am missing here. If this is the wrong MOSFET, could someone recommend a better alternative(s)?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ What’s the purpose of D1? \$\endgroup\$
    – winny
    Commented Jul 2, 2023 at 17:07
  • \$\begingroup\$ Just trying to protect the microcontroller. Might be misplaced though. \$\endgroup\$
    – SteveC
    Commented Jul 2, 2023 at 18:07
  • \$\begingroup\$ If your MOSFET is conducting current all the time. That means that you have swapped the source terminal with the drain (body diode) or your MOSFET is dead. \$\endgroup\$
    – G36
    Commented Jul 2, 2023 at 18:11
  • \$\begingroup\$ Protect against what? How do you intend to turn off the MOSFET? \$\endgroup\$
    – winny
    Commented Jul 2, 2023 at 18:18

2 Answers 2

3
\$\begingroup\$

Why is IRFZ44N MOSFET with ESP 8266 always closed?

"Closed" in EE circles means a closed or short or highly conducting circuit. "Open" means an open or non-conducting circuit. In hydraulic or pneumatic circles it means the opposite. That is why we tend to use the words "activated" or "deactivated" because there's sometimes less confusion.

Anyway, assuming you mean that the MOSFET is activated all the time, this is because your diode gate drive circuit cannot deactivate the MOSFET and, the MOSFET remains conducting from source to drain due to charge being deposited on the gate-source capacitance.

Your circuit will not discharge that capacitor. Try adding a 10 k pull down between gate and source. Improvement --> replace the diode with a 100 Ω resistor; you don't need the protection that you think you do need.

\$\endgroup\$
2
\$\begingroup\$

ESP3266 is a 3.3 V device and IRFZ44N has a gate threshold voltage (Vgs(th)) of up to 4.0 V. Your series diode on the gate will rob you of even more gate voltage and makes no sense.

You need either a MOSFET driver (or some level sifter) or a MOSFET with lower Vgs(th). Your gate voltage from your ESP needs to be significantly higher than the rated Vgs(th) of the MOSFET.

\$\endgroup\$
3
  • \$\begingroup\$ That makes sense but why is it closing the gate? This MOSFET is normally open. \$\endgroup\$
    – SteveC
    Commented Jul 2, 2023 at 17:35
  • \$\begingroup\$ It isn’t, it just never opens in the first place. \$\endgroup\$
    – winny
    Commented Jul 2, 2023 at 18:19
  • 2
    \$\begingroup\$ As mentioned above, do not use "open" and "closed" in this sense. An open circuit means no connection and no current flow. Closed is a short circuit or meaningfully conductive state. A MOSFET is in this case a switch, and with no gate signal it is open, off, or non-conductive. \$\endgroup\$
    – PStechPaul
    Commented Jul 2, 2023 at 21:43

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.