Having trouble with MOSFET

This is my first project. I'm trying to make a remote start for my portable generator. On the generator, I have found the two wires that control the electric starting, and they measure 12V across them. When I connect them with my ammeter, 2.4 amps flows and the generator starts. According to the generator's schematic, these wires control a relay and not the actual starter motor.

So with this in mind, I tried to use a IRF520 MOSFET to control the starting. This may be the wrong MOSFET, I don't know. I picked it up at Radio Shack to experiment with. I don't know how to choose the correct MOSFET from the data sheets. Maybe I need some help here?

To test whether I had it connected correctly, I tested the MOSFET with this setup on my breadboard:
ext 12V positive --- 220ohm --- diode --- drain --- source --- ground
Everything worked when I connected the gate to an Arduino output and switched between LOW and HIGH. I'm not sure why this won't work when connected to the generator wiring. From what I can tell, all I'm doing is controlling a relay. Why won't this work? I connect the two generator wires to the drain and source, but nothing happens when I actuate the gate. I've switched the drain/source polarity to be sure, but I still get nothing.

Firstly, do you know how the relay is wired up?

Are you controlling the circuit between the power + and the relay, or between the relay and - ?

If the former (which is most likely), then you really need a P channel MOSFET, as that is much better at high side switching.

Do you have 0 volts on the Arduino going to 0 volts on you controlled circuit?

majenko:
Are you controlling the circuit between the power + and the relay, or between the relay and - ?

Small engines always switch between Bat + and the starter relay's coil. I think all cars do as well. The coil will be around 5 ohms.

You will need a flyback diode across the relay winding to prevent inductive spikes damaging the MOSFET.

Thanks for the help everyone.

majenko:
Firstly, do you know how the relay is wired up?

Are you controlling the circuit between the power + and the relay, or between the relay and - ?

If the former (which is most likely), then you really need a P channel MOSFET, as that is much better at high side switching.

Here is the schematic from the generator. I highlighted the two wires I'm tapping into for the remote start (red and red/white). From what I can tell, I'm controlling between the power and the relay, as Chagrin stated. I did test this with a relay and got everything to work. I wanted to use a MOSFET due to space constraints and I thought it was a simple swap.

So I need a P channel instead of the N channel that I have? I'll look into that. If anyone has any good links for tutorials, I appreciate it.

LarryD:
Do you have 0 volts on the Arduino going to 0 volts on you controlled circuit?

Yes, they are all grounded together. This is easy since I'm powering the Arduino off the generator battery.

MarkT:
You will need a flyback diode across the relay winding to prevent inductive spikes damaging the MOSFET.

I thought that was only needed if the MOSFET was controlling something with a winding like a motor. Since I'm controlling a relay, I thought the diode wasn't needed.

I thought that was only needed if the MOSFET was controlling something with a winding like a motor. Since I'm controlling a relay, I thought the diode wasn't needed.

What do you think makes a relay work? Magic Cheese?

majenko:

I thought that was only needed if the MOSFET was controlling something with a winding like a motor. Since I'm controlling a relay, I thought the diode wasn't needed.

What do you think makes a relay work? Magic Cheese?

Somehow in my mind, I interpreted "something with a winding" as "something with a moving armature". I didn't count the winding on the solenoid portion of the relay. But thinking about it now, I see it.

ticklechicken:

majenko:

I thought that was only needed if the MOSFET was controlling something with a winding like a motor. Since I'm controlling a relay, I thought the diode wasn't needed.

What do you think makes a relay work? Magic Cheese?

Somehow in my mind, I interpreted "something with a winding" as "something with a moving armature". I didn't count the winding on the solenoid portion of the relay. But thinking about it now, I see it.

LOL Usually I find relays to be much more inductive than motors.