# Finding Proper resistor values and MOSFET type for switch circuit

#### LostMechEMajor

Joined Aug 4, 2023
7
Hello guys, I am an electronics beginner working on a project where I have a laser module that is powered by a 4.5 V power source and that consumes about 150 millamps of current.

I need to be able to use a GPIO pin on my rasberry pi (which outputs at 3.3V logic level) to switch the laser on and off. I plan to accomplish this with a circuit similar to the two I have attached. I would like to make sure that the switching is occurring on the low side, as I have heard that this is safer for the GPIO pins.

What I'm not sure about is: 1) what MOSFET type to use, and 2) what resistance(s) to use

For the MOSFET type, I had a couple I was looking at, including the FQP30N60L , the IRLB8721PBF, the IRLZ44, and the IPP030N06NF2SAKMA1.
The first three mentioned do not seem to have a high enough gate threshold voltage maximum from what I saw on the data sheet, as most cap out at around 2.5V or lower. The IPP030N06NF2SAKMA1 however appears to tolerate a max of 3.3V. Am I reading these values right?

Secondly, if I take the approach as shown in the image with the darker background where we have two resistors, how would I go about determining the proper values for these resistors? How do we factor in the 4.5V power source, the ~150 milliamps of current, and the MOSFET used? I'm not sure what formulas to use.

Thanks!

#### Attachments

• 485.2 KB Views: 13
• 94.4 KB Views: 13

#### Lightium

Joined Jun 6, 2012
118

#### LowQCab

Joined Nov 6, 2012
3,584
One option, don't use a FET at all.

If You need to Modulate the Laser at very high Frequencies,
then I would recommend that You use a "FET Gate-Driver" Chip.
Most of them have a fixed Input-Threshold-Voltage of around ~2.5-Volts
with very high-Impedance, and a small amount of Input hysteresis to reduce any Input-Noise issues.
The higher-capacity versions can switch a continuous ~9-Amp-Load, at extremely high-Frequencies.

Since You state that your Current is only ~150mA the attached Gate-Driver below will do the job nicely,
.
.
.

#### Attachments

• 366.5 KB Views: 6

#### Audioguru again

Joined Oct 21, 2019
6,447
The Vgs threshold voltage for most Mosfets is the gate-source voltage that it begins conducting 250uA which is a very low current (It is barely turning on). The IRLZ44 has a threshold voltage of 1V to 2V so it is sensitive. It is fully turned on and can conduct 25A with a Vgs of 4V if you cool it properly.
The IRLZ44 Mosfet is N-channel then the gate must be at logic level for it to turn on.

You do not want an IPP..... Mosfet since with Vgs of 3.3V it conducts only 80uA which is almost nothing and is fully turned on with a VGS of 10V.

#### LostMechEMajor

Joined Aug 4, 2023
7
V=IR that really got us somewhere!

#### LostMechEMajor

Joined Aug 4, 2023
7
One option, don't use a FET at all.

If You need to Modulate the Laser at very high Frequencies,
then I would recommend that You use a "FET Gate-Driver" Chip.
Most of them have a fixed Input-Threshold-Voltage of around ~2.5-Volts
with very high-Impedance, and a small amount of Input hysteresis to reduce any Input-Noise issues.
The higher-capacity versions can switch a continuous ~9-Amp-Load, at extremely high-Frequencies.

Since You state that your Current is only ~150mA the attached Gate-Driver below will do the job nicely,
.
.
.
Hey, thanks for you answer! This certainly seems like a promising solution. So would I then be able to essentially use this component in the same way as the one in the circuit diagrams I gave, but just leave out the resistors? Also in the datasheet you gave, Vdd would be my 3.3V rpi GPIO output right? I'm a bit confused about this because the datasheet says that the max input voltage is VDD – 0.3, which would then be 3.0 volts, which is far less than the 4.5V I was planning on using. How would this work?

#### LostMechEMajor

Joined Aug 4, 2023
7
The Vgs threshold voltage for most Mosfets is the gate-source voltage that it begins conducting 250uA which is a very low current (It is barely turning on). The IRLZ44 has a threshold voltage of 1V to 2V so it is sensitive. It is fully turned on and can conduct 25A with a Vgs of 4V if you cool it properly.
The IRLZ44 Mosfet is N-channel then the gate must be at logic level for it to turn on.

