Control relay

Hi, guys I want to try to make a project such as an automatic transfer switch with a microcontroller can you teach me how to control the relay using pzem004t ?? so, when the 220v voltage turns off pzem004t will detect no 220v voltage then will replace the relay to turn on the generator and when the 220v voltage is back the relay will turn off the generator and return to 220v

sorry my English is bad

Drop the Arduino an use a 220V relay to watch the presence of the 220V, and turn on the generator with the N.C. relay contact.

For the hardware setup ask somebody to make a safe mains connection for you, else you risk to kill your module, Arduino, PC and possibly yourself.

Google reveals several web pages for PZEM004T and Arduino.

Shouldn't it be the N.O contact that makes when there's no voltage on the coil?

IchsanKautsar:
Hi, guys I want to try to make a project such as an automatic transfer switch with a microcontroller can you teach me how to control the relay using pzem004t ?? so, when the 220v voltage turns off pzem004t will detect no 220v voltage then will replace the relay to turn on the generator and when the 220v voltage is back the relay will turn off the generator and return to 220v

sorry my English is bad

You'll require much more than a single relay.

Not to mention local authority approvals.

There are required delays which must be observed in both operations.

Many places do not allow software to control the actual change over detection.

Railroader:
Shouldn't it be the N.O contact that makes when there's no voltage on the coil?

Think you'll find that is a standard reference for NC.

Most auto start generators have (optional) an autotransfer switch that is designed for the application and has all government approvals.

IMHO this is not a hobby project

If you are trying to keep power for a project then look at computer uninterrupted power supply

@bluejets
You're perfectly right! NC will work. Too early for me to answer at 10 am....

I agree with previous comments about using approved equipment and local regulations .

As an example - what earth do you use ? The supply authorities earth may not be acceptable ( imagine workers somewhere working on power plant when your generator faults and puts power on an earth wire that the worker have disconnected).