Replace relay with mosfet?

Hello,

This is my first post here. :slight_smile:

I would like to ask, is it possible to keep everything but just replace the relay with a P-channel Mosfet?

Attached (Relay.jpg) is my current schematic. The relay will disconnect the 12V wire to cut the power.

Thanks. :slight_smile:

Steve

Update:

I have attached another schematic (Mosfet.jpg). Is this correct?

Check schematic # 3 here:
https://www.gammon.com.au/motors
What kind of load is the relay switching now?

Hello!

Thanks for the link!

It's a water pump motor.

can I use this for my circuit?

That should be o.k. but if it's just a 12V DC pump most of us would use low-side switching with just a single N-channel logic level MOSFET (the first schematic on that Nick Gammon page).

Steve

Hello!

Okay. I have tested the P-channel Mosfet. But the water pump motor still keep running.

I did change the output from LOW TO HIGH, or HIGH to LOW. Any idea?

void setup()
{
  Serial.begin(9600);
  pinMode(Button, INPUT_PULLUP); //// button switch
  pinMode(5, OUTPUT); //// Cut off power using  P-channel mosfet
  digitalWrite(5, HIGH); 
}

void loop()
{
if (Button == LOW) {
    digitalWrite(5, LOW);
  } else {
    digitalWrite(5, HIGH);
  }
}

You missed a digitalRead( ) in there.

Hi,
Does the Arduino controller share the same gnd as the 12V supply for the pump?

If they can't you may have to use an opto-coupler as well.

Tom... :slight_smile:

TomGeorge:
Hi,
Does the Arduino controller share the same gnd as the 12V supply for the pump?

If they can’t you may have to use an opto-coupler as well.

Tom… :slight_smile:

Hello Tom!

I’m using battery to power my arduino and I only use the mosfet to cut the 12v wire…

Bad news:

I have already fried 2 Mosfets… :’(

This is the schematic that fried my mosfet… any idea?

Good news:

I got an opto-coupler now… haha…Will give it a try. But before that, can let me know if this is correct?? and where should i ground the opto-coupler? +12v ground? or can share the same ground as arduino??? :slight_smile:

Thanks

Steve

Hi,
Can you post a picture of your project so we can see your component layout?
This is a better schematic, pointing out the connection required between gnd of Arduino and motor supply.


Not knowing enough about the motor circuit you may not be able to do this.

Tom.. :slight_smile:

Hi,
This would be better, back EMF diode


A schematic is clearer and more informative if you show the full circuit.

Tom... :slight_smile:

Where did the 10k in the BJT emitter come from? Which MOSFET are you using?

If you want to reduce the chance of frying your MOSFETs add a zener between gate and source.

Over voltage on the gate will always instantly destroy MOSFETs, you have to ensure this never
happens, either when handling the device, or in circuit, and a 12V zener is a great way to do this.
You still need a resistor between gate and source to turn the device off.

If the grounds were not commoned that would explain why you were destroying the MOSFETs - one circuit
attached to the gate, the other to the source, its a tug of war...

steve_1988:
This is the schematic that fried my mosfet.... any idea?

Because the 10k resistor mistakenly put there prevented the FET from actually turning on fully.

If not turned on fully, it will dissipate more power than the motor and of course burn out.

And without the diode across the pump it may burn out anyway from voltage spikes... Schematic in #9 does things right.

Hello folks!

Apologies! Been busy with work last few weeks!

TomGeorge:
Can you post a picture of your project so we can see your component layout?

Yea sure! I will post the picture later today!

JCA34F:
Where did the 10k in the BJT emitter come from? Which MOSFET are you using?

Paul__B:
Because the 10k resistor mistakenly put there prevented the FET from actually turning on fully.

If not turned on fully, it will dissipate more power than the motor and of course burn out.

Opps. Just realized that I put the 10k at the wrong place in the picture. It's a pull down resistor for Base. This is the MOSFET that I'm using.

This is the latest schematic and am going to try this tonight.

I’m wondering whether the emitter should connect to Arduino ground??

Mini buck converter that im using

Thanks

Steve

Hi,
You will need to connect the gnds of both batteries together with the Nano gnd.

Tom... :slight_smile:

TomGeorge:
Hi,
You will need to connect the gnds of both batteries together with the Nano gnd.

Tom... :slight_smile:

Thanks Tom! :slight_smile:

After more research, I think my previous schematic has a problem... For P-channel Mosfet, it should always pull-up right? If yes, do i still need to have the pull-down at transistor base? will it cause "floating" issue??

Hi,
You don't need the 10K at the base of the BJT, is low impedance and won't float like a MOSFET gate will.
You can leave it in, 10K will not be a problem.
The 10K between the gate and source of the P-CH MOSFET is essential.

With P-CH MOSFET the gate has to go NEGATIVE with respect to the Source to make it conduct, that is what the transistor does to the MOSFET gate.

Do you have to switch the positive of the motor, that is High Side switch?
It would be easier and lower component count if you switched the gnd side, or LOW SIDE switch with N-CH MOSFET.

Haven't you tried the circuit yet?

Tom... :slight_smile:

TomGeorge:
Hi,
You don't need the 10K at the base of the BJT, is low impedance and won't float like a MOSFET gate will.
You can leave it in, 10K will not be a problem.
The 10K between the gate and source of the P-CH MOSFET is essential.

With P-CH MOSFET the gate has to go NEGATIVE with respect to the Source to make it conduct, that is what the transistor does to the MOSFET gate.

Do you have to switch the positive of the motor, that is High Side switch?
It would be easier and lower component count if you switched the gnd side, or LOW SIDE switch with N-CH MOSFET.

Haven't you tried the circuit yet?

Tom... :slight_smile:

Hi Tom

Ah...Ok understand. I haven't test the new circuit. Just want to make sure the new circuit is safe before I test as I only left 1 or 2 P-channel mosfet... :stuck_out_tongue: