surge detection circuit using microcontroller

Hello  everyone, I am to design a circuit that disconnects home appliances from main supply upon occurrence of surge and connect them back when the surge is over using Arduino or any microcontroller. How do I detect the surge when it occurs? Thanks