Detect AC Main supply from Meter

Dear Friends,

Scenario:

There is regular loadshedding (government cut electric supply to resedential societies for an hour to conserve electricity nationwide).
I want to detect either main supply from my meter is coming in my home or not… Once my Arduino Uno detects it with any sensor or any electronics then I can start other part of my project which is turning on generator key by rotating servo motor…

Someone guide emw to use 5vdc adapter with resistor to input pin of uno… when power is coming…5vdc is as input…when power supply absent…then 0vdc to Uno pin

Mains detection is a simple relay, always has been. If you have to ask about that part then the following most certainly applies to you.

It's what comes after that gets complex and can land you in a lot of trouble if you go playing with authority supply without certification and qualifications.

follow that guide of 5Vdc/0Vdc your friend gave you , works simply great so far

Hi, You not only have to detect the presence of the mains, you have to safely and faultlessly switch your house load from the mains to the generator.

Tom... :)

...then I can start other part of my project which is turning on generator key by rotating servo motor...

Would it not be immensely easier and more reliable to simply bridge the starter switch with two relays for ON and START? Have you given any thoughts to determining when turn off the starter?