Detecting mains voltage - Page 1
Forum section: electronics / beginners

author: aroby
author_rank: Regular Contributor
timestamp: March 03, 2014, 07:00:42 pm
content: Is there a simple way to detect when mains voltage is present?I am going to put together a simple XBee-based remote switch. The scenario is I have an existing in-wall digital timer to control outdoor lights and would like, when that timer turns on the lights, to activate another set of lights that are wired to power at a different location. Getting the remote switching running is no problem, but what I need is a way for the source XBee to detect when the timer turns on/off the power - kind of like a reverse relay (since the XBee will already have power, I just need to apply that to one of the IO pins).Clearly I have options such as connecting a small power supply to the switched side of the timer; or opening up the timer (which has an LCD display) and seeing if there is already a low voltage output. Are there other approaches? Is there such a thing as a relay that switches under mains voltage. Or an induction coil type of arrangement?Thanks for any ideasAnthony

author: IanB
author_rank: Super Contributor
timestamp: March 03, 2014, 08:02:17 pm
content: You could do something simple like connect a neon lamp on the output of the timer and use a photo-detector on the input of the XBee to detect when the neon is lit?

author: kripton2035
author_rank: Super Contributor
timestamp: March 03, 2014, 08:09:38 pm
content: there are relays that need mains voltage to turn on, and then switch another mains voltagesearch for 220v or 110v relays depending on your location.

author: aroby
author_rank: Regular Contributor
timestamp: March 03, 2014, 08:41:49 pm
content: Quote from: IanB on March 03, 2014, 08:02:17 pmInteresting idea. That may also help with the need to separate the high and low voltage in the installation box.Thanks

author: Circuitous
author_rank: Unknown
timestamp: March 03, 2014, 09:44:37 pm
content: There are plenty of opto isolators out there that will do this for you.Just be sure to use a big enough resistor to limit the current and make sure it is flame-proof... I can't recall getting any other direction on that.Also, check the isolation voltage of the opto, but it should be good enough, they're usually pretty high.I don't recall the specific ones that I used, but I can check tonight if you need some specific part numbers.The ones I chose have dual (reverse biased) LEDs, so that it picks up both halves of the cycle.

author: sacherjj
author_rank: Frequent Contributor
timestamp: March 03, 2014, 10:38:30 pm
content: I've used the LTV-354T from LiteOn for this and it works well. You get pulses for all time, but zero crossing. Which allows you to find zero crossing for free. Just put in the correct current limiting resistors. I was getting solid switching at < 2mA.We switched to another smaller Opto, due to board size for the multi channel design. Not finding that right now.

author: Psi
author_rank: Super Contributor
timestamp: March 03, 2014, 10:57:13 pm
content: i wonder if you could put a turn of the mains wiring around a floating ADC input and pickup the 50hz coupling to it.

author: aroby
author_rank: Regular Contributor
timestamp: March 04, 2014, 01:32:15 am
content: Quote from: Circuitous on March 03, 2014, 09:44:37 pmThanks for the suggestion. If you have part numbers handy, that would be great, but I'll also scout around on Digikey and see what I can come up with.

author: aroby
author_rank: Regular Contributor
timestamp: March 04, 2014, 01:33:49 am
content: Quote from: Psi on March 03, 2014, 10:57:13 pmI guess I should try that and see what happens!

author: Psi
author_rank: Super Contributor
timestamp: March 04, 2014, 02:01:03 am
content: Digital input should work too but will require more voltage swing to be detectable.

author: Shock
author_rank: Super Contributor
timestamp: March 04, 2014, 03:05:34 am
content: Just in case it hadn't crossed your mind. If there is just one or two other switches is there any reason why you cannot wire it on a timer like the one you have already?Programmable light switches run about $40, unless you absolutely need remote control I would take the easier route. Safer as well.

author: BurtyB
author_rank: Regular Contributor
timestamp: March 04, 2014, 12:54:22 pm
content: The thread from a couple of weeks ago might give you some other ideashttps://www.eevblog.com/forum/beginners/detecting-presence-of-mains/.

author: ConKbot
author_rank: Super Contributor
timestamp: March 04, 2014, 01:27:03 pm
content: Quote from: Psi on March 03, 2014, 10:57:13 pmIIRC, in one of the teardown videos Dave did, a unit (I forget what) had a wire from the low voltage side heat shrunk to the insulated AC power wires to pick up mains. Simple, and provides double isolation (cap the end of the pickup wire with small heat shrink before you heat shrink it to the AC wiring, not just a bare cut end)

author: Stonent
author_rank: Super Contributor
timestamp: March 04, 2014, 02:00:28 pm
content: I was thinking one of those cheap hardware store volt alert clones. When they buzz or light up, you can detect that.

author: aroby
author_rank: Regular Contributor
timestamp: March 04, 2014, 09:51:46 pm
content: Quote from: Shock on March 04, 2014, 03:05:34 amThis is what I wanted to avoid! I have several circuits around the property that I'd just like to activate from one timer. So I don't have to change the on/off times on all the timers and keep them in sync.

author: aroby
author_rank: Regular Contributor
timestamp: March 04, 2014, 09:52:25 pm
content: Quote from: BurtyB on March 04, 2014, 12:54:22 pmThanks, I missed that one.

author: aroby
author_rank: Regular Contributor
timestamp: March 04, 2014, 09:53:40 pm
content: Quote from: Stonent on March 04, 2014, 02:00:28 pmThat sounds exactly what I need. Why didn't I think of that?? I think I need to take mine apart and see what's in there.

author: IanB
author_rank: Super Contributor
timestamp: March 04, 2014, 10:14:38 pm
content: Quote from: aroby on March 04, 2014, 09:53:40 pmI think you have to watch out for those detectors, they easily give false alarms. For instance all my non-contact voltage detectors believe my iPhone is live when the charger is plugged in.

author: Psi
author_rank: Super Contributor
timestamp: March 05, 2014, 05:13:59 am
content: Quote from: IanB on March 04, 2014, 10:14:38 pmThat's because your iPhoneislive when the charger is plugged in