Solenoid driver design help - Page 1
Forum section: electronics / projects

author: ajo518
author_rank: Contributor
timestamp: May 15, 2025, 09:30:39 pm
content: HelloI am looking to design a driver to drive solenoids and relays (total of about 30 for this controller). I have a 3.3v microcontroller as the controller. The solenoid is 24v and requires 40ma. I was thinking of using a n channel fet to drive the solenoid with appropriate flyback, a PTC to limmit fault current, gate and bias resistor.What I am running into is that most fets Vds th max seems to be about 2.5v. I am not sure that leaves enought room to drive the fet hard enough. Is there a good rule of thumb here?I also know that the Vgs needs to be higher than the 24v due to the aditive effect of the back emf from the solenoid when it is turned off, but not sure how much headroom is required here. Double the drive voltage is something that I have found. Seems like most of the fets with low Vth have lower Vds of around 30. If I clamp it with a zener from the drain to source. Is that fast enough to protect the fet or do I need something with a higher Vdsmax? Not sure there is something with a low enough Vth and a high enough Vds to fit this application.I know I could also do a 2 stage driver using one fet or bjt to switch the other fet gate to 24v which would give me a lot higher Vth for the load, but at the cost of complexity. Is that the route I should be looking?Any help is greatly appreciated!

author: ajb
author_rank: Super Contributor
timestamp: May 15, 2025, 10:02:04 pm
content: Quote from: ajo518 on May 15, 2025, 09:30:39 pmThat sounds fine, but note that fuses are generally for protecting external wiring, not semiconductors! A hard short into the FET will destroy it much more quickly than the fuse can respond. If you want to protect the output FETs you will need to actively limit the supply current to a level the FET can withstand, use a protected switch instead of a standard FET (there are some that can be used as a drop-in replacement for a standard FET), or add fast overcurrent protection yourself.QuoteYou'll need to look at the datasheet to see what the Rds or Vds/Id vs Vgs characteristics are. You only need 40mA, so it should be possible to find FETs that will work with a max Vgs of 3.3V. Alternatively, you could tap into the 24V supply to provide a higher gate drive voltage -- going up to 5V will give you even more FET options, and is easily handled by a lot of level translation ICs designed for logic without going to higher voltage or dedicated gate driver parts.QuoteThis depends on the flyback suppression method you choose. A simple reverse-biased diode will limit Vds to one diode drop above the supply voltage, so not a big deal at all. Using a zener/TVS or RC snubber can allow for a faster deactivation of the solenoid/coil (higher clamping voltage -> higher power dissipation -> energy stored in the magnetic field is drawn down faster), but results in a higher Vds that depends on the values of the components chosen.QuoteLevel shifting the gate is doable as noted above, but note that the Absolute Maximum Vgs for many FETs is only 20V, with typical gate drive voltages for high power applications being ~12V. This is not a high power application, so even that would be excessive here.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 15, 2025, 11:22:25 pm
content: Quote from: ajo518 on May 15, 2025, 09:30:39 pmLow Vth FETS do exist, you just need to filter to get ones that specify RDS at 2v5 drive.Examples I findPMPB50XN 110 V, N-channel Trench MOSFET V(BR)DSS drain-source breakdown voltage > 110 VGS = 2.5 V < 80 mΩDMT12H060LFDF 115V N-CHANNEL < 130 mΩ VGS = 1.5VOr you might get away with a 60V BSS138 family part, you could select for lowestMAX RDS, tho most vendors give similar typicals, the MAX vary more.eg the lcsc ElecSuper LBSS138LT1G-ES specs a 2.5VgsMAX 4.5Ωwith typ = 2.73ΩOr since you need 30 of these, the Nexperia NX138BKS 60 V, dual N-channel SOT363 specs VGS = 2.5 V; ID = 75 mA; Tj = 25 °C typ 2.6Ω Max 5 ΩOr the quite new Nexperia NX5020UNBKS, dual N-channel 50V SOT363 and specsRDSonVGS = 2.5 V; ID = 230 mA; Tj = 25 °C typ 1.6Ω max 3 ΩVGS = 1.8 V; ID = 50 mA; Tj = 25 °C typ 2Ω max 4 ΩVGS = 1.5 V; ID = 10 mA; Tj = 25 °C typ 2.5Ω max 6 Ω

