AI-generated answer. Please verify critical facts.

The Rds(on) is only guaranteed with a minimum drive voltage of 4.0V. 3.3V is less than 4.0V.

Possibly the MOSFET is heating up which typically decreases the Vgs for a given current. If you got the IRLZ44 from some dodgy source it's possible it does not meet specs. Although it's bad design to use an IRLZ44 with 3.3V drive, I would expect it to typically work under nominal conditions. That kind of time constant sounds like thermal or possibly leakage (as in an open or almost open connection to the gate).

There are many, many MOSFETs which are rated with 3V, 2.5V and even 1.8V drive, but few, if any, in a through-hole package. Here is one example, 0.005\ maximum with 2.5V drive and 0.075\ maximum with 1.8V drive.

If the MOSFET fails with a drain-gate short it could damage (ie. destroy) the MCU. Electrical noise could reset the MCU. You could use an optocoupler or add some transistors to drive the MOSFET which would provide protection. You might also be worried about the solenoid lock being destroyed if the MOSFET fails on- I think most of them are only rated for very intermittent duty.

Answer from Spehro 'speff' Pefhany on Stack Exchange
🌐
Reddit
https://reddit.com › r/printedcircuitboard › review request: esp12 solenoid switcher - 3rd edition
r/PrintedCircuitBoard on Reddit: Review request: ESP12 Solenoid Switcher - 3rd edition
December 31, 2019 -

Hi all,

thanks again for all you remarks and feedback - your comments have really improved my design and understanding of the process.

Below are the links to the 3rd version off my-first-pcb.

It main function is switching a Solenoid/Magnet using an ESP12. Power is supplied from a single lithium-ion cell. This is dropped to 3.3V using an TPS736 LDO, and Stepped-Up to 12v via an LMR62014 Voltage Regulator. The Solenoid/Magnet are switched using a logic level Dual N-Channel MOSFET (DMN2215UDM-7 rated at 2A). They draw a maximum of around 250mAh each. I managed to keep things on 2 layers, so hopefully the power part is stable, but I'm willing to give it a try.

The main changes since version 2 are;

  • the high frequency switching is as far away from the WiFi antenna

  • better boost converter layout

  • the ground plane is much better! less random via's and almost full connected paths

  • non of the traces or via's are close to the board edge

  • added ground to the devices pin header for ADC signal return

  • added thicker traces to both the power rail & MOSFET switches

  • added input/output caps to the LDO

  • added a cap for ADC filtering

  • added filtering capacitor for VCC on the microcontroller

  • added pull down resistor on the gates FETs

With regards to the comment on the voltage drop over the LDO; this IC has a really low drop of around 75mV/100mV depending on the load. Since the ESP8266 already runs starting at 2.5v and the load it pretty small during TX bursts, I think I should be fine using a single cell to power things.

I unfortunately had no room to spare for ESD or reverse current protection, so I'll have to pay close attention when hooking things up!

Your feedback is again much appreciated. Thanks and a happy 2020 for all!

Schematic: https://docdro.id/rTmEDRa
PCB back: https://docdro.id/3EQF5cd
PCB front: https://docdro.id/Z18rrHw
PCB back fab: https://docdro.id/UQpdFTC
PCB front fab: https://docdro.id/LeMYzR0

3D views: https://imgur.com/a/NWEaqsO

LDO: http://www.ti.com/lit/ds/symlink/tps736.pdf
Regulator: http://www.ti.com/lit/ds/symlink/lmr62014.pdf
MOSFET: https://www.diodes.com/assets/Datasheets/ds31176.pdf

I've based the project on this programmer template: https://raw.githubusercontent.com/hamityanik/ESProg-ESP8266-Template-Horizontal/master/images/Sample_Schematic.png

version 2: https://www.reddit.com/r/PrintedCircuitBoard/comments/eh7iw8/redesign_solenoid_controller_via_esp12/
version 1: https://www.reddit.com/r/PrintedCircuitBoard/comments/egfka9/please_review_esp12_power_circuit_mosfet_drivers/

Esp-12F review Feb 10, 2026
r/esp32
9mo ago
I need help powering my esp Jun 29, 2020
r/esp8266
6y ago
ESP-12E, ESP-12F or ESP-12S ? May 7, 2017
r/esp8266
9y ago
Which ESP for general/low power application? Sep 29, 2017
r/esp8266
9y ago
Power Supply for ESP8266-12E Jan 23, 2020
r/batteries
6y ago
More results from reddit.com
🌐
Reddit
https://reddit.com › r/askelectronics › controlling solenoid with 3.3v / 5ma
r/AskElectronics on Reddit: Controlling solenoid with 3.3V / 5mA
April 5, 2023 -

