Atmel AVR cutting down the power
You can smooth out spikes with a capacitor. And a pull down resistor should keep the GND while powered off. Something like this:







simulate this circuit &ndash; Schematic created using CircuitLab

When the capacitor is empty and a spike hits it will start charging and hopefully the spike will be over before the voltage on the regulator leaves the low state. The pull down resistor R3will discharge the capacitor over time. R2 protects the AVR from drawing too much current from the GPIO pin when charging the capacitor while R1 protects the regulator from spikes (I assume you mean the AVR pin spikes).

You probably have to adjust the values of R1/2/3 and C1 to fit. You can connect an osciloscope and simulate spikes to check your math.