Zero crossing detector using 741 IC to measure frequency

Thread Starter

rameshadkri

Joined Mar 14, 2018
12
I want to make a zero crossing detector using 741 IC to measure frequency of the supply (220V). I am using 12 V supply for 7 pin of IC. fig shows the detail but I am not getting 12 V and 0 V as expected. What can be the error?

upload_2018-3-16_12-53-33.png
 

Attachments

Last edited by a moderator:

Alec_t

Joined Sep 17, 2013
10,362
Welcome to AAC.
Your circuit is potentially LETHAL as it has no isolation from mains voltage. Use a transformer to reduce the voltage to a safe level for doing the zero crossing detection. (Incidentally, if you want to measure frequency then you don't really need to detect the actual zero crossing).
The 741 is a poor choice for this circuit because its input common mode voltage range with a 12V single-polarity supply is only about 3V to 9V and you do not have both inputs in that range. You did check the datasheet, didn't you?
 

dl324

Joined Mar 30, 2015
8,904
Welcome to AAC!

Other problems are that the output isn't rail to rail and a comparator would be more appropriate than an opamp.
 

BobaMosfet

Joined Jul 1, 2009
795
A better way to do this is to drop your current to something small, like 1mA. 220K 1/2W resistors can do this. Then pass this through a full-wave bridge. And then use a resistor, bjt, diode, and capacitor to convert the lower-voltage and current levels to something you can push through a 4N35 opto-coupler. Open collector output on the opposite side, with a pull-up to your TTL logic level, and you can then stick your 741 on that to read either a 0V or 5VDC voltage pulse, neatly centered around your A/C signal every time it crosses 0VDC. It's temperature insensitive, and very reliable.
 

Thread Starter

rameshadkri

Joined Mar 14, 2018
12
Can i use MOC3041 optocoupler in place of 4N35 optocoupler as you are suggesting?
 

Thread Starter

rameshadkri

Joined Mar 14, 2018
12
A better way to do this is to drop your current to something small, like 1mA. 220K 1/2W resistors can do this. Then pass this through a full-wave bridge. And then use a resistor, bjt, diode, and capacitor to convert the lower-voltage and current levels to something you can push through a 4N35 opto-coupler. Open collector output on the opposite side, with a pull-up to your TTL logic level, and you can then stick your 741 on that to read either a 0V or 5VDC voltage pulse, neatly centered around your A/C signal every time it crosses 0VDC. It's temperature insensitive, and very reliable.
thank you. Will it be possible for you to provide the circuit of above mentioned arrangement.
 

Thread Starter

rameshadkri

Joined Mar 14, 2018
12
I don't see how, unless the isolated side has a synchronised AC supply for the triac within the optocoupler.
Thank you Alec_t. I am using transformer to drop the voltage and MOC3041 optocoupler. The oscilloscope is now showing the freq of 50 HZ (same as input). I have given a battery supply of 9 V and i am getting the output of 9 V too. But the waveform of the output is sinusoidal. What actually it suggests?
 

Thread Starter

rameshadkri

Joined Mar 14, 2018
12
fig1.jpg fig2.jpg fig1.jpg fig2.jpg
Here is the original article I found for the one I'm referencing (I had to go back and find it)-- and it works really well--

http://www.dextrel.net/diyzerocrosser.htm
Thank you for this help. I have connected the given arrangement (Given in this link) and here is the output (fig 2). But the frequency of the output is 100 Hz (my input is 220V, 50Hz). and peak-peak voltage of output square wave is 4 V (I have given 5 V to the collector terminal using 5V pin and ground pin of my arduino uno through 4.7 k resistor). I expected the output to be of 50 hz though i am not sure about it. What actually should be the o/p voltage(p-p) and frequency ?
once again thanks for your help.
 

BobaMosfet

Joined Jul 1, 2009
795
View attachment 148708 View attachment 148710 View attachment 148708 View attachment 148710

Thank you for this help. I have connected the given arrangement (Given in this link) and here is the output (fig 2). But the frequency of the output is 100 Hz (my input is 220V, 50Hz). and peak-peak voltage of output square wave is 4 V (I have given 5 V to the collector terminal using 5V pin and ground pin of my arduino uno through 4.7 k resistor). I expected the output to be of 50 hz though i am not sure about it. What actually should be the o/p voltage(p-p) and frequency ?
once again thanks for your help.
Per '@Alec_t' - if you have a dual trace oscilloscope, you can use it in instances like this to compare your input wave to your output.

Regarding the 5V output- there are a number of reasons you might not reach 5. Your power-supply isn't delivering 5VDC; your circuit could have a ground-loop; something is allowing too much current to flow, so voltage is collapsing a little, etc.

Unless the signal is shunted to ground by the opto-isolator, your pull-up on the collector should pull to whatever your power-supply is outputting. Make sure you have your input pin on your MCU configured correctly-- and it should have a limiting resistor on it, as it's an input. I would make your pullup a 100K-Ohm resistor- you don't need much current to flow, you just want the voltage held high by weakly enough that the signal can be pulled low to ground when zero is crossed. Your MCU pin should have a 4K7 resistor on it, so that only 1mA of current flows when collector held high.
 
Last edited:

bertus

Joined Apr 5, 2008
20,051
Hello,

@iONic , What is the voltage between Hot and Neutral?
Keep in mind the most mosfets can not have a higher gate voltage than 20 Volts.

Bertus
 

Alec_t

Joined Sep 17, 2013
10,362
In your post #18 circuit the FET body diode is effectively a short circuit between hot and neutral on alternate half cycles.
 
Top