Hello all,

So to give a brief summary, I'm developing a control board for some of my milling machine's peripherals. The bit that has been giving me trouble is a solenoid valve for the misting system. I've gone through a few tests a few times now that seemed to work, and then ordered a PCB with the changes, but problems seem to keep coming up (hence I'm asking here now as I'm a bit tired of it).

 

The hardware

The output voltage of the GPIO on my mill's controller (MicroMill 2000HD/LE)seems to be 5mA @ 3.3V (I was told 5mA @ 5V by the manufacturer, but this turned out to be wrong. Waiting on further responses from them...). I found out that the parallel port pins of my mill PC was being passed directly through to this GPIO port, with a 1K pull-up to 5V (diagram). It seemed to happily source ~53mA when quickly shorted, but I presume somewhere in the range oif 10mA is safer.

 

The solenoid I am using operates at 12V DC (7W), consuming ~600mA.

 

The schematic

Here's the schematic. The OUT1 pin is 3.3V. On the right side, the optocoupler should control the solenoid connected to J9.

 

I decided to use an optocoupler (CPC1301GR) in order to control the solenoid with the GPIO, as this one has a low input control current. My choice of resistor (900ohm) should draw ~3.67mA. I am also aiming to isolate the peripherals (e.g. solenoid) from the rest of controller, hence another reason why I chose an optocoupler.

 

The results

Unfortunately, it's misbehaving (as you may have guessed). If I briefly toggle OUT1 (thus not fully saturating the solenoid coil), the optocoupler is able to 'shut off'. However, leaving OUT1 high for a few moments (thus saturating and actuating the solenoid valve), then setting OUT1 low, causes the optocoupler to remain conducting (across pins 3/4) until I remove power.

 

I am noticing now in the optocoupler datasheet in the "CTR vs. LED Current (IF)" graph, I should have a CTR at around 4000% from the 3.67mA that should be sourced from OUT1, thus resulting in ~147mA that can be drawn across the optocoupler pins 3/4 (if I have understood the datasheet correctly). However, I don't understand how the solenoid could be actuating with this little current (unless the optocoupler has become damaged at this point).

 

So obviously my design is bad, and I should redo this. So I am wondering, how should this circuit actually be properly designed (i.e. did I miss anything important?), or should I consider an alternative approach not using an optocoupler? If any more info is needed, I would be happy to provide.

 

Thanks for reading all this, and any help/advice is appreciated!


Some updates: I have updated the design to this using some advice on designing around parallel port data pins. The Microcap sim of the design with OUT1 high can be seen here as well.

From playing around with it so far, this looks like it will be a more reliable design.

🌐
Core Electronics
https://forum.core-electronics.com.au › t › switching-on-a-solenoid › 21800
Switching on a solenoid - Page 5 - Core Electronics Forum
February 13, 2025 - I need to use a TIP41 to turn on a solenoid (approx 22R coil resistance) I reckon I need close to 500mA so I determined a base current ot 10mA assuming hFE of 50 (TIP41 is 30-75 from what I’ve read. ) So, with all o…
People also ask

