Zero crossing detector for AC line voltage?
Nak
Posts: 36
Greetings,
As a getting-started project with my Propeller Education Kit I have been tinkering with the idea of a digitally-controlled light dimmer. As the first step, I need to build a circuit that can sense the zero crossing of the AC line voltage and output a logic-level signal that I can read on one of the propeller's digital IO pins. Looking at other DIY projects on the Web, I found a circuit design using a DF04M bridge and and a 4N33 optocoupler and I ordered up the parts. Today I tried assembling it and testing at each stage that the circuit was working as expected.
But, right away I ran into an issue where the circuit does not seem to behave correctly.
When I run the AC current across the bridge, and then connect the bridge's + and - outputs across a 1M resistor so I can look at the output on an oscilloscope, I see a waveform that looks like this:
_ _ _
/ \ / \ / \
---
---
Rather than the expected waveform:
_ _ _
\ / \ / \ / \
- - - -
In other words, it looks like output from a half-wave rectifier rather than a full-wave rectifier. What is the likely cause of this? Did I get a bad bridge from Digi-Key or perhaps damage it while handling it? Or have I simply connected it up wrong?
-- Kaelin
PS: Sorry the ASCII art seems unintelligible... Basically it's looking like the AC sine simply has its lower half chopped off instead of rectified to a positive voltage.
Post Edited (Nak) : 12/6/2009 1:36:33 AM GMT
As a getting-started project with my Propeller Education Kit I have been tinkering with the idea of a digitally-controlled light dimmer. As the first step, I need to build a circuit that can sense the zero crossing of the AC line voltage and output a logic-level signal that I can read on one of the propeller's digital IO pins. Looking at other DIY projects on the Web, I found a circuit design using a DF04M bridge and and a 4N33 optocoupler and I ordered up the parts. Today I tried assembling it and testing at each stage that the circuit was working as expected.
But, right away I ran into an issue where the circuit does not seem to behave correctly.
When I run the AC current across the bridge, and then connect the bridge's + and - outputs across a 1M resistor so I can look at the output on an oscilloscope, I see a waveform that looks like this:
_ _ _
/ \ / \ / \
---
---
Rather than the expected waveform:
_ _ _
\ / \ / \ / \
- - - -
In other words, it looks like output from a half-wave rectifier rather than a full-wave rectifier. What is the likely cause of this? Did I get a bad bridge from Digi-Key or perhaps damage it while handling it? Or have I simply connected it up wrong?
-- Kaelin
PS: Sorry the ASCII art seems unintelligible... Basically it's looking like the AC sine simply has its lower half chopped off instead of rectified to a positive voltage.
Post Edited (Nak) : 12/6/2009 1:36:33 AM GMT
Comments
You have to have a Optic Sensor that is made to be used on AC voltage
I have used this Optic Sensor and it works very well
You do have to use two 120000 ohm resisters one on each input pins for 120 [url=mailto:volts@.0005]volts@.0005[/url] amps or 5 millamps
The part that you want to use is a H11AA1 optic sensor Data_Sheet
http://www.sullivan-county.com/ele/triacs2.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 12/6/2009 2:43:30 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·
Of course I would still like to understand what is going on with the circuit I built. What I did was hook up the bridge ~ terminals to an AC power cord with some 10K resistors, then put the +/- outputs from the bridge through a (1M I think) resistor and the oscope probes across the resistor. The output looked like the bridge was acting as a half-wave rectifier rather than a full-wave one.
THEN for some reason I decided it would be a good idea to look at the signal coming into the bridge on channel two and so I put a second oscope probe across the AC input one the "outsides" of the resistors. As soon as I applied power to this setup, I got an impressive spark shooting out of the wall socket and one of the breadboard wires coming from the AC power cord melted in a heartbeat! I don't understand why this happened, as I had previously tried looking at the wall current with a trivial circuit consisting of a 1M resistor between the AC leads and that seemed to work fine. SO at that point I decided to pack up my project until I could seek expert advice...
The 4N33 opto was eventually supposed to be attached to the rectified output from the bridge (so then DC, but still at some high voltage) and then drive a 3.5V signal line to be attached to my microcontroller. But of course I never got that far, as I want to comprehend what is going on with the bridge first.
PS: I'll try attaching a scope image if Chris or someone will first explain to me where I went wrong with that AC short... I'm a little reluctant to risk damaging the oscope playing with 120V AC power!
Post Edited (Nak) : 12/9/2009 8:56:19 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·
In my woefully limited understanding, the resistors on the AC side are there to control the current levels presented to the bridge. (I think of them as little soda straws stuck into a big pipe of fast-flowing current.) On the bridge output side, the 1M resister is there simply to complete a circuit without making a short (e.g. a "dummy" load).
As to what the waves should look like, fully rectified should look like the negative half of the AC sine wave is "reflected" back into the positive domain (with little flat spots between the humps caused by some latency/loss inherent in the circuit). What I get instead looks like the bottom half of the AC sine wave was simply chopped off (with the flat spots perceptibly wider than the humps they lie between).
Well, you are correct about the waveforms, and given that I cannot explain what is happening except to say, I would take the resistors out of the equation and try again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
And also "tapping" the AC input b/w two resistors acts as a voltage divider, is that correct? So without them the whole hot circuit will now be at 120V potential?
Sorry but my grasp of this analog stuff is woefully tenuous. I am trying to learn!
PS: Hmm, so it just occurred to me that maybe with the 1M resistor on the DC side the total resistance of the circuit was so high that there simply wasn't enough current to drive the bridge properly? I was thinking of them as two separate equations but really they're not... When I get home I'll look up the specs of the bridge and try to run those numbers. Gah!
Post Edited (Nak) : 12/10/2009 10:52:36 PM GMT
My best advice if you want to experiment with bridge rectifiers and checking the signals coming out of them would be to use a transformer first. Go to Radio Shack (or any electronics supply store) and buy a transformer with a 120VAC primary and a 6V – 12V secondary. Then get a bridge rectifier for it. While you’re at it I would also recommend a couple of inline fuse holders and fuses rated at 1/4A or 250mA. You should connect an AC power cord to the primary side through one fuse and be sure to use electrical tape, or better yet, heat shrink tubing to make sure no live (hot) parts are exposed. On the secondary connect the two outer wires (if there are three, ignore the center tap) to the AC inputs on the bridge. Use the other fuse on either of the secondary lines to provide protection. Now you can test your DC signal coming from the bridge @ low voltage and low current. If you short something you’ll blow a fuse (buy extras). I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
I should know better...