Detecting Voltage

I'm wanting to find a simple method for detecting if their is AC voltage. I don't need to know what the voltage is, but looking for a way to detect if anything above 15-20v is present. I've looked into the zmpt101b board, but I really don't need to know what the voltage is.

I do know that main voltage can be dangerous, I'm a licensed electrician, just new to microcontrollers and electronics.

Thank you

If it is 50/60 Hz AC mains, just use a small wall wart transformer, as described here.

What is the maximum voltage which can appear in the circuit you are measuring?
Maybe you can make something with a capacitor, resistor, opto-coupler and a diode, depending on the voltage range.

If you power an electromagnet with AC the field will keep reversing, a Hall Switch can catch that.

Arduino pins are not made to take negative V or more than VCC (5V on some, 3.3V on others).

Or just use a relay powered by the voltage you want to detect

AC should take just how long to burn out a relay?

6v6gt:
What is the maximum voltage which can appear in the circuit you are measuring?
Maybe you can make something with a capacitor, resistor, opto-coupler and a diode, depending on the voltage range.

Maximum of 240v phase to phase (US) at 60Hz.

Don’t really understand goforsmokes post:

Relays With coils for AC voltages are extremely common .
Eg....
https://uk.rs-online.com/mobile/p/non-latching-relays/3949116/

This should work between about 10 and 250 volts. The output at the opto-coupler is inverted. The current at 250 volts is 12mA.
Use an appropriately rated capacitor.

hammy:
Don’t really understand goforsmokes post:

Relays With coils for AC voltages are extremely common .
Eg....
https://uk.rs-online.com/mobile/p/non-latching-relays/3949116/

And how will you detect AC current with one of those? It takes 3A to switch.

A latching relay, the type we mostly use with Arduino would buzz and get HOT in seconds.

Thank you for your suggestions. While I was working today I was thinking about making it very simple. Since this is going to be in a sealed case my new idea is to use a light (probably small LED) with a photoresistor. Like I said I'm new to this, but does this sound like a simple and reliable method to detect voltage?

zordtk:
Thank you for your suggestions. While I was working today I was thinking about making it very simple. Since this is going to be in a sealed case my new idea is to use a light (probably small LED) with a photoresistor. Like I said I'm new to this, but does this sound like a simple and reliable method to detect voltage?

Yes, use a green LED because a photoresistor is most sensitive to that colour. But if I were doing it, I would worry about how to house the detector part. It has to be effectively blocked from ambient light.

How do you plan to connect an LED to 240VAC mains?

aarg:
Yes, use a green LED because a photoresistor is most sensitive to that colour. But if I were doing it, I would worry about how to house the detector part. It has to be effectively blocked from ambient light.

I will probably put it in a case like this:

jremington:
How do you plan to connect an LED to 240VAC mains?

I doubt I will need to hook it up to anything above 120v. Bigclive has done a video on running a LED on 120v or 240v

The LED might not last as long, but thats not a big deal. I'm looking to make a device that I can plug into an outlet, go to the panel and flip the breaker. Then use this to verify that the circuit has been shutoff via bluetooth.

I could use a Neon bulb instead of a LED

zordtk:
I could use a Neon bulb instead of a LED

Saw it coming, it works. The only thing is, illumination life. I think a typical Neon runs something like 15,000 hours. LEDs last much longer.

The problem with driving a LED from 220V is not lifetime though, I think it's more along the lines of safety. You can drive it by current limiting with a low value capacitor, but it is susceptible to surges and fails spectacularly when it does. If you use a limiting resistor, the power dissipation is large. I think I've seen RC combinations in commercial LED lighting.

The thing about using a led is that you'd better know what ACV you get and hope it's not a spiky line. Even with an opto-isolator (which IS a led and detector per channel in an IC) you don't have much range.

Why I suggested an electromagnet (wind some wire around a steel nail, not many turns is needed) is because a good one won't smoke or suck too much power but will just work up to some voltage depending on how thick the wires are. With a ~50 cent Hall Switch (aka Security Switch) to detect the field you can connect a red-green led so that +V shines green, -V shines red, AC appears amber. That's what logic detectors do.

And it appears that using optos is industrial practice.
https://www.mouser.com/datasheet/2/149/HCPL3700M-837969.pdf

Again thank you for your help. After thinking about it more I’m going to go even simpler. I have a DC transformer that will take 100-240v AC and output 3v DC. I can then check for voltage with the ardunio.

zordtk:
Again thank you for your help. After thinking about it more I’m going to go even simpler. I have a DC transformer that will take 100-240v AC and output 3v DC. I can then check for voltage with the ardunio.

With an appropriate input protection network on the analog input, I hope…

How are you anyway going to power the Arduino ?
It appears that you are making some sort of Bluetooth "electrician's neon screwdriver".
Why not simply power the Adruino (ESP32 etc.) using a USB type phone charger connected to the circuit you are measuring. It constantly transmits on the Bluetooth channel. When you start trying to isolate that circuit, by switching breakers etc., and the Bluetooth channel fails, you know that you have interrupted the correct circuit.

6v6gt:
How are you anyway going to power the Arduino ?
It appears that you are making some sort of Bluetooth “electrician’s neon screwdriver”.
Why not simply power the Adruino (ESP32 etc.) using a USB type phone charger connected to the circuit you are measuring. It constantly transmits on the Bluetooth channel. When you start trying to isolate that circuit, by switching breakers etc., and the Bluetooth channel fails, you know that you have interrupted the correct circuit.

Rechargeable battery. That method would work, but I would like to be able to turn the breaker back on to verify it’s the correct one. So I don’t want to drop the connection to the arduino.