# DIY zero-crossing circuit, how crucial are component values?

I want to build this circuit, taken from here, and I'm wondering exactly how crucial exact component values are.

I don't have any 220k, 22k, or 4.7k resistors. I'm wondering if I can substitute two 100k in series for the 220k, two 10k for the 22k and a 5.1k for the 4.7k. Of course I could do two 100k and two 10k to make the 220k, but that's 4 resistors in place of one. Will the 20k difference make that much of a...difference?

Also the circuit calls for 1n4148 or equivalent diodes. I have 1n4007. Since those are really just to make a bridge rectifier, could I just use a bridge rectifier component, or just substitute the 1n4007 diodes?

Finally, is a 2N2222 an acceptable substitute in this case for a 2N3904?

There's a basic problem with the circuit around the 2N3904 transistor and how it gets biased (more further down)...

For the resistors yes, and given the applied voltages, two in series will likely be better in terms of voltage rating - read the data sheets of the resistors you want to use because voltage rating is important and so is power rating.

For the diodes, possibly (although the reverse turn off time for the 1N400x series is particularly crappy compared to the 1N4148). However, I expect that a 30 us delay isn't going to make a big deal. Also with using the 1N4007 there is zero doubt it can survive the full voltage applied whereas the 1N4148 would not if mis-connected.

The 2N3904 is only rated at 40 volts from collector to emitter but I'm struggling to see how that device works in the circuit so I think you have a basic problem here with the original circuit. I'm struggling with this probably because it's been a long day but do consider simulating it to see if it works or wait for someone to explain away my doubt.

• Comments are not for extended discussion; this conversation has been moved to chat. – Dave Tweed Dec 12 '16 at 12:59

All your suggested substitutions are just fine. There is nothing critical in this circuit except the performance (CTR) of the optoisolator.

• And conveniently, I happen to actually have a few 4n35 optos. – HaLo2FrEeEk Dec 10 '16 at 18:10

Two series resistors for the 220k is just fine, in fact it will improve safety, as you get two times the resistor voltage rating. 200k total will be just fine.

20k for the 22k is fine, as is 4.7k for the 5.1k.

2n2222 has slightly lower gain than 2n3904 at 10mA (75 plays 100), but I doubt the difference will cause a problem.

1N4007 diodes are much slower than 1n4148, this might cause a small time shift in the detected zero crossing, but the circuit should still work.

• You also get twice the resistor power rating as well ;) – Ian Bland Dec 10 '16 at 18:10

I can't see any reason why not. The resistors for instance are just voltage droppers and a current limiter. The 4.7k is a pull up. None of it looks critical.

The circuit should work OK with the substitutions that you propose for the resistors.

1. Two series 100K resistors in place of each 220K.
2. Two series 10K resistors in place of the 22K.
3. Using 5.1K in place of the 4.7K.

The 2N2222 transistor should be just fine in place of the 2N3904.

Replacing the 1N4148 diodes with 1N4007 should work as well but they will be a bit harder to work with because of bigger body size and thicker leads.

So I think you are free to experiment. Just be aware that your result will not be as compact. Also use much care to check your wiring on the mains side and be aware that testing mains attached circuits can be dangerous and requires extreme caution.