Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to detect Ac

Status
Not open for further replies.

khatib

Member
I Need Circuit That Can Detect The Occurance Of Ac Voltage , And When Ac Disrupt Occur , The Pic Will Control The Operation 16f877
How To Do That ?
 
diode, capacitor, scaling resistors to an analog input maybe.
 
Exactly what the previous poster suggested. Now draw a circuit diagram of what he said and write the code for a sub-routine to detect the AC. You can either "poll" the input or have the "HIGH" send the micro to the ISR. (interrupt the operation of your program and deal with the HIGH).
 
Use the same coat-hanger this time. Just connect it to the input of a micro with a voltage-divider and you have the answer. Use a capacitor if you want isolation.
 
Try this, it has worked for me.
 

Attachments

  • 120V AC turn on led.pdf
    331.5 KB · Views: 738
You don't need anything so complex. Just 4 x 1Meg resistors (2 x 1M in series) on each line. 100n caps on each line (200v rating or higher) feeding into the input of the micro. The current will be so low that the protection diodes will clip the signal.
 
Well, 6 components is a little piece of mind, then that is one less thing to go wrong.
Or, you know use the coat hanger thing, it doesn't matter to me.
 
Last edited:
The previous circuit (the attached file above) did not provide isolation from both lines so it would need more components. You cannot assume one line will be neutral. You must treat both lines as "active" and provide isolation in the form of "current isolation."
 
Last edited:
The coat hanger or the one I suggested?

It uses capacitive reactance, doesn't matter what way you hook it up.
 
Last edited:
The previous circuit (the attached file above) did not provide isolation from both lines so it would need more components. You cannot assume one line will be neutral. You must treat both lines as "active" and provide isolation in the form of "current isolation."

He design it with a OPTOCoupler , it will be ok.
For extra precaution, make sure your instrument has a EARTH grounding.

Csaba
 
Line isolation and no high wattage dropping resistors or HV capacitors. The lamp represents the AC load. The diodes need to be rated for the AC load current, so may not be convenient in all cases. Also it indicates the load is drawing current, not just that the switch is closed. (i.e. burned out lamp ;) )

ken
 

Attachments

  • Line Detector.gif
    Line Detector.gif
    7.4 KB · Views: 502
Last edited:
I was just inserting that caveat in my post.

ken
 
Last edited:
Still nice.

The one I posted is patented. At least in a device that is patented... so I know it works well...
 
Last edited:
The coat hanger or the one I suggested?

It uses capacitive reactance, doesn't matter what way you hook it up.

It certainly DOES MATTER which way you hook it up. Connect the lower line on the diagram to the "active" wire of an AC outlet and you are directly connected to 120v or 240v.

That's why you should not give advice unless you have actually tested what you provide.
 
just to put a little light on it here some thing to think about you can use a Optocouplers for isolation and resistor for current limiting. and feed it 120 volts
now we can't look inside a Optocoupler so I just use a led so you can see that
it's not going to hurt your Optocoupler.
 

Attachments

  • GEDC0318-1.JPG
    GEDC0318-1.JPG
    19.7 KB · Views: 247
  • GEDC0319-1.JPG
    GEDC0319-1.JPG
    17.7 KB · Views: 288
  • power.PNG
    power.PNG
    11.4 KB · Views: 282
Last edited:
I think you'll find the the reverse breakdown voltage of the LED in the optoisolator is something less that 120v x 1.414. Placing a 1N4003 across the LED, and opposite the LED polarity will solve that problem. The resistor will have to be a 2W...dissipating 1.44 W.

But that works.

Ken
 
I think it a little less then 1.44 W. more like 422.5 Milliwatts but any way I let it stay on for a hour with just a half watter 10 k and it didn't get hot You no phone's have them Optocouplers in them to pickup the ring-signal AC wave it can be up too 90 volts
 
Last edited:
Hey be80be - the circuit you've drawn cant possibly work, the sense wire coming off the emitter will never sit at anything but ground potential.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top