IRF9540N P-channel mosfet not working

Hi I am going to use this circuit for my GPS tracker auto power off after 24 hours to save my battery.
So I plan to use 9540N P channel mosfet to cut off the power.

Connection
Gate pin pull up 10K and connected BC817 optocoupler, BC817 collector pin connect with mosfet gate pin and emmiter pin connect with gnd.
Source pin connect with 12v. And drain pin connect with load positive line and another load pin connect with gnd.

But I didn't get any voltage for my load. When I measure between drain and gnd pin I get only 0.33 volts.(When I on the optocoupler)

I tried with 470 ohm resistor between collector and gate pin. But no improvement.

I noticed accidentally I touched the mosfet top metal part suddenly the voltage got increased to 9 volts. Why. Is getting gnd from my body and connection established ?

Please post a hand drawn schematic. Pencil and paper is fine.

1 Like

Please post a schematic; wordy descriptions are virtually always incomplete and imprecise.

BC817 is not an optocoupler. So you mean an optocoupler connected to the base of the BC817? I'm starting to make stuff up now to fill in the gaps...

Errr...yes, sort of. Let's go with 'yes'.

Sorry PC817 Optocoupler.

Here is the circuit.

Assuming something capable of driving the optocoupler is providing the input...
...also assuming the optocoupler connections are actually correct...

...a heck, maybe just upload a phot of the built circuit? Wouldn't be the first time something was hidden in plain sight.

If you measure the voltage at the gate of the MOSFET with no input to the optocoupler, and then with 3.3V applied to it, what do you get?

No, that doesn't do anything but raise the gate voltage a little, which is precisely what you don't want anyway.

Gate voltage? Here for p channel how can I increase ? Gnd is gnd only. Gate pin I pull up using 10K.

Without 470 ohm also not working.

Yes. The voltage you measure between the MOSFET gate and GND. Measure that in to see what the optocoupler is doing (if anything). So measure it first with no signal applied to the input of the optocoupler, then apply 3.3V to the optocoupler input and measure the gate voltage again. What values do you get?

Alternatively, start by trying to light a LED using your optocoupler. Once you've figured that out, replace the LED with the MOSFET circuit.
image

I tried first my optocoupler working fine or not using with LED. It is working.

Then I tried mosfet alone without optocoupler. I am using manual test with MOSFET. Applying Gnd manually. But still no voltage drain and gnd

I frustrated. I disconnected and thrown away. I will set up the actual circuit and send you the photo.
Note I tried with new mosfets. But same result.

Which Arduino?

Pro mini 3.3v. As I said I debugging the mosfet circuit. So I am using manual test before Arduino connections.

Have you tried replacing the opto with a simple npn or small signal MOSFET? There's no sign that your circuit requires galvanic isolation.

Yes. I tried directly trigger (shorting to gnd) the gate pin pulled up 10k to 12v, the gate pin without optocoupler. But still same, no improvement.

Please upload a photo of the actual setup you're testing with that clearly shows all connections.

Also, what was connected as a load on the switched 12V output (so after the mosfet) in the test you mentioned above?

If you are using a solderless breadboard, you may have an intermittent or bad connection and touching the MOSFET made the connection stable.

Also if you bought the MOSFETS from aliexpress, alibaba or amazon, you may just have received a bad batch of MOSFETs

Ok. I directly bought it from local store

It seems like you did every test you could and it still did not work. I would suspect a bad MOSFET

Did you connect the MOSFET gate to the 12V ground?

1 Like