Reducing surge current in 5V High Side Switch
It depends on what is the load.

My guess is that you have caps on your subcircuit and when you switch on the circuit, the caps are basically in short and it resets your MCU as the rail voltage is getting too low.

The capacitor on the mosfet gate might not be the best solution for two reason. 1. the mosfet will be in transiant state and you will have to oversize the mosfet and 2. it will be very temperature dependant, your circuit might stop working at different temperature as the gate threshold may vary a lot regarding temperature.

A common and simple way to reduce inrush current is to add an inductor in serie with the load. You may also want to add a flyback diode.

The inductor will have a high "resistance" to the current going through when you switch on your circuit, thus letting go very little current, but once in DC state it will have very small "resistance". Choose a inductor with high inductance and low resistance value (thick wire, high saturation current).

Calculate the value of the inductor accordingly.







simulate this circuit &ndash; Schematic created using CircuitLab