Zero Cross Sensing with PulseIn()

That circuit has some offset, because of the threshold voltage of the BE junction.
And some delay, because the collector won't pull LOW untill there is enough base current.
I think this circuit is designed for mains voltage input (2x 220k resistors).
Leo..

Wawa:
The zero crossing resistor value is too low.
1k is more than the <= 1mA mentioned in post#12.
9volt AC from a transformer could be ~15volt peak, not counting welding spikes.
Change to 10k.
And add two small schottky diodes (post#12) from analogue pin to ground.
Leo..

So the Schottky diodes go in parallel or series to the Analog Pin1 ?

One from pin to ground with the anode to ground.

One from pin to ground with the cathode to ground.

They clamp the AC signal to +0.4volt and -0.4volt.
Leo..

Are these connected as suggested ?

I think you have posted the same image as in post 24. There are no added diodes, and the the resistor is still 1K.

i've just edited it again. It was png that had the new circuit, unfortunately PNG are not allowed i guess so i've added it now.

MrAl:
Hello there,

What do you mean about the rectified wave not being a signal? It is a signal that can provide zero crossing information because it goes to zero at the zero crossing and is positive everywhere else. It also provides for very symmetrical zero cross detection while a pure sine wave does not because there is always a difference between the positive half cycle and negative half cycle detection times.

To easily see the difference, draw a 120v sine wave and a 120v full wave rectified sine wave. Then, draw a 3v horizontal line though both curves and note where it intersects the two curves. Notice that there are two detection points on the sine curve and four on the rectified wave curve (per cycle). Notice that the two for the sine curve are BOTH within the positive half cycle, while for the rectified sine we have the choice of using only the rising edges which occur in DIFFERENT half cycles. With the sine curve we have one point AFTER the rising edge, and one point BEFORE the (absolute value) rising edge, which means they do not occur in the same place for both half cycles, but for the rectified wave and choosing rising edges we see the two points occur at the same time in both half cycles, making it completely symmetrical.

I was also checking on this and found this link. Mentioned by one of the members there "My opinion, to summarize, is that DC or AC is a characteristic of the signal, and digital or analog is a way of "reading" the signal."

It have a max of 2V andit would kind of be like PWM

Kevparang:
It have a max of 2V andit would kind of be like PWM

wasn't clear, could you please explain.

Circuit looks ok now, but I'm affraid I overlooked something.
It will only work with a transformer with a center tap (to ground).
I think you can't get a zero crossing signal from a single transformer winding with bridge rectifier.
Leo..

Wawa:
Circuit looks ok now, but I'm affraid I overlooked something.
It will only work with a transformer with a center tap (to ground).
I think you can't get a zero crossing signal from a single transformer winding with bridge rectifier.
Leo..

So i had placed an order with newark with a trnasformer that does not have the center tap. Could you please provide me a link or part# to the center tap transformer.

from a post here i think without a center tap should work fine. For my info why require a center tap ?

The center tap gives you added safety

Would grounding the center tap be short ?

from a post here i think without a center tap should work fine. For my info why require a center tap ?

In the link you've shown, they call it a zero cross circuit but it actually only creates a pulse based on the sensing levels of the Arduino pin compared with a sine with zero reference near the negative peak ... like this:

A much more accurate way is to make the center line 0V, which can easilly be done by grounding the center tap of an isolated transformer, then using the signal from one of the other taps.

I was looking to do something like that ,sense the zero and fire the SSR at peak but would it possible to know the peak value from the input pin ?

Their he is using the digital pin so how does he do it without getting some values, i mean all that an arduino at digital pin can sense is 1 or a 0. So just by that how can it be used to trigger the optocoupler in his circuit.

In the post you referenced in #38 the circuit is using the AVR application note zero cross detecting scheme which was discussed earlier in this thread.

Based on subsequent discussion, it would appear that using an analog input with the external diode clamps will give you more symmetrical detection points.

I was looking to do something like that ,sense the zero and fire the SSR at peak but would it possible to know the peak value from the input pin ?

No, however by knowing the zero crossing (time = 0ms) the positive peak can be determined (not measured) to be at (time = 5ms) for a 50Hz sine signal.

Their he is using the digital pin so how does he do it without getting some values, i mean all that an arduino at digital pin can sense is 1 or a 0. So just by that how can it be used to trigger the optocoupler in his circuit.

I haven't looked at it closely, but I guess he just uses a delay from one of the edges of the inaccurate "zero-cross" pulse.

What kind of phase accuracy are you looking for?
Perhaps his method is all you need.

dlloyd:
No, however by knowing the zero crossing (time = 0ms) the positive peak can be determined (not measured) to be at (time = 5ms) for a 50Hz sine signal.

So in other words this way to determine it through the analog is better ? as we can get the numbers that just '0' and '1'. Is that correct ?

i was looking for something more of an isolation type transformer but could not find it so thought i'd go with this suggested by the Sales Rep. Datasheet. My Mains are 240v @ 50Hz and the transformer mentioned here is 110V, 220V, 240V. The datasheet does not say how to use it with 240v. I did a little ready and connecting two primary in series would do it.

is that how its done ?