author: tooki
author_rank: Super Contributor
timestamp: May 16, 2025, 10:58:39 am
content: Quote from: ajo518 on May 15, 2025, 09:30:39 pmI recently made a bunch of little solenoid driver boards using a simple MOSFET “peak and hold” circuit that uses full voltage to energize the solenoid, then drops to a reduced holding current. I originally designed it around the DMNH4005S from Diodes, Inc, and then assembled some of them with that, others with a slightly better one from TI whose part number I don’t remember off the top of my head. Both work completely reliably with 3.3V logic from a microcontroller. The DMNH4005S also comes in TO-220, which is handy for tinkering before you have a PCB made. It’s a 40V part so you’d need to clamp reverse EMF appropriately. (I like to use a regular diode in series with a zener, so the voltage is clamped a bit higher than 0.7V, so the solenoid can close quickly.)I’m off today, but I can get you the schematic and part numbers on Monday when I’m back at work.

author: ajo518
author_rank: Contributor
timestamp: May 16, 2025, 04:37:36 pm
content: Quote from: tooki on May 16, 2025, 10:58:39 amI would appreciate that. I will have to play with that some.Quote from: PCB.Wiz on May 15, 2025, 11:22:25 pmI will try that serch again and see if I can get to a better list. Thanks for the suggestions!Thanks

author: langwadt
author_rank: Super Contributor
timestamp: May 16, 2025, 05:12:20 pm
content: ULN2003 et.al.

author: David Hess
author_rank: Super Contributor
timestamp: May 16, 2025, 05:27:02 pm
content: Quote from: ajo518 on May 15, 2025, 09:30:39 pmThere is no such requirement. MOSFETs would not be nearly as useful if they could not switch a drain voltage higher than their maximum gate voltage.Usually the gate is driven from a low enough impedance to prevent charge through the gate-to-drain capacitance from increasing the gate voltage. A zener or TVS diode across the gate will protect it if this is not the case.MOSFETs sometimes have dV/dT limits on their drain which would require a snubber across their drain, however modern MOSFETs are very good about this so it can usually be ignored.If the drain voltage is too high from flyback, then the MOSFET drain will breakdown in avalanche, however this may or may not be acceptable. Some MOSFETs include avalanche ratings.

author: ajo518
author_rank: Contributor
timestamp: May 17, 2025, 06:06:07 pm
content: Quote from: David Hess on May 16, 2025, 05:27:02 pmOOPS that should have been Vds...

author: David Hess
author_rank: Super Contributor
timestamp: May 17, 2025, 10:27:25 pm
content: Quote from: ajo518 on May 17, 2025, 06:06:07 pmOk, so we are back to:I also know that the Vds needs to be higher than the 24v due to the aditive effect of the back emf from the solenoid when it is turned off, but not sure how much headroom is required here. Double the drive voltage is something that I have found. Seems like most of the fets with low Vth have lower Vds of around 30. If I clamp it with a zener from the drain to source. Is that fast enough to protect the fet or do I need something with a higher Vdsmax? Not sure there is something with a low enough Vth and a high enough Vds to fit this application.Power MOSFETs are pretty tough, so the danger is not really from the flyback pulse, but I might use a 50 volt MOSFET to switch 24 volts leaving plenty of margin for a 36 volt TVS diode. There are not really any wrong answers here. A zener diode, or really a TVS diode, will be plenty fast.At higher voltages it is difficult to have 50% voltage derating while being economical, but that is not a problem with a 24 volt supply and 50 volt power MOSFET.When I designed a 12 volt solid state relay for automotive applications, I used 60 volt power MOSFETs because that is the worst case fault voltage in automotive applications.

