Arduino Forum

Using Arduino => General Electronics => Topic started by: steve_1988 on Jun 22, 2020, 09:45 am

Title: Replace relay with mosfet?
Post by: steve_1988 on Jun 22, 2020, 09:45 am
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?
Title: Re: Replace relay with mosfet?
Post by: JCA34F on Jun 22, 2020, 10:54 am
Check schematic # 3 here:
https://www.gammon.com.au/motors (https://www.gammon.com.au/motors)
What kind of load is the relay switching now?
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jun 22, 2020, 11:22 am
Hello!

Thanks for the link!

It's a water pump motor.

can I use this for my circuit?

(https://www.gammon.com.au/images/Arduino/MOSFET_high_side_driver.png)
Title: Re: Replace relay with mosfet?
Post by: slipstick on Jun 22, 2020, 11:46 am
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
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jun 22, 2020, 01:53 pm
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);
  }
}
Title: Re: Replace relay with mosfet?
Post by: runaway_pancake on Jun 22, 2020, 04:24 pm
You missed a digitalRead( ) in there.
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jun 22, 2020, 07:28 pm
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... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jun 23, 2020, 06:29 am
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?

(https://i.ibb.co/X3MJ95h/old.jpg)



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

(https://i.ibb.co/bLqMRQk/mosfet-using-pc817.jpg)


Thanks

Steve
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jun 23, 2020, 10:05 am
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.
(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=369864)
Not knowing enough about the motor circuit you may not be able to do this.

Tom.. :)
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jun 23, 2020, 10:11 am
Hi,
This would be better, back EMF diode
(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=369866)
A schematic is clearer and more informative if you show the full circuit.

Tom... :)
Title: Re: Replace relay with mosfet?
Post by: JCA34F on Jun 23, 2020, 11:04 am
Where did the 10k in the BJT emitter come from? Which MOSFET are you using?
Title: Re: Replace relay with mosfet?
Post by: MarkT on Jun 23, 2020, 12:00 pm
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...
Title: Re: Replace relay with mosfet?
Post by: Paul__B on Jun 24, 2020, 10:29 am
This is the schematic that fried my mosfet.... any idea?
(https://i.ibb.co/X3MJ95h/old.jpg)
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.
Title: Re: Replace relay with mosfet?
Post by: MarkT on Jun 24, 2020, 03:11 pm
And without the diode across the pump it may burn out anyway from voltage spikes... Schematic in #9 does things right.
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 07, 2020, 06:42 am
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 (https://datasheet.lcsc.com/szlcsc/HUAYI-HY19P03D_C330375.pdf) that I'm using.

Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 07, 2020, 08:35 am
This is the latest schematic and am going to try this tonight.

(https://i.ibb.co/yQ5dzk9/Nano-Highside.png)

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


***Mini buck converter (https://www.amazon.com/DC-DC-Buck-Converter-Adjustable-Module/dp/B075Q63FPB) that im using***


Thanks

Steve

Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 07, 2020, 02:32 pm
Hi,
You will need to connect the gnds of both batteries together with the Nano gnd.
(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=372026)

Tom... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 08, 2020, 03:47 am
Hi,
You will need to connect the gnds of both batteries together with the Nano gnd.
(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=372026)

Tom... :)
Thanks Tom!  :)

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??


(https://i.ibb.co/YT56wLJ/Nano-Highside-1.png)

Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 08, 2020, 07:05 am
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... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 08, 2020, 08:00 am
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... :)
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... :P




Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 08, 2020, 08:07 am
Hi,
What is your 12V power supply?

Tom... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 08, 2020, 08:07 pm
Hi,
What is your 12V power supply?

Tom... :)
Hi!

I will be using a 9v battery to power the Nano, and a 12v battery for mosfet (to turn on/off the LED) to test the circuit below :)

(https://i.ibb.co/YT56wLJ/Nano-Highside-1.png)

I can still connect both 9v and 12v batteries ground together with nano ground right?


Thanks!

Steve
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 09, 2020, 12:37 am
I can still connect both 9v and 12v batteries ground together with nano ground right?
Yes..
Tom... :)
Title: Re: Replace relay with mosfet?
Post by: larryd on Jul 09, 2020, 01:05 am
What is the 1N4142 diode in your schematic ?




Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 09, 2020, 03:59 am
Yes..
Tom... :)
Thanks Tom! Will share the result later :)