Can I power the solenoid from a separate 6–9 V supply and still use 3.3 V control?
Yes. Drive the MOSFET gate from the 3.3 V GPIO, power the solenoid from its own supply, and tie the grounds together. “Make sure the ground of the solenoid power supply is connected to the ground of your Spark Core power supply.” [Elektroda, Screaming Circuits, post #21673753]
🌐
eeweb.com
eeweb.com › home page › forum › circuit design › eeweb topics
Best MOSFETs for Driving 12V Solenoid With 3.3V Logic From Spark ...
What MOSFET works best to drive a 12 V solenoid from 3.3 V logic?
Use a logic‑level N‑channel MOSFET. The thread recommends BS170 as an accessible option for 3.3 V GPIO control of small coils. If your solenoid current is higher, select a MOSFET with a larger continuous current rating. [Elektroda, Screaming Circuits, post #21673752]
🌐
eeweb.com
eeweb.com › home page › forum › circuit design › eeweb topics
Best MOSFETs for Driving 12V Solenoid With 3.3V Logic From Spark ...
How do I orient the flyback diode across the solenoid?
Place the diode directly across the solenoid terminals. Connect the anode to ground and the cathode to the MOSFET/solenoid positive side. It looks reversed in normal operation, but it conducts only during turn‑off to clamp the spike. [Elektroda, Screaming Circuits, post #21673752]
🌐
eeweb.com
eeweb.com › home page › forum › circuit design › eeweb topics
Best MOSFETs for Driving 12V Solenoid With 3.3V Logic From Spark ...
Top answer
1 of 2
1

The Rds(on) is only guaranteed with a minimum drive voltage of 4.0V. 3.3V is less than 4.0V.

Possibly the MOSFET is heating up which typically decreases the Vgs for a given current. If you got the IRLZ44 from some dodgy source it's possible it does not meet specs. Although it's bad design to use an IRLZ44 with 3.3V drive, I would expect it to typically work under nominal conditions. That kind of time constant sounds like thermal or possibly leakage (as in an open or almost open connection to the gate).

There are many, many MOSFETs which are rated with 3V, 2.5V and even 1.8V drive, but few, if any, in a through-hole package. Here is one example, 0.005\ maximum with 2.5V drive and 0.075\ maximum with 1.8V drive.

If the MOSFET fails with a drain-gate short it could damage (ie. destroy) the MCU. Electrical noise could reset the MCU. You could use an optocoupler or add some transistors to drive the MOSFET which would provide protection. You might also be worried about the solenoid lock being destroyed if the MOSFET fails on- I think most of them are only rated for very intermittent duty.

2 of 2
1

Although it is stated that it is a "logic-level gate drive" where "Gate Threshold Voltage: 1<VGS<2" in the mosfet datasheet, mosfet is acting weirdly with a gate voltage of 3.3V.

It is specified for Vgs of 4V, but not 3V3.

Why does it take 10 seconds for the current to rise to 1.8 amps (Gate: 3.3v)? While working perfectly with a gate voltage of 5.0v.

Most MOSFETs have negative tempco on their threshold voltage, and positive tempco on RdsON.

My guess is that there isn't enough voltage on the gate to turn it on fully. You can confirm this by measuring Vds and Id, which will give you RdsON. If it is much higher than the specified datasheet RdsON, then it's not turned on enough. So the MOSFET works in linear mode, and as it heats up, its threshold voltage decreases, which means it turns on more, and current increases. If current increases over 10 seconds, you should feel the MOSFET get hotter.

You either need a MOSFET that will turn on with a Vgs below 3V3 (so, another MOSFET). If you have a 5V power supply on your board, you can use a 3V3 to 5V level converter/driver, for example a 74HCT logic gate, to drive this MOSFET with 5V.

🌐
Arduino Forum
https://forum.arduino.cc › other hardware › motors, mechanics, power and cnc
3.3v switching valve solnoid - Motors, Mechanics, Power and CNC - Arduino Forum
September 26, 2017 - I have a solenoid valve that works with 5v and 800ma I want to control it with atmega328p 3.3v and "IRLML2502" if not propose a name of another "mosfet"
🌐
EEWeb
https://eeweb.com › home page › forum › circuit design › eeweb topics
Best MOSFETs for Driving 12V Solenoid With 3.3V Logic From Spark Core Board
March 26, 2015 - The MOSFET should be connected as a high-side or low-side switch depending on the circuit design, with the low-side configuration often preferred for easier gate drive at 3.3V. A flyback (Schottky) diode across the solenoid terminals is essential ...
🌐
ESP32 Forum
https://esp32.com › viewtopic.php
ESP32 powering a solenoid - ESP32 Forum
June 2, 2020 - That is to much for a GPIO pin. You could use a darlington transistor like the TIP120 but you would be better off using a MOSFET device which behave much more like an ideal switch. The main characteristic you need in such a device is that it is turned hard on with 3.3V applied to its gate.
🌐
Reddit
https://reddit.com › r/arduino › can someone suggest a 3.3v solenoid that can be powered from arduino?
r/arduino on Reddit: Can someone suggest a 3.3V solenoid that can be powered from Arduino?
March 28, 2016 -

I'm looking for a solenoid that I can control from an Arduino pro mini 3.3V. The solenoid would be used as a means to open a springloaded hinged box. I'd want that solenoid to pull in for a short time freeing the lid to open. I'm thinking the 'movable pin' part should be about an inch or two long and have at least 0.5 inch travel. Can this be powered by one of the io pins or will I need to use a relay to provide power? I know nothing about solenoids and their power consumption so perhaps what I'm planning is a bad idea.

Find elsewhere
🌐
Martyn Currey
https://martyncurrey.com › controlling-a-solenoid-valve-from-an-arduino-updated
Controlling a Solenoid Valve from an Arduino. Updated. – Martyn Currey
April 5, 2019 - In the example below the TIP120 can be thought of as a switch and applying a current to the Base pin allows current to flow between the Collector pin and the Emitter pin. ... The IRL44N mosfet is a logic level N-channel mosfet which means it can be controlled from a logic level voltage of 5V. ...
🌐
All About Circuits
https://forum.allaboutcircuits.com › home › forums › hardware design › general electronics chat
Driving a solenoid | All About Circuits
October 28, 2024 - So really, the need for the capacitor depends quite a bit on the performance requirements. And so far the actual performance requirements are unknown to us. Click to expand... The solenoid is controlled by a MOSFET logic driven by a 3.3v MCU.
🌐
Hackaday
https://hackaday.io › project › 156847-simple-pcb-to-control-a-33v-solenoid
Simple PCB to control a 3.3V Solenoid | Hackaday.io
This small PCB was designed to route the 3.3V power line of a microcontroller (this can typically supply ~500mA) to the solenoid, dependent on the triggering of a digital pin.
🌐
Arduino Forum
https://forum.arduino.cc › projects › general guidance
Pulsing 12v solenoid valve with 3.3v output - General Guidance - Arduino Forum
April 6, 2022 - Hi all, I need some guidance please. I am quite new to this. I am doing a small irrigation project with a latching solenoid valve. Using a 3.3v Arduino Pro Mini. Power supply will be a 12V battery. The solenoid only need a pulse +-200ms to latch over to the other side, so I am trying to find ...
🌐
Arduino Forum
https://forum.arduino.cc › other hardware › general electronics
What happens if I supply 3.3v to a 5v rated solenoid? - General Electronics - Arduino Forum
October 15, 2018 - Sorry if this is a dumb question guys, but this is my first time with any Arduino/electrical work. But I have a mkr gsm 1400 and I was wondering if there's any cons to supplying my 5v solenoid with 3.3v instead since there's no digital 5v pin outs on my board.
Top answer
1 of 4
3

You sure could. Make sure the 12V supply is able to accept current flowing into it, as well as providing current flowing out.

But it's more efficient to use an "H-bridge" circuit to reverse both ends.
To move in one direction, you put one end at 0V and the other end at 24V.
To move in the other direction, you put one end at 24V and the other end at 0V.

The half-H-bridge is just a pair of switches, one to 24V and one to 0V, so that the output can be either 24V or 0V depending on which one you turn on. Turning on both at the same time creates a short circuit, so don't do that. The H-bridge is just two halves, one for each end of the solenoid.

Of course, the solenoid has to be mechanically designed to work in both directions, too. There's no point moving a solenoid both ways, if one way causes it to bump into an end stop and not move.

The solenoid must use a permanent magnet in the moving piece, because iron that isn't magnetized will be attracted to either a north or south field equally well - reversing the current will reverse the magnetic field but that won't achieve anything.

2 of 4
0

Could you use an opamp to raise and lower S2 to control the flow of current through the solenoid?

Thats fine, there are a few problems. One is overvoltage from the solenoid actuating. If it simply to turn the solenoid on and off, then an opamp would be an expensive way to do this.

You can use hit and hold if circuits if you need different current/voltage levels: How do I use a hit and hold circuit with a solenoid?

🌐
Stack Exchange
https://electronics.stackexchange.com › questions › 539828 › switch-12v-solenoid-from-3v3-control-signal
mosfet - Switch 12v solenoid from 3v3 control signal - Electrical Engineering Stack Exchange
I am going in circles on the web and appreciate your help with this novice question, operate a solenoid with a mosfet (original idea, I know). I bought a Gravity DFR0457 to switch a 12V solenoid on from a camera remote (Pocketwizard) that outputs 3v3. I can't get it to work (apparently common with logic level needing more voltage), so i am guessing i have to bump up the output remote 3v3 somehow?.
🌐
ATO
https://ato.com › transmission & actuator › solenoid valves › mini solenoid valves
3V Mini Solenoid Valve, 2 Way | ATO.com
3V Mini Solenoid Valve, 2 Way - High quality and reasonable price mini solenoid valve for sale online. The rated voltage of mini electric solenoid valve is 3V. 2 way solenoid valve is widely used in analytical instrument, medical device and machinery manufacturing.
Price: $49.37
🌐
Electronic Design
https://electronicdesign.com › markets › automation › article › 21806574 › whats-the-best-way-to-drive-a-solenoid
What’s the Best Way to Drive a Solenoid? | Electronic Design
The delay time (where the solenoid is driven at 100% duty cycle) is set by the values of R1 and C1. For a standard 3.3-V logic level, the time is approximately 0.33 × RC.
🌐
Arduino Forum
https://forum.arduino.cc › other hardware › general electronics
3 wire solenoid - General Electronics - Arduino Forum
July 12, 2012 - hello, I have a 3-wire solenoid (for irrigating - 9Vdc Solenoid). it has 1 ground cable and 2 on/off cables. so one of them turns the solenoid on and the other turns in off. I've been searching the web and all I can find is a 2 way solenoid sketch. (which works great, but not suitable for me) ...