Go Down

Topic: Replace relay with mosfet? (Read 2235 times) previous topic - next topic

steve_1988

Jun 22, 2020, 09:45 am Last Edit: Jun 22, 2020, 10:56 am by steve_1988
Hello,

This is my first post here.  :)

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.  :)

Steve


Update:

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

JCA34F

#1
Jun 22, 2020, 10:54 am Last Edit: Jun 22, 2020, 11:02 am by JCA34F
Check schematic # 3 here:
https://www.gammon.com.au/motors
What kind of load is the relay switching now?

steve_1988

Hello!

Thanks for the link!

It's a water pump motor.

can I use this for my circuit?


slipstick

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

steve_1988

#4
Jun 22, 2020, 01:53 pm Last Edit: Jun 22, 2020, 02:27 pm by steve_1988
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?

Code: [Select]


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);
  }
}

runaway_pancake

You missed a digitalRead( ) in there.
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

TomGeorge

#6
Jun 22, 2020, 07:28 pm Last Edit: Jun 22, 2020, 07:29 pm by 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... :)
Everything runs on smoke, let the smoke out, it stops running....

steve_1988

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... :)
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???  :)




Thanks

Steve

TomGeorge

#8
Jun 23, 2020, 10:05 am Last Edit: Jun 23, 2020, 10:06 am by TomGeorge
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.. :)
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

#9
Jun 23, 2020, 10:11 am Last Edit: Jun 23, 2020, 10:12 am by TomGeorge
Hi,
This would be better, back EMF diode

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

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

JCA34F

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

MarkT

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...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Paul__B

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.

MarkT

And without the diode across the pump it may burn out anyway from voltage spikes... Schematic in #9 does things right.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

steve_1988

Hello folks!

Apologies! Been busy with work last few weeks!

Can you post a picture of your project so we can see your component layout?
Yea sure! I will post the picture later today!

Where did the 10k in the BJT emitter come from? Which MOSFET are you using?
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.


Go Up