Detecting 230vac Zero crossing point without Opto-coupler

Thread Starter

Alextrical

Joined May 5, 2022
18
Good evening all

I'm currently trying to design a 230v 6x bulb light fixture, and would like to detect the zero crossing point, and also the presence of 230v on another input.

Previously I have been using the following schematic for both purposes, however there is noticeable lag when detecting presence of 230vac (~250ms-400ms)
Live presence detector.png

As the design I'm using is removing the galvanic isolation (as the circuit will be fully enclosed in the light fixture, and needs to save some space) I was wondering if anyone could advise on the best practice going forwards to detect Zero crossing, or presence of 230vac, while reducing standby current of 2 zero crossing detectors per fixture.

Something similar to this/ this looks almost ideal for a Zero crossing detector, but still only provides one part of the two inputs I'm looking for.


Looking through the forum I came across a response from ericgibbs (not that I can find the link now) showed using a LM293
behind a transformer, however is it possible to use a voltage divider instead without damaging the comparitor? Like fig31 in the data sheet.

Something similar to this?
Screenshot from 2022-05-05 21-15-46.png

Thanks in advance for any advice
 

Thread Starter

Alextrical

Joined May 5, 2022
18
Alternately you could connect a small Schottky diode from the LM393 input to the V3 voltage to protect the LM393.
Would this be similar to what you are recommending? (ignoring R6 & R7) If it being clamped with a Schottky diode to the 3.3v rail, then I take it i can replace the Zenner with a Signal diode?

The voltage in at the '-' terminal drops below the 0V rail bu ~0.6v, is this OK for a compactor, and if so is it safe to pull the '+' to circuit ground? (like shown below)
Screenshot from 2022-05-06 09-29-36.png
 

Thread Starter

Alextrical

Joined May 5, 2022
18
schottky
May be this circuit (no lag) can be used, with or without optocoupler:
I will give it a go in the sim and see how it works for my use case, It my not be ideal for this current project, but i will defenetly keep that schematic in mind for future projects than need isolation

How your bulbs are controlled? By pots?
The intended output will be 6x BT131-600 triacs controlled at logic level from a ESP8266 running ESP-Home as its firmware,
as the triacs are logic level I can (hopefully) do this without using Opto's with a 3v signal from the ESP, this will also help save as much space on the PCB as possible.
 

MisterBill2

Joined Jan 23, 2018
18,477
Really, the long delay from the circuit in the first post is caused by the capacitor. So just the bridge rectifier and current limiting resistor will provide the opto isolator with consistent triggering with a very small delay. The output delay will consist of the time it takes for the opto to switch off as it's forward bias drops below the switching level. That will tend to compensate for the fact that it happens a bit before the exact zero crossing. If it is close enough for your application the benefit is a much simpler circuit.
 

Ian0

Joined Aug 7, 2020
9,808
Are you using a microcontroller? If there is no isolation, I presume that either its Vdd or Vss is common with mains live. (If you are driving triacs, it should be Vdd)
If so, connect any input to neutral through a large >1MΩ resistor.
If you want to be really economical with components, you don’t need to do anything else - the internal protection diodes as usually good for 10mA; but a couple of BTA42 diodes from the input to Vdd and from the input to Vss wouldn’t go amiss, and would remove any possibility of latch-up.

when it comes to detecting the second supply, you really do need some isolation, just in case the two supplies don’t share the same live or the same neutral, or the second supply could get connected with live and neutral reversed - you could easily get 400V where you don’t want it, if the two lives are from different phases.
 

Thread Starter

Alextrical

Joined May 5, 2022
18
Are you using a microcontroller? If there is no isolation, I presume that either its Vdd or Vss is common with mains live.
Yes, I'm using a ESP8266, with AC Live connected to Vss. Power supply will be 3.3v above Live to drive the BT131-600 triacs in their optimal quadrant. (hopefully) I can attach a schematic here or is it better to create a new post at this point?

The inputs I'm detecting are from the same single domestic phase, with the intent that one is used for detecting the Zero cross point, and the other is used for detecting a light switch state (ideally using 230V AC for compatibility with legacy in wall wiring)

