I need an easy way to limit current in a mosfet circuit.

Hello all, I am looking to drive a mosfet pwm from the arduino directly. Problem is I want to make sure the load doesn't spike to excessive currents. Say keep it under 20 amps at all times.

Can any body suggest an idea if this can be done with a simple resistor or some other component.

I am looking for something effective and reliable, but not too elaborate.

At that current I would consider monitoring the current level with the Arduino and adjusting the PWM accordingly. An efficient (power-wise) way to do this is with a hall-effect current sensor like the Allegro ACS712 and relatives (like this board, though it uses an ACS712 only rated for 5A).

Less efficient is to put a current sense resistor in series with the current path, like 0.01 ohms or so, and then measure the voltage across it using a carefully-designed amplifier circuit. The power wasted in this resistors is I*I*R (where I is the load current, 20A in your case) so the smaller the resistor the better, and its power rating must be chosen carefully (at least 5W for 0.01 ohms in your case).

You could also use a high-side current sensor like the ZXCT1009 as it is essentially an integrated current-to-voltage converter, though you have to put it on a PCB.

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

There's voltage regulators that can do the job.

http://www.reuk.co.uk/LM317-High-Current-Voltage-Regulator.htm

http://www.reuk.co.uk/Using-The-LM317T-To-Regulate-Voltage.htm

Example - Recharging a Mobile Phone Battery from a 12V Battery Bank with an LM317T Therefore, if for example you decide to recharge your mobile phone battery directly from a 12 Volt (nominally) battery bank you would typically need a voltage output of around 5 volts, and an output current of around 500ma. The LM317T can handle average currents of up to 1.5 Amps so it will work well in this situation.

I don't know the energy cost. There's a 1.25V ref bleeding out through a good size resistor in the circuits I saw.

power453c:
I am looking to drive a mosfet pwm from the arduino directly. Problem is I want to make sure the load doesn’t spike to excessive currents. Say keep it under 20 amps at all times.

If we’re talking resistive loads, then you can use an AMPOP in a well-known current sink configuration (open the datasheet of National’s LM358, the circuit is there) and be prepared to dissipate a huge amount of heat.
If we’re talking inductive load, it all depends on how fast your current goes up, but the already mentioned LM3xx comparator and shunt resistor may be a good and simple option, connected directly to a pin in interrupt mode; still some work needs to be done on the sw side so that it all works ok. Anyways, as I said, it all depends on how fast your current goes up.

power453c:
Can any body suggest an idea if this can be done with a simple resistor or some other component.

I am looking for something effective and reliable, but not too elaborate.

And cheap too, right? The holy grail of engineering :), unfortunately you can only pick 2, any 2.

Maybe you could connect a Hall sensor watching the output in a way to limit the input to the fet.

add: Or maybe there's some way to coil the outgoing wire current around the grid lead. Probably only take a few turns.