author: ajo518
author_rank: Contributor
timestamp: May 19, 2025, 11:18:06 pm
content: Thanks everyone. Looks like I will have to drive these from some form of IO expander. Which lead me to the Max149XX series of industrial high side switches. Anyone used those?https://www.analog.com/en/products/max14912.htmlSeems like it would greatly reduce my parts count since I have to do an IO expander anyway.My application is not very cost sensitive, but is time sensetive, so seems like getting a prebuild module might be a good fit.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 20, 2025, 03:50:35 am
content: Quote from: ajo518 on May 15, 2025, 09:30:39 pmYou can get serial parts that can drive directly.eg TLC6C598-Q1 & TLC6C5912-Q1 are SPI parts, with 40V 50mA rated outputs, or BD8378FV- is 35V / 50mAThere are also parts like TPIC6B595 etc, with 50V / 150mA outputs, that may need levels shifters on CLK DI

author: tooki
author_rank: Super Contributor
timestamp: May 20, 2025, 05:46:26 pm
content: Quote from: ajo518 on May 16, 2025, 04:37:36 pmOK, so the other MOSFET I used, which works perfectly with the ESP32's 3.3V logic is the TI CSD18513Q5AT. Like the DMNH4005S, it's a 40V part. But I vaguely recall that the CSD18513Q5AT had higher-voltage siblings in the series. (Edit: the CSD18531Q5A is 60V and otherwise basically identical.)The schematic is attached below. Here's how it works:1. When idle, the capacitor C1 charges to the full DC supply voltage through R1.2. When CONTROL_IN is driven high, the MOSFET turns on, allowing the solenoid to quickly energize by using the energy stored in C1.3. While holding, the solenoid is kept at the current limited by R1 and the solenoid's internal DC resistance. C1 stays at the voltage drop across the solenoid.4. When CONTROL_IN goes low again, the solenoid's energy discharges through D1 and D2.(Return to 1.)To use the example of one model of solenoid valve (normally-closed) I used a bunch of these with, the solenoid is rated 24V/100mA. This gives it a DC resistance of 240 ohms. (And power dissipation of 2.4W at full voltage.)In experimental testing, I found the valve would reliably open at 17V/75mA or above. It would close at 6V/30mA or below. I decided to use a holding current of 50mA.This means:R1 = (Vsupply/Ihold) - Rdc(solenoid)=> R1 = (24V/50mA) - 240Ω = 240Ω(Yes, when doing a holding current of exactly half, just use a resistor with the same DC resistance as the solenoid.)The total power dissipated while holding is, of course:Phold(total)= Vsupply* Iholdof which:Phold(solenoid)= (Ihold)2* Rdc(solenoid)andPhold(R1)= (Ihold)2* R1=> Phold(solenoid)= (50mA)2* 240Ω = 600mW=> Phold(R1)= (50mA)2* 240Ω = 600mW <-- select the resistor accordingly!and=> Phold(total)= 24V * 50mA = 1.2WSo we've cut the total power dissipation in half, but also divided it between the solenoid and R1.Determine the size of C1 experimentally. Too small a cap won't work reliably, or may be too slow. It also depends on the cap's ESR. For C1, I used a combination of several tantalums in parallel with a polymer electrolytic. For that solenoid, I used 4x47μF tantalums and a 680μF polymer electrolytic, to ensure enough force to overcome the stickiness of the valve flap after sitting for a while. It's entire application-specific.Obviously, for significantly larger loads, you'd want a more complex driver that doesn't burn up half the power in a resistor (e.g. by using a separate power rail for the holding voltage, or by using PWM to reduce the holding current). But for small solenoids and relays, this is a simple circuit that is better than nothing, and doesn't require any microcontroller control.

author: Seekonk
author_rank: Super Contributor
timestamp: May 21, 2025, 01:06:36 pm
content: LM1949 Don't know if they still make it, I used one 30 years ago. Somehow, I still remember that number.

author: ajo518
author_rank: Contributor
timestamp: July 22, 2025, 08:33:20 pm
content: Thanks for all the help. I ended up going with a max14916 partly because it had the IO expander built in so that reduced my part count and complexity.https://www.analog.com/en/products/max14916.html

author: langwadt
author_rank: Super Contributor
timestamp: July 22, 2025, 09:36:33 pm
content: Quote from: ajo518 on July 22, 2025, 08:33:20 pma 1A driver for a 40mA relay, talk about overkill