Good point with using the resistors connected directly to an input pin, I'm guessing something like this is what you are suggesting? Though that would presumably add a delay to the detection of the ZC until the voltage goes above 2.475v or below 0.825 on the ESP8266 pins

As for the triacs I'm planning to drive them with the circuit listed in Figure 3a found here, but replacing the N connection with Live, as this should hopefully allow high side switching of the light fixture.
 

Ian0

Joined Aug 7, 2020
9,808
Connect Vdd to live so that Vss is 3.3v below live. Triacs don‘t trigger well (some don’t trigger at all) with the gate positive and MT2 negative, but they all trigger properly with the gate negative.
I‘d definitely use an opto to detect the switch, you can’t trust the house wiring not to have live and neutral reversed, to be switched on the neutral etc. Use and AC input opto driven with a small class X capacitor and a current limiting resistor - you don’t need any phase information from it.
A small cap across the opto will give a reliable logic output: Vss for mains present, Vcc for mains absent.
Don‘t worry about the 2.5V offset it only makes 25μs difference on the zero-crossing, and you need at least 500μs with no trigger around zero-crossing to make sure the triac turns off.
 

Thread Starter

Alextrical

Joined May 5, 2022
18
Comparison of two circuits. (Continuation)
Dependencies V(out) on V(L, N) and on Temperature:
View attachment 266791_____View attachment 266792
Wow, really nice analysis. Is that LTspice with temperature models, I had no idea it could do that.
As the circuits I'm making will most likely be used on 230V only, the input limiting resistors can be increased and the Caps can be reduced to optimize it for the higher voltages. From the rough tests I've done, it looks like you can get your left circuit down to ~116uA RMS by replacing R1,2,4&5 with 1Meg, R3 with 100K, C1 with 100n and C2 with 100p
 

Thread Starter

Alextrical

Joined May 5, 2022
18
Connect Vdd to live so that Vss is 3.3v below live. Triacs don‘t trigger well (some don’t trigger at all) with the gate positive and MT2 negative, but they all trigger properly with the gate negative.
I will make the alterations to the the lighting circuit based on your advice, I'm guessing that was quadrant 4, and your suggestion is for quadrant 1 conduction? (sorry it seems I haven't got my head around the Triac quadrants yet)

I will post a schematic of the light controller shortly once I make the amendments.
 

Thread Starter

Alextrical

Joined May 5, 2022
18
Connect Vdd to live so that Vss is 3.3v below live. Triacs don‘t trigger well (some don’t trigger at all) with the gate positive and MT2 negative, but they all trigger properly with the gate negative.
Just to confirm you mean using the circuit connected to Load2? Screenshot from 2022-05-10 19-46-48.png
 

Ian0

Joined Aug 7, 2020
9,808
Just to confirm you mean using the circuit connected to Load2? View attachment 266875
Exactly. You can see from the datasheet that the triggering current is higher in Q4
https://docs.rs-online.com/fd79/0900766b80b4bf31.pdf
If you always trigger triacs with negative gate current, you never need worry which quadrant is which.
Another thing - no capacitors on the gate - you don't want anything to slow the gate down.
The BT134 needs a lot of gate current, you can get triacs (BTA08-6000TW, for instance) that will trigger at 5mA.
If you are going to use the BT134, make sure that your driving circuit can deliver 35mA.
 

Danko

Joined Nov 22, 2017
1,834
Wow, really nice analysis. Is that LTspice with temperature models, I had no idea it could do that.
As the circuits I'm making will most likely be used on 230V only, the input limiting resistors can be increased and the Caps can be reduced to optimize it for the higher voltages. From the rough tests I've done, it looks like you can get your left circuit down to ~116uA RMS by replacing R1,2,4&5 with 1Meg, R3 with 100K, C1 with 100n and C2 with 100p
R6 value is changed, because voltage on C1 decreased, but amplitude of optocouple LED current should be still about 40 mA.
Before temperature analysis remove semicolon from SPICE directive.
1652259646616.png_____1652329060892.png
ADDED:
So, "energy-saving" variant of circuit has almost 50 times lower termostability.
 

Attachments

Last edited:
Top