Switching 12V load with N-channel mosfet working with 5V - Page 1
Forum section: electronics / beginners

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 12:07:37 am
content: Hi All,I'd like to use an n-channel MOSFET to switch a 12V load (1Amp max likely half) for less than 1 minute and drive it with 5V. Found this one on DigiKey but it's no longer being sold and the substitute parts can be driven by less than 5V:https://www.digikey.com/en/products/detail/onsemi/fqd30n06ltf/1054801Can someone please recommend an alternative that can serve my purpose and work with 5V?Thanks!

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 06, 2024, 12:33:14 am
content: This fet is much better: 65V, 50A, 11 mOhms @ 4.5Vgs (11mV drop per amp).https://www.digikey.com/en/products/detail/good-ark-semiconductor/GSFD0650/18648458With a N-ch and 5V you can only switch the low side, that means the load will be floating at 12V all the time, this is not really a problem in most scenarios.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 12:48:38 am
content: Quote from: DavidAlfa on April 06, 2024, 12:33:14 amShould I use a P-channel MOSFET instead then?

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 06, 2024, 01:00:01 am
content: Not really.What are you switching and how? Locally or remotely (Through wires)?Within an enclosed device, this should be just fine.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 01:09:10 am
content: Quote from: DavidAlfa on April 06, 2024, 01:00:01 amIt is actually "remotely" switching using wires (an electromagnet, something like this one:https://www.amazon.com/uxcell-Electric-Lifting-Electromagnet-Solenoid/dp/B01N3387AA/ref=sr_1_9?crid=38C5BN3BHYLZB&dib=eyJ2IjoiMSJ9.f_1m2j908WNJug0xQLavrWbVQozS6yyePulRerFe0Q8fcBP09vv9ZqkSypcD5AQlbOXkjuBYfnlQl5c2D9-r9aHWaZy5Rm1muCOtEPvsmt3m757Y7_0yBPDH5fIx4MbhMVjAfyngoJFy7gZgW-Y34Ksq4bO_GZHs1G9-mOEAda6xbKIe1QoZRnjbx38EM23QuA2Z3vVYfOVjujW-GoUeKoUTtjel6rwq9a6tj3nm5E0.nYO2mfWkEGAjmEy3c36UCCBD6XyjK8OCwsfYJtU-mqs&dib_tag=se&keywords=12v+electromagnet&qid=1712365712&sprefix=12v+electromagne%2Caps%2C199&sr=8-9)

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 06, 2024, 01:27:46 am
content: Then a p-ch might be better here.The good thing is the p-ch gate will see -12V when pulled to ground, so you don't need any specific fet having low GVS.R1/3/4 can be 100K, not need for so low value except for fast PWM.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 01:31:33 am
content: Thank you very much!

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 06, 2024, 01:40:02 am
content: You don't need a large fet (Except for just in case, something changes in the future), there're pretty powerful fets in small packages, 5A in sot23:https://www.digikey.com/en/products/detail/goford-semiconductor/G05P06L/16394401But if you can afford the space and a little extra cost, it's never a bad idea to make it tough, 60A:https://www.digikey.com/en/products/detail/good-ark-semiconductor/SSFD6025B/21724697

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 02:05:59 am
content: Btw, is Q1 required? I thought I could get away with just the MOSFET without additional transistors.

author: MarkF
author_rank: Super Contributor
timestamp: April 06, 2024, 02:07:35 am
content: And you don't need R3 to pull down the NPN base.It's a NPN. You need current to turn it ON.Even if QA is floating, Q1 will not turn ON.It's just adding an extra load to the MCU pin.Besides, the LED will provide a pull down load without R3.Also, R1 seems a bit large. You want R1 to limit the currentfrom the MCU pin and still provide enough gain through Q1 toturn on the MOSFET (Q2). Actually, you might want to put theLED and R2 from Vin and Q2 collector (i.e. in parallel with R4).Start with R1 = 1K.

author: MarkF
author_rank: Super Contributor
timestamp: April 06, 2024, 02:13:07 am
content: Q1 is required because your MCU pin will not be able to go to 12V.Additionally depending on the MOSFET, you may need another resistorbetween the R4 and Q1 collector (providing a voltage divider) tolimit Vgs of the MOSFET.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 02:28:20 am
content: Quote from: MarkF on April 06, 2024, 02:13:07 amThank you! However, how is this guy pulling this off with just the MOSFET, or is this bad practice?(at min 2:20)I'm using a PIC16F887 btw.

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 06, 2024, 03:24:36 am
content: Quote from: newtekuser on April 06, 2024, 02:28:20 amHe's getting away with it by using a second isolated power supply for the Arduino. It won't work with just a single 12V supply.Use DavidAlfa's circuit instead. That way, you don't need a 2ndisolatedpower supply.

author: Psi
author_rank: Super Contributor
timestamp: April 06, 2024, 03:36:30 am
content: If only switching 1A max, either use a Nfet in ground feed or a Pfet in power feed.The complexity of Nfet in power feed is only justifiable if you cant use a Pfet for some reason, like you need high current / low Rds on.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 03:42:22 pm
content: Quote from: MarkF on April 06, 2024, 02:13:07 amI was confused by this until I've done more reading and learned about higher voltage thresholds required for p-channel.Btw, would this work in place of the 2N3904 NPN? MMBT3904-7-F (https://www.mouser.com/ProductDetail/621-MMBT3904-F)

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 06, 2024, 04:04:47 pm
content: Quote from: newtekuser on April 06, 2024, 03:42:22 pmIt will... Just be aware that the MMBT3904-7-F is the SOT23 surface mount version. A NPN transistor in a TO-92 package may be a better pick depending on your soldering skills, size requirements, etc.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 04:15:54 pm
content: Quote from: Kim Christensen on April 06, 2024, 04:04:47 pmGreat!I do know how painful SOT23s are to hot air solder. Fortunately this time I'll be using my pnp machine (YY1) for the board assembly as the rest of components are SMDs.

author: xvr
author_rank: Frequent Contributor
timestamp: April 06, 2024, 04:28:21 pm
content: Alternatively you can use Smart Switch (https://www.digikey.ie/en/products/detail/onsemi/NCV84090DR2G/16528514). It's a little bit expensive, but just 1 IC (+decoupling capacitor) for allIf you don't like SMD package, you can take more powerful Smart Switch in TO-220

author: MarkF
author_rank: Super Contributor
timestamp: April 06, 2024, 04:41:02 pm
content: Quote from: newtekuser on April 06, 2024, 03:42:22 pmI'm not sure what you mean by "higher voltage thresholds required for p-channel". My comment was that you need to check the maximum Vgs limit is. For the two p-channel MOSFET mentioned above, Vgs = (-/+20V) it is not a concern since your Vin = 12V. (For example: If Vin=24V, you could not pull the gate down the gnd because it would exceed Vgs).You mentioned Vgs threshold. Which is the gate voltage required to turn on the MOSFET. Your looking at the minimum voltage. I'm talking about the maximum voltage.As far as the MMBT3904-7-F, it should be fine. In this circuit, pretty much any jellybean NPN will work.Let me restate that the LED in @DavidAlfa's circuit will never turn ON. The voltage across the NPN base/emitter is one diode drop which is not high enough to turn on the LED. You could put the LED before R1 or on the NPN collector as I mentioned.Overall, I think you're looking at something like this:

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 06, 2024, 04:46:15 pm
content: Quote from: MarkF on April 06, 2024, 04:41:02 pmThanks, still learning!Btw, is there a reason for having the LED other than visual cue, or is it for adding additional load?

author: MarkF
author_rank: Super Contributor
timestamp: April 06, 2024, 04:52:15 pm
content: I think it was put in just for a power indicator.It's not needed for the circuit to switch on the load.

author: MarkF
author_rank: Super Contributor
timestamp: April 06, 2024, 05:04:29 pm
content: Quote from: xvr on April 06, 2024, 04:28:21 pmFor that matter, you could just use one of those Arduino Relay modules.5v Relay Module 5V Indicator Light LED 1 Channel Relay Module for Arduino ARM PIC AVR MCU

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 06, 2024, 07:36:53 pm
content: Quote from: newtekuser on April 06, 2024, 04:15:54 pmNo offence, but I'm having a hard time squaring the fact that you have a$4000 pnp machine, yet are having difficulty with a relatively simple circuit. Does someone else normally design the circuits and PCBs for you?

author: newtekuser
author_rank: Frequent Contributor
timestamp: May 27, 2024, 05:22:22 pm
content: Quote from: MarkF on April 06, 2024, 04:41:02 pmI tried to replicate the suggested circuit, but the PMOS transistor Q2 in my diagram is causing a short (current draw is 2A - once I remove it the short is gone). Did I mess up the connections between components? I can't tell.These are the transistors in use:NPN:https://www.mouser.com/ProductDetail/621-MMBT3904-FPMOS:https://www.mouser.com/ProductDetail/78-SI2347DS-T1-GE3

author: xvr
author_rank: Frequent Contributor
timestamp: May 27, 2024, 05:29:27 pm
content: Pinout of your PMOS is different from pinout in KiCAD (and PCB). Source and Drain swapped.NPN also have different pinout (C and E swapped)

author: newtekuser
author_rank: Frequent Contributor
timestamp: May 27, 2024, 06:19:18 pm
content: Quote from: xvr on May 27, 2024, 05:29:27 pmThank you for pointing this out! The footprints and symbols I used don't match the pinouts from the datasheets.(my fault for mixing and matching symbols from KiCad with 3rd party footprints)