You do not want an IPP..... Mosfet since with Vgs of 3.3V it conducts only 80uA which is almost nothing and is fully turned on with a VGS of 10V.
Cool, this helps out a lot with finding the right Mosfet! Any advice on the resistor values?

#### sghioto

Joined Dec 31, 2017
5,102
I would suggest the IRLZ44 as well. Use a 10K resistor for R.

#### LowQCab

Joined Nov 6, 2012
3,584
Hey, thanks for you answer! This certainly seems like a promising solution. So would I then be able to essentially use this component in the same way as the one in the circuit diagrams I gave, but just leave out the resistors? Also in the datasheet you gave, Vdd would be my 3.3V rpi GPIO output right? I'm a bit confused about this because the datasheet says that the max input voltage is VDD – 0.3, which would then be 3.0 volts, which is far less than the 4.5V I was planning on using. How would this work?
.
I'm sorry but I don't understand your questions.
The Power-Supply range for the FET-Driver suggested is from 4.5V to 18V.
The Input-Switching-Threshold is ~2.5-Volts, with 0.3V of hysteresis.
If You don't have a nominal ~5-Volts+ available, then this FET-Driver-plan will not work for You.

If your project is Battery-Powered ............
I would suggest a proper Current-Regulator-Circuit for
your Laser to insure consistent Output-Power as the Battery discharges.
.
.
.

Last edited:

#### LostMechEMajor

Joined Aug 4, 2023
7
I would suggest the IRLZ44 as well. Use a 10K resistor for R.
ok nice, and to confirm, that 10k res is in series inbetween the 3.3v and the transistor?

#### sghioto

Joined Dec 31, 2017
5,102
ok nice, and to confirm, that 10k res is in series inbetween the 3.3v and the transistor?
No! From gate to ground like this using the IRLZ44 mosfet.

#### LostMechEMajor

Joined Aug 4, 2023
7

#### Ian0

Joined Aug 7, 2020
8,947
Don't be tempted to use a MOSFET which is much too large for the job. You are only switching 150mA and a IRLZ44 is capable of 50A. A MOSFET that can switch 1A would do the job!
If you do, the GPIO won't be able to source enough current to charge up the MOSFET capacitance quickly enough and the switching will be slow.
You are much more likely to find low-Vgs-threshold MOSFETs in the lower current ranges.

#### Jerry-Hat-Trick

Joined Aug 31, 2022
450
If I had a dollar for every time I came across someone struggling to turn a MOSFET on and off, I'd be up there in the rich list with Elon Musk.

What's wrong with an NPN transistor? Pick any one of hundreds which can handle 200mA with a gain of 100 or more. You will only lose maybe up to 0.3V between collector and ground. Your 3.3V output would need to provide a minimum of 1mA. A resistor between the output and transistor base of 1K should turn the transistor hard on.

#### Ian0

Joined Aug 7, 2020
8,947
. . . Or 78 pence (at today's exchange rate) for every time someone doesn't realise that rather more base current is needed to saturate a transistor than would be expected simply by dividing the collector current by Hfe.
Most switching transistors specify a base current of Ic/10 for switching. That would be 20mA for a 200mA load, which is more than most processor GPIO pins can source.

#### Lightium

Joined Jun 6, 2012
118
V=IR that really got us somewhere!
Smiling faces don't make up for exclamations and dumb comments.

#### BobTPH

Joined Jun 5, 2013
8,111
How often do you need to switch the laser on and off? This is critical to how you do it. The comments about a gate driver ONLY apply if you are switching it more than about 10000 times per second. Anything slower than that and the circuit in post #11 is fine.

#### Audioguru again

Joined Oct 21, 2019
6,447
If I had a dollar for every time I came across someone struggling to turn a MOSFET on and off, I'd be up there in the rich list with Elon Musk.

What's wrong with an NPN transistor? Pick any one of hundreds which can handle 200mA with a gain of 100 or more. You will only lose maybe up to 0.3V between collector and ground. Your 3.3V output would need to provide a minimum of 1mA. A resistor between the output and transistor base of 1K should turn the transistor hard on.
A transistor with an hFE of 150 will have a 5V to 10V collector to emitter voltage if its collector current is 150mA and its base current is only 1mA. ALL little transistors datasheets show a forced hFE of 10 for proper saturation. Then the 15mA base current is too high since the piezo sounder uses a very low current.

#### sghioto

Joined Dec 31, 2017
5,102