# How to using LM393 to turned off the P MOSFET.

#### barg

Joined Dec 23, 2015
93
Hello Everyone,

I am using a pchannel mosfet to control an output voltage as the attached. I am trying to understand how to turn off the gate by giving it higher voltage than the source?

the mosfet source voltage is 27v (output of a prior boost circuit from a 12v battery), the gate is constant =12v to be constant on.

So to turn it off, the only idea I thought of is to give the gate the same source voltage of 27v via the lm393 but the issue is that the comparator "eats" appx 1.5v so it might not defently work always (27v-1.5v=25.5v) as the fet gate threshold is from -1.2v (25.5v-27v=-1.5v = will turn it on again).

The mosfet used is IPP80P04P4L-08 and max vgs=+-16v.

Thanks,

Barg

#### Attachments

• 5.5 KB Views: 72

Joined Feb 20, 2016
4,251
Remove the 12V connection and hook it to the 27V.
The gate needs to sit at 27V for it to be off, and about maybe 15V for it to be on. I'm not sure what you are doing with the OpAmp. Are you trying to make a regulator?
The LM393 is an open collector device I think, without checking the data. So when it is off, the full 27V should be on the gate, pulled up via R1 now to 27V. When on, it will be about 20V lower then the source, turning the FET well on.

Last edited:

#### ScottWang

Joined Aug 23, 2012
7,305
The P MOSFET will be turn on when the power is on, if you input a 12V on the +12VTurnOff pin then the P MOSFET will be turn Off.

#### dl324

Joined Mar 30, 2015
15,423
the gate is constant =12v to be constant on.

So to turn it off, the only idea I thought of is to give the gate the same source voltage of 27v
Instead of connecting 12V to the gate, you should let the control circuit determine the voltage applied to the gate.

Perhaps if you explained what you're trying to accomplish we could offer suggestions.

It would be helpful if you used proper capitalization so members don't get distracted by numerous "typos". MOSFET is an acronym and shouldn't be written as "mosfet". Volts should use a capital V. MOSFET polarity is designated with a capital letter (P or N) not p or n; because it refers to P or N type silicon material.

#### wayneh

Joined Sep 9, 2010
17,189
1. Eliminate the 12V source.
2. Route R1 to +27V
3. Eliminate R2
4. Eliminate D1? (Unless you have a good reason for it)
5. The values of R3 and R4 won't work - they need to divide the voltage down to well below 5V.

#### crutschow

Joined Mar 14, 2008
31,097
The LM393 is a comparator, not an opamp, and the polarity is such that it will latch with the its output low and the voltage output at 27V.
But even if you reverse the polarity of the comparator, and do the changes dendad suggested, it will oscillate since there is no loop compensation.

If you want to regulate the output voltage you need to use an opamp instead of a comparator and add some compensation, (such as a capacitor in series with a small resistor from the MOSFET gate to drain), to stabilize the circuit.

Last edited:

#### wayneh

Joined Sep 9, 2010
17,189
If you want to regulate the output voltage you need to use an opamp instead of a comparator and add some compensation...
Oops, I ignored the overall function of the circuit and my reply was only about using the comparator to switch the MOSFET. You're right: The circuit as-is will not function as a voltage regulator.

#### ian field

Joined Oct 27, 2012
6,536
Hello Everyone,

I am using a pchannel mosfet to control an output voltage as the attached. I am trying to understand how to turn off the gate by giving it higher voltage than the source?

the mosfet source voltage is 27v (output of a prior boost circuit from a 12v battery), the gate is constant =12v to be constant on.

So to turn it off, the only idea I thought of is to give the gate the same source voltage of 27v via the lm393 but the issue is that the comparator "eats" appx 1.5v so it might not defently work always (27v-1.5v=25.5v) as the fet gate threshold is from -1.2v (25.5v-27v=-1.5v = will turn it on again).

The mosfet used is IPP80P04P4L-08 and max vgs=+-16v.

Thanks,

