Jump to content

How To Detect Presence Of Ac


toozie21
 Share

Recommended Posts

Once again I end up diving into the analog domain where I am so weak....

So, for my snow machine add-on to my snowman snowfight wireframe, I was going to add another I/O line to turn the circuit on/off. But as Iwas thinking about it, the circuit will be on/off at the same time as one set of mini lights. I then thought that it might be easier to just tap off the set of lights and if I detect AC, turn on the circuit (need a TTL level 5V), and if when there is no AC, turn it off. I don't mind wiriring in the AC, but I am not sure what is the simpliest/cheapest way to know if AC is on. Some sort of bridge rectifier? Via inductance? Something more simple?

Link to comment
Share on other sites

The easiest thing that comes to mind for me is to use a relay with a 120V AC coil and the contact to supply the 5V. When the AC is on the coil energizes and you get your 5V.

The relay is probably the best option. If you're using a controller (like LOR), you will probably want to use a solid state relay instead of a magnetic coil relay so the inductance doesn't damage the triac on the output.

Link to comment
Share on other sites

hmmm, interesting. Is this a regular A/C relay being used the opposite how you would normally used it, or a special one designed for this purpose? Is this something I can re-purpose from something at home or the hardware store, or should I pick some up online?

I am not hooked up to LOR, it was actually probably going to control a Darlington transistor pair (like a ULN2803), so a machanical one may work OK for that.

Link to comment
Share on other sites

The easiest thing that comes to mind for me is to use a relay with a 120V AC coil and the contact to supply the 5V. When the AC is on the coil energizes and you get your 5V.

Some relay coils, smaller ones generally will pull in with AC/DC. Others might burn up in the presence of the wrong juice.

You might want to consider a current relay.

http://www.veris.com/Item/H800.aspx

They loop over your wire and will pull in a small reed switch when the AC current exceeds design, 0.15A or so. If you need more sensitivity, you can loop the current carrying wire around the current relay a few times.

Edited by Entropy
Link to comment
Share on other sites

A mechanical relay with an AC rated coil will be the simplest solution. Something like this Omron one would do. The existing load of the mini lights should swamp any inductance of the relay.

You could alternatively use an AC input optocoupler such as the Vishay HA11AA1 and the circuit below. The capacitor on the output side smooths out the 120Hz / 100Hz ripple. The output will be high normally and go low when 120V AC is present.

The usual warnings about playing with mains voltages, etc apply. :)

post-10982-0-52604400-1350079815_thumb.j

Link to comment
Share on other sites

Ooo, I like that HA11AA1 circuit. That was sort of what I was thinking. I got excited for a few minutes because I thought I had that on my shelf, but what I really have is a H11A1 which appears to be its cousin (best I can tell is that it only has the one LED present). You can see how I was using it in the bottom left of this schematic: http://www.tooz.us/ChristmasCountdownV2.1.pdf

Edited by toozie21
Link to comment
Share on other sites

Yeah, the AA version has the 2nd LED. You can use the single LED one and add a 1N914 or 1N400x diode in inverse parallel with the opto input to provide the reverse voltage protection. The output ripple will be 50/60 Hz though instead of 100/120Hz so you may need to increase the capacitor or pullup resistor value.

Edited by David_AVD
Link to comment
Share on other sites

Try using a 22K pullup and leave the capacitor as 1uF. The 10K and 1uF are from a working circuit design with a H11AA1 opto.

You can use two 47K resistors in parallel or two 10K resistors in series to make up the 22K types. The variation either way won't affect it too much.

I calculated the resistors to give enough current for the opto to fire whilst not drawing too much to cause heat issues in the resistors. (Ohms law)

Link to comment
Share on other sites

  • 1 year later...

David, Not sure if you are still lurking about, but I am back to working on this (though I would love to hear anyone's input).

 

As I dive into the snow machine I want to control, I have a better understanding of how its inner controls work that I need to replicate.  

 

Basically, the snow machine will be supplying a constant 12V, when I don't want the snow machine to run, I pass that through.  When I want it to run, I need to pass 5V through (which I plan to make via an LDO).  What I am going to use to make the distinction is the opto-isolator detecting AC voltage on a section of the display.

 

So when the output of the opto is low, I need to put out 5V from my little breakout board.  When the opto is high (I could pull it up to 5V or 12V), I need to pass the 12V out of my board.

 

I am a little stumped on how to handle that.  I can invert the output of the opto-isolator which will clean things up some and mean it is active high, but I am not sure how to select between the two voltages.  Maybe something like an analog mux (or is there something more basic that could work)?

 

Any suggestions?

Link to comment
Share on other sites

Basically, the snow machine will be supplying a constant 12V, when I don't want the snow machine to run, I pass that through.  When I want it to run, I need to pass 5V through (which I plan to make via an LDO).  What I am going to use to make the distinction is the opto-isolator detecting AC voltage on a section of the display.

 

So when the output of the opto is low, I need to put out 5V from my little breakout board.  When the opto is high (I could pull it up to 5V or 12V), I need to pass the 12V out of my board.

 

I am a little stumped on how to handle that.  I can invert the output of the opto-isolator which will clean things up some and mean it is active high, but I am not sure how to select between the two voltages.  Maybe something like an analog mux (or is there something more basic that could work)?

 

Any suggestions?

 

In case anyone stumbled upon this thread looking for a similar answer, I ordered a Maxim MAX4544 SPDT analog switch to solve this.  I haven't had a chance to test it out, but I can't imagine why it wouldn't work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...