What is the 1N4142 diode in your schematic ?
Hi Larryd!

It's a 12v zener diode to limit the Vgs voltage.  :)
Title: Re: Replace relay with mosfet?
Post by: larryd on Jul 09, 2020, 04:11 am
That circuit as is is going to destroy your BJT.

Change the 10k to ~8.6k

Add a ~1k between the BJT collector and the MOSFET gate.





Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 09, 2020, 04:41 am
That circuit as is is going to destroy your BJT.

Change the 10k to ~8.6k

Add a ~1k between the BJT collector and the MOSFET gate.

Hi Larryd!

Do you mean change the pull-up resistor from 10k to 8.6k? if yes, Can I use 1k or 4.7k instead?

I have edited the schematic. :)


(https://i.ibb.co/s6d26LW/Nano-Highside-2.png)


Title: Re: Replace relay with mosfet?
Post by: larryd on Jul 09, 2020, 05:27 am
(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=372294)








Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 09, 2020, 06:09 am
(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=372294)
Hi Larryd!

Thanks for the schematic! May I know why we need to add a capacitor at the load??




Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 09, 2020, 09:59 am
Hi Larryd!

Thanks for the schematic! May I know why we need to add a capacitor at the load??
The motor has brushes and a commutator in it, when the motor runs they cause electrical noise.
The capacitor prevents the commutator noise from getting out into the rest of the circuit.
Usually 0.1uF cap is enough to do the job.
Tom... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 09, 2020, 10:28 am
The motor has brushes and a commutator in it, when the motor runs they cause electrical noise.
The capacitor prevents the commutator noise from getting out into the rest of the circuit.
Usually 0.1uF cap is enough to do the job.
Tom... :)
Hi Tom!

Thanks for the explanation!  :)

Well, I have tested the circuit below on the breadboard. But the LED doesn't light up at all. Any idea??

(https://i.ibb.co/2kVTyzg/Nano-Highside-test-circuit.png)


Here is the sketch:

Code: [Select]

void setup() {
    Serial.begin(9600);
  pinMode(2, INPUT_PULLUP); //Jumper Wire
  pinMode(5, OUTPUT); // Mosfet pin
  digitalWrite(5, LOW);
}

void loop() {

int Jumper = digitalRead(2);
  
 if (Jumper == LOW) {
    digitalWrite(5, HIGH);
  } else {
    digitalWrite(5, LOW);
  }
}



Edit :

Ok. I think I have found the problem. The LED will ONLY light up without the pull-up resistor between the Gate and Source pin. Even lower the pull-up resistor to 220 ohm, it still doesn't light up.

Why....?


Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 09, 2020, 12:23 pm
Hi,
R1 is tool low, try 10K.

Do you have a DMM?

Tom... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 09, 2020, 12:59 pm
Hi,
R1 is tool low, try 10K.

Do you have a DMM?

Tom... :)
Hi Tom!

OK. Have tried 10k, still the same.

Yes! The Red probe to Mosfet Source, Black probe to Drain get 11.17V (with 10k ohm).

When I use probe to "touch" both Source and Drain pin, the LED lights up.

To add on:
I didn't connect the Mosfet gate to the BJT when measure the above voltage.
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 09, 2020, 02:34 pm
Hi,
You should leave the gate connected.
Measure the gate voltage of the MOSFET, with respect to gnd,  when the output D5 is HIGH and when it is LOW.
Measure the drain voltage of the MOSFET, with respect to gnd,  when the output D5 is HIGH and when it is LOW.
Measure the collector voltage of the BJT, with respect to gnd,  when the output D5 is HIGH and when it is LOW.

Thanks.. Tom... :)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 09, 2020, 04:00 pm
Hi,
You should leave the gate connected.
Measure the gate voltage of the MOSFET, with respect to gnd,  when the output D5 is HIGH and when it is LOW.
Measure the drain voltage of the MOSFET, with respect to gnd,  when the output D5 is HIGH and when it is LOW.
Measure the collector voltage of the BJT, with respect to gnd,  when the output D5 is HIGH and when it is LOW.

Thanks.. Tom... :)
Hello Tom!

Wow! It's working now :D

I shouldn't disconnect the Gate wire in the previous test (facepalm)

Here are the numbers:

When D2 is LOW and D5 is HIGH, LED lights up.

