How to hardware reset ATMEGA328 ?

I presume you only connected it to ground temporarily... While low the chip is held in a low power
state, it starts running again when the reset pin is released. The reset pin may need a pull-up
resistor in an noisy environment to strengthen the internal pullup, suggest 4k7 for that.