Arduino: Detect if 220V Live Wire is Working or is cut

I have a 220V live wire, and I want to detect if it has voltage (i.e., if it's working) or if it's cut off.

I would like to use an Arduino to check this and recieve a high signal (5V) if the wire is live and a low signal (0V) if it's not.

Can someone suggest how to detect the presence of voltage on the 220V wire using Arduino ?

I understand the high voltage can be dangerous,

Do i need to use example pc817 optocoupler or there is different aproach

Thanks in advance!

Hi, @arpa123
You have two wires for 220Vac.

Use a small transformer or plug pack across the mains and monitor the output of the transformer or plug pack with the Arduino.

Tom.. :smiley: :+1: :coffee: :australia:

Hello arpa123

Use a plug-in power supply with an output voltage of 5 volts which is monitored by the Arduino.

Wrap an insulated wire around the live wire, maybe 20cm or so long. For clarity do not connect the wrapped wire to the live wire. Connect the wrapped wired to a CMOS 40106 inverter input and use a 10M Ohm pull up resistor to 5V. Hopefully you will get a 50Hz square wave on the output of the inverter when the live wire is live, and low when not. You can use one of the spare inverters in the 40106 if you want the idle state to be high.

At the risk of repeating myself: No electrical connection to the mains should be made anywhere, just an insulated wire wrapped around the live wire.

I dont have neutralwire. I have just 220v phase

I need to make a pcb . So i need to connect phase to terminal block

I don't understand your point. What I am suggesting requires no electrical connection to the live wire.

I can not wrap a wire around live wire. Coz point is to connect live wire to pcb with screw terminal and then to check if its on or off.

Have you been trained to work with this voltage?

I will not make the pcb. I want to see in theory like to see a schematic how this can work.

I read this but idk if this is correct or there is simpler way:

-detect AC using a single live wire with a PC817 optocoupler:

  1. Live AC Wire -> Connect to current-limiting resistor (e.g., 1kΩ).

  2. Resistor -> Connect to the LED side (anode) of PC817.

  3. PC817 Cathode -> Connect to GND.

  4. PC817 Output (Collector) -> Connect to pull-up resistor (10kΩ) to 5V (or Vcc).

  5. PC817 Output (Emitter) -> Connect to DC signal output.

Result: When AC is live, the output is low; when AC is off, the output is high.

220 volts relative to what?

I still don't understand. Why is the point 'to connect it to the PCB'? Surely the point is to detect if it is live. My suggestion does so without an electrical connection to the live wire.

Still, you have other suggestions, maybe go with one of those.

Good luck with your project.

To ilustrate l just want to test if wire has voltage or not.
Same like u do with this (check image) but just i need to get lets say a 3.3v or 5v signal that i can read in arduino when wire has voltage or wire dont have

Which is what my suggestion does.

:joy: the question is: lets say im building a pcb ( its not that i will build myself coz i know i will get 100 messages saying u cant do it , u are not qualified to do it etc etc. )

How can this be achieved if we just want to connect wire to a pcb screw terminal and then read the signal in arduini.

Insteand of wrapping a wire to the live wire is there a way to do this in a pcb.

Example: some antenas are integrated in pcb. (I dont know what example to get)

You'd have to put live and Arduino tracks close to each other, but the point of what I am suggestion is that it's safe because there's no connection to the live wire, and the live wire is not on the PCB. Bringing the live wire to the PCB is dangerous, however carefully you design the PCB. If you can't make my suggestion work for you then you have other suggestions from other people to think about.

Is the PCB ground connected to earth ground? If not, Perry's method is your only choice and that may not work reliably.

Do you want to do something like this?

1 Like

Yeah something like this. Will it work if i dont have neutral ac wire? So i just have the live phase wire