--------------

Gate

Low
12.71V

High
1.30V


--------------

Drain

Low
0.00 / 0.01

High
12.84V

--------------

BJT (collector)

Low
12.71V

High
0.16V

--------------

Are these numbers looks "Healthy"??

Title: Re: Replace relay with mosfet?
Post by: larryd on Jul 09, 2020, 04:06 pm
Looking good.



Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 10, 2020, 03:30 pm
Hello again!

Here's an update for today. 

Tested the circuit today with the gasoline water pump.

Good news. I didnt fry my mosfet! YAY!!

Bad news:

Unfortunately, the circuit not working :(

Then I measured the voltage, and this is the result:

Collector
Low: -0.25
High: 0.01


Drain
Low: 0.01
High: 0.01


Gate
Low: -0.29
High: -0.06


I placed the mosfet between the cdi and plug coil.

Cdi signal wire to Mosfet source > Drain to plug coil.

I didnt add any Capacitor and Flyback diode to the plug coil / connect the plug coil ground to arduino as it will make the plug coil stop working, no spark.

The reason why i placed the mosfet there is because when the water in the tank has reach it highest level then  the arduino will stop the water pump cdi from sending signal to plug coil. Hence it will stop pumping water into the tank.

Any idea???
Title: Re: Replace relay with mosfet?
Post by: larryd on Jul 10, 2020, 04:14 pm
Show us a good image of your 'actual' wiring.   
Posting images:  https://forum.arduino.cc/index.php?topic=519037.0 (https://forum.arduino.cc/index.php?topic=519037.0)
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 10, 2020, 06:30 pm
Removed old schematic.
Title: Re: Replace relay with mosfet?
Post by: larryd on Jul 10, 2020, 09:55 pm
Show us a good image of your 'actual' wiring.   


What are the part numbers for the BJT and MOSFET ?

Assume CDI is +12vdc, do you have the negative connected to the Arduino GND ?

BTW, what is the coil resistance ?

You did place a kickback diode across the coil ?








Title: Re: Replace relay with mosfet?
Post by: detown on Jul 11, 2020, 04:44 pm
Is this a cdi on a single cylinder gas engine? If so the voltage going to the coil is somewhere in the 300 to400 volt range.
If the OP would give a little more detail on the engine that the pump uses I might be able to help.
Just a little hint. If the engine has a kill button or switch, why not just tap into that circuit to kill the engine?
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 11, 2020, 05:02 pm
Show us a good image of your 'actual' wiring.  



What are the part numbers for the BJT and MOSFET ?

Assume CDI is +12vdc, do you have the negative connected to the Arduino GND ?

BTW, what is the coil resistance ?

You did place a kickback diode across the coil ?
Hi Larryd!

Apologies! Forgot to include the part number. :P

(https://i.ibb.co/HBR0pPt/latest.png)

HERE (https://datasheet.lcsc.com/szlcsc/HUAYI-HY19P03D_C330375.pdf) the mosfet datasheet.


Yes. It's a +12 cdi. and yes. I have connect the negative of the ignition coil to Arduino ground.

The coil resistance: 0.16 ohm

I couldn't place a diode across the coil as the coil will not make any spark to fire the gasoline water pump.

***********************

Forgot to mention in the previous reply:

I can start the water pump, but unable to stop it when D2 is LOW.

Code: [Select]

void setup() {
    Serial.begin(9600);
  pinMode(2, INPUT_PULLUP); // Push button switch will be replace with a water level sensor
  pinMode(5, OUTPUT); // Mosfet pin
  digitalWrite(5, HIGH);
}

void loop() {

int ButtonSwitch = digitalRead(2);
  
 if (ButtonSwitch == LOW) {
    digitalWrite(5, LOW);
  } else {
    digitalWrite(5, HIGH);
  }
}



*********************************

Measure when pump running:

Collector:
Low: -0.27
High: 0.01

Gate:
Low: -0.32
High: -0.06

Drain:
Low: 0.01
High: 0.01

Power on, Pump not running:

Collector:
Low: -0.40
High: 0.01

Gate:
Low: -0.40
High: -0.03

Drain:
Low: 0.01
High: 0.01
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 11, 2020, 05:09 pm
Is this a cdi on a single cylinder gas engine? If so the voltage going to the coil is somewhere in the 300 to400 volt range.
If the OP would give a little more detail on the engine that the pump uses I might be able to help.
Just a little hint. If the engine has a kill button or switch, why not just tap into that circuit to kill the engine?
Hi Detown!

Thanks for the reply!

Quote
Is this a cdi on a single cylinder gas engine?
Yes!

Quote
Is this a cdi on a single cylinder gas engine?
I believe the 300++ volt is the output voltage from secondary side not Primary side, right?

Quote
Just a little hint. If the engine has a kill button or switch, why not just tap into that circuit to kill the engine?
I will be using the water level sensor to kill the water pump. Let's say when the tank is full, it will stop pumping water into the tank. :)
Title: Re: Replace relay with mosfet?
Post by: detown on Jul 11, 2020, 06:17 pm
Do a little research on cdi ignitions. As I said the primary can be in the 300 to 400 volt range. The secondary would be in the KV range.
If you could supply a link to the pump or at least the engine that it uses I might be able to give a little more informed answer.
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 11, 2020, 07:01 pm
Hi Detown!

300v! I didn't know that  :smiley-eek-blue:

I googled. But can't find the pump. I only know it was a china product, and quite old model.

But it looks something like this

(https://shop.waterax.com/media/catalog/product/cache/2/image/9df78eab33525d08d6e5fb8d27136e95/1/0/100112_1.jpg)


Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 11, 2020, 07:20 pm
Hello again!

I found a P-channel mosfet schematic from google, also from this forum (https://forum.arduino.cc/index.php?topic=422227.150) at #154.

This is exactly what i wanted :D

But the only different is the OP was using TC4432, a mosfet driver?
Title: mosfet?
Post by: Paul__B on Jul 12, 2020, 01:38 am
Interesting blunder in those diagrams.

The intrinsic diode in the FET is not a "flyback" diode - unless it is a Zener, which it is not.  :smiley-roll:
Title: Re: Replace relay with mosfet?
Post by: detown on Jul 12, 2020, 02:34 am
So, did you get it to work?
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 12, 2020, 04:09 am
So, did you get it to work?
Hi!

I hope to stick with the BJT circuit first. :)

Interesting blunder in those diagrams.

The intrinsic diode in the FET is not a "flyback" diode - unless it is a Zener, which it is not.  :smiley-roll:
Haha. Sorry im not very familiar with mosfet. But im trying to learn how to use mosfet now :)
Title: Re: Replace relay with mosfet?
Post by: Paul__B on Jul 12, 2020, 05:42 am
Haha. Sorry I'm not very familiar with mosfet. But I'm trying to learn how to use mosfet now :)
You will need to.  MOSFETs have largely taken over from bipolar transistors.  All current logic ICs are based on them.  :smiley-eek:
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 12, 2020, 02:24 pm
Hi all!

I have bought the Microchip's Mosfet driver (http://ww1.microchip.com/downloads/en/DeviceDoc/21424d.pdf), and tested it on breadboard.

Sometimes the LED can turn off completely, sometimes it doesn't. However, If put a finger on the "Drain", then it will turn off completely. May I know Why and how to solve this? :) 

(https://i.ibb.co/t3H9Z4Y/mosfet-driver.jpg)

**************

Mosfet Gate:

LOW: 0V
HIGH: 12.50V


**************

Mosfet driver:

Pin 2 (input)

LOW: 0V
HIGH: 4.90V


Pin 6

LOW: 0V
HIGH: 12.50v


Pin 7

LOW: 0V
HIGH: 12.50V


Thanks!


Steve
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 12, 2020, 06:43 pm
Hi,

HEY, HEY, HEY WHEN DID THE LOAD BECOME A CDI AND NOT A MOTOR?
Totally different ballpark, high voltages, AC ringing, lots of electrical noise.
Go back to using a relay, and a simple MOSFET to drive it.
Keep Nano well away from it.

In your test circuit.
How about connecting the neg/gnd of the 9V source to the Nano gnd.
At the moment the MOSFET gate has no reference to the Nano circuit.\

Tom... :)
Title: Re: Replace relay with mosfet?
Post by: detown on Jul 13, 2020, 02:58 am
Here's a little hint.
That pump uses a Honda GX series engine.
This is the wiring diagram.

(https://forum.arduino.cc/index.php?action=dlattach;topic=691736.0;attach=372880)
If this doesn't help, let me know and I will give you the answer.
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 13, 2020, 12:21 pm
Hi,
So the oil level switch shorts the supply to the ignition, to gnd?

The ignition system on GX series is  "Transistorised MAGNETO"

There is a lot more than just supply in the blue, blue/red wire to the ignition unit, put a relay in and jobs done.
Or put a NC set of contacts across the oil switch and get the Arduino to hold them open.

Its been a long thread, what are you trying to achieve by using an Arduino to stop the motor?

We need a picture of the motor and or ignition unit. :)
Does your motor have a KILL switch?

Thanks.. Tom... :)
Title: Re: Replace relay with mosfet?
Post by: detown on Jul 13, 2020, 04:26 pm
If the OP would have stated something like,"I have a pump with a single cylinder gas engine that I would like to shut off when the water level reaches a certain level" would have given them an answer in a couple of posts.
If people would do a little research before tackling a project it would save a lot of grief.
I found all the information on this with about 5 minutes of Googling.
You don't even need an Arduino for this, a simple float switch that grounds the kill wire would suffice.
But we need to see if the OP returns, or if this is just another hit and run.
Just a side note, the blue, blue/red wire  that comes from the ignition unit is not a supply.
You can disconnect that wire from the coil and the engine will still run.
It is just a wire that you ground to kill the engine. I don't know what the voltage is on that wire, but I have accidentally touched one and they will give you a pretty healthy tingle
Title: Re: Replace relay with mosfet?
Post by: steve_1988 on Jul 13, 2020, 04:54 pm
Hello both!

opps! Maybe I should describe clearly in the first post :P

Sorry for the confusion guys!

I know this can be done easily by using relay, but I wish to take this chance to learn how to use Mosfet to cut the ignition and water level sensor as well. :)