Barg
Your circuit is somewhere in the right general direction - you only have to pull the gate down to turn the P-channel MOSFET on.

AFAICR: the 393 is open collector, so you need a gate/source bleed resistor to turn the MOSFET off when the 393 lets go.

You might want to check the breakdown voltage on that open collector - 27V sounds a bit high.

#### barg

Joined Dec 23, 2015
93
Hi,

I Didn't understand the suggestion to Rout R1 to 27v instead of to the 12v to constant On? I made another gate tests just to verify your suggestions and:

1. When R1 routed or the gate connected with or without R1(=10k) to the 27v, it turns the MOSFET Off (as I mentioned earlier from the data sheet of the MOSFET Th to be -1.2 to -2.2).

2. When R1 routed to 12v or the gate receives 12v without R1, the MOSFET is constant on/ power on. So I don't understand why you suggested that 27v will turn it On?

3. Please advice why you suggested to eliminate R2? As I thought the gate should be protected with R2 for over current?

4. Hi Ian, I Added R5, is that what you suggested? I prefer to use LM393 But, I also have LM258, are they both can do the same job in this purpose? Actually, the comp/opamp should keep the MOSFET On all the time unless it gets less than 5v(inverting) for low voltage battery protection so it will output High to turn the MOSFET off in this specific case.

5. As for the diode used, this circuit also feeds a motor (max consumed current appx 4A+-), the diode I use is 1N4148, please advice if it is wrong how this Diode is placed? or need to change it to other diode?

6. As to Oscillation, after detailing as above, is that needed also? can you please specify values and locations?

Regards,

Barg

#### Attachments

• 5.9 KB Views: 26

Joined Feb 20, 2016
4,251
I think there is confusion with your circuit. It is part switch part regulator and not working as either.
If you have the gate tied to 12V via R1 the FET will be on all the time.
Remove R5. Hook R1 to 27V.
To be able to turn it on and off, R1 needs to be hooked to 27V. Then when the LM393 output is "off" that is, high, the FET will be off as the gate is pulled to the same voltage (27V) as the source.
Turning the LM393 output transistor on, its output pin will go 0V, so the FET gate will pull to about 9V, so there will be a gate to source voltage of about 16V, turning the FET on.
All this ignores what you have hooked onto the LM393 inputs.
I think you really need to tell us clearly what you are trying to do. Why are you using a comparator?
What is this circuit for? And what are you controlling it with, and trying to switch?
Is it to be on all the time unless the battery is below 5V?

Maybe something like this?

This is just rough as I'm pretty tired now. But no doubt others will pick up any errors.

Last edited:

#### Alec_t

Joined Sep 17, 2013
13,223
If the FET is ON, Vout will be shorted to 27V. Why are you expecting it to drop?
What is the nominal voltage of the battery you are trying to protect?
Where does the battery connect to your circuit?

#### barg

Joined Dec 23, 2015
93
Hi Alec,

It did had a few shorts when I tried to connect the source to the gate so I don't understands how it can be solved to get the definite ON and OFF voltage values with this circuit. I think the key is understanding how the P-Channel works (with the gate thresholds) as I don't well familiar with that.

The nominal protected voltage is 20v, bellow 20v, the MOSFET should stop conducting. the end battery I am using is a 24v Acid. Basically, its two circuits, one is a boost from 12v to 27 that part works ok. the second is the one with the P-channel MOSFET and the opamp (changed to lm258). you can see the locations as in the revised schematic. please check and advice how it should be connected or to move/eliminate any part?

Thanks,

Barg

#### Attachments

• 6.5 KB Views: 14

#### wayneh

Joined Sep 9, 2010
17,189
1. When R1 routed or the gate connected with or without R1(=10k) to the 27v, it turns the MOSFET Off ...
Correct. You need a way to turn it off, right? If not, replace the MOSFET with a piece of wire.
2. When R1 routed to 12v or the gate receives 12v without R1, the MOSFET is constant on/ power on. So I don't understand why you suggested that 27v will turn it On?
Are you referring to the schematic in #3?
3. Please advice why you suggested to eliminate R2? As I thought the gate should be protected with R2 for over current?
R1, if connected to +27V, would already limit current that the LM393 needs to sink as it pulls its output low. You don't need to protect the LM393 from the small charge that must be drained off the gate capacitance of the MOSFET, unless you want this to operate at very high frequencies. I'd guess any frequency less than 100kHz would not require special considerations for this.
4. Hi Ian, I Added R5, is that what you suggested? I prefer to use LM393 But, I also have LM258, are they both can do the same job in this purpose? Actually, the comp/opamp should keep the MOSFET On all the time unless it gets less than 5v(inverting) for low voltage battery protection so it will output High to turn the MOSFET off in this specific case.
Ah, so now we learn you are building a low-voltage cutoff. The comparator is a better choice for this than the opamp. However you need some hysteresis on the comparator so that it goes off at, say, 4.5V and won't turn back on until it sees 4.7V. i.e. it has 0.2V of hysteresis. This will prevent the comparator from chattering and oscillating if the 5V signal is slow moving and/or noisy as it passes the set point.
5. As for the diode used, this circuit also feeds a motor (max consumed current appx 4A+-), the diode I use is 1N4148, please advice if it is wrong how this Diode is placed? or need to change it to other diode?
It needs to be in reverse bias around the poles of the motor, to absorb the inductive spike when the motor's coil is switched off.

#### barg

Joined Dec 23, 2015
93
Hi Wayneh,

1. Yes, the MOSFET turns on when the gate is receiving 12v. and I need to find the way / the voltage that turns it OFF.

2. Yes, I am referring to Schematic#3. I left it connected to 12v as I didn't know if to leave it there as it worked until now through the 10k R1.

3. I am no longer using the lm393, I switched to lm258 because the lm393 outputted 1.5v instead of 27+- on my tests so I need to double check that. as to Hysteresis chattering, I agree with your assumption of +-0.2v, can you please specify your recommended R / C values to use and where to locate them?

4. Yes, that's the D1 1N4148 Purpose. Question is if 1N4148 is enough or needed a bigger value and if the location is correct?

Thanks,

Barg

Last edited:

#### crutschow

Joined Mar 14, 2008
31,097
Which voltage do you want to monitor to turn off the MOSFET?
It would see that you would want to monitor the input 27V, not Vout.
Otherwise the MOSFET will never turn on.

It's still unclear exactly what you want the circuit to do.

#### barg

Joined Dec 23, 2015
93
I would like to monitor the output voltage as you can see where is the voltage divider prior the battery.

which details are missing?

#### crutschow

Joined Mar 14, 2008
31,097
So Vout goes to a battery?
That wasn't clear to me.

Okay, in the schematic in post #12:
• Remove R5
• Change R2 to 10kΩ
• Connect R1 to +27V instead of 12V.
• Use a LM339/393 comparator instead of the op amp
• Connect a 1kΩ resistor between the + input and the +5V
• Connect a 270kΩ resistor between the + input and the comparator output to add ≈100mV of hysteresis at the 5V input (400mV at the battery).

Joined Feb 20, 2016
4,251
barg.
I really do not understand why you persist in having that connection to 12V. A number of us have told you over and over again to remove it and connect to 27V.
I will not work if you do not do that.
To turn the FET off, the gate has to go to 27V. With the connection to 12V, the gate has a permanent on signal as it is -ve with respect to the source.
GET RID OF THE 12V CONNECTION!!!!!!

#### barg

Joined Dec 23, 2015
93

I also made a few tests, it seems that the comparator works, I am not sure how it works with the load because each time I connected load 5A to the end (instead of the battery) it passed and when the "-" pin reached bellow 5v the MOSFET got hot and burned a few times... can you advice?

Thanks,

Barg

#### Attachments

• 6.7 KB Views: 15