anyway, I have tested Mosfet driver circuit on water pump today, and........(drum roll please...)

Nano - fried
Mosfet - fried
Mosfet driver - fried 

:smiley-yell:


1) The BJT circuit wont fry anything, but just unable to turn off the water pump, pump keeps running)

2) The Mosfet circuit start the pump and fry everything within 10 sec...Power on, everything were okay, until I start the pump..... I don't even have a chance to measure the Low High voltage.....

So from BJT circuit, seems like the Mosfet  (https://datasheet.lcsc.com/szlcsc/HUAYI-HY19P03D_C330375.pdf) can handle the voltage coming from the cdi to ignition coil.


I though the Mosfet driver will be more reliable??


Thanks both!
Title: Re: Replace relay with mosfet?
Post by: TomGeorge on Jul 13, 2020, 05:20 pm
I know this can be done easily by using relay, but I wish to take this chance to learn how to use Mosfet to cut the ignition and water level sensor as well. :)

anyway, I have tested Mosfet driver circuit on water pump today, and........(drum roll please...)

Nano - fried
Mosfet - fried
Mosfet driver - fried  

1) The BJT circuit wont fry anything, but just unable to turn off the water pump, pump keeps running)

2) The Mosfet circuit start the pump and fry everything within 10 sec...Power on, everything were okay, until I start the pump..... I don't even have a chance to measure the Low High voltage.....

So from BJT circuit, seems like the Mosfet  (https://datasheet.lcsc.com/szlcsc/HUAYI-HY19P03D_C330375.pdf)can handle the voltage coming from the cdi to ignition coil.

I though the Mosfet driver will be more reliable??

Thanks both!
What do you mean by the MOSFET STARTING the pump.
Do you want the Arduino to START and STOP the PUMP?
Does the pump have electric start?

How does the pump motor NORMALLY get turned OFF, what do you do to stop it?

AND a water sensor.

PLEASE start and tell us what you have.
Then tell us what you want to do with it.
Not what you have done but what your aims are.

Thanks.. Tom... :)
Title: Re: Replace relay with mosfet?
Post by: detown on Jul 13, 2020, 08:32 pm
If you would let us know what kind of engine you have on the pump we might be able to help.
You keep saying the voltage coming from the cdi to the coil. Most small engines have an electronic magneto. The coil and all the electronics are in one sealed unit.
If you would concentrate on what it takes to turn the engine off and forget about the mosfet for now, you will be miles ahead.
If you can't figure out what the engine is, post a picture and I can probably tell you what you have.