Odd behaviour of the circuit

Thread Starter

seanstevens

Joined Sep 22, 2009
213
Hi All,

I have a mains circuit that seems to have an odd behaviour. As you can see the circuit below is a non-isolated AC power supply (AC230 to 24VDC to 5V PIC). It supplies a PIC that generates 3 tones based on its I/O logic fed by C & D on the output of the optos. The PIC has a transistor-assisted 5v zener regulator fed from the 24VDC generated by the circuit below, a single transistor is used to amplify the tones coming from the PIC.

When you power up the circuit the PIC generates the default tone 1, at the same time, if you connect the mains live to S2 or S3 it should change the tone to 2 or 3 depending on if you feed it to S2 or S3. The voltage on C & D is either 4.7V or 0.18V depending on the input of S2 & S3.

Everything works great up to here and is expected, however, if you connect Earth or neutral to either S2 or S3 it will activate tones 2 & 3 when it shouldn't as the design is for mains live to switch stages, not Earth or neutral. I don't understand why this is happening, I can only guess there is some kind of a phase change somewhere. Measuring the voltage between neutral and Earth, its 0.6VAC

Appreciate any input.

1694784849109.png
 

ElectricSpidey

Joined Dec 2, 2017
2,594
If you apply line to the opto then current will flow from line to neutral thru the bridge and the opto.

If you apply neutral to the opto then current will flow from neutral to line thru the bridge and the opto.
 

MisterBill2

Joined Jan 23, 2018
15,689
The reason that connecting to neutral triggers the tone is because the mains neutral is not the common for the input circuit. See also post #5.
What is the purpose of the circuit? What is the intended application???
 
Last edited:

Ian0

Joined Aug 7, 2020
8,403
Rectified mains negative is not the same as neutral. When the top left and bottom right diodes of the bridge conduct, rectified mains positive is at neutral potential and rectified mains negative is at -325V with respect to neutral.
Assuming neutral is at earth potential, connecting S2 to earth, will put -325V peak across the opto/resistor and switch on the opto half-wave.
 

Thread Starter

seanstevens

Joined Sep 22, 2009
213
Hi All, sorry for the delay in responding.
Thank you all for your comments. I dont understand why another project that uses the same exact non-isolated mains power supply works without issues, although I havent actually tried to feed in Earth to see if does the same thing but its a product that has been out there for 12 years and no one has reported such odd operation.

Is there a possible remedy for this?
@MisterBill2 The intended application is a sounder with a default tone when powered and the default tone changes to other specific tones when S2 or S3 is activated via live.

I will do some more test and update.
 

MisterBill2

Joined Jan 23, 2018
15,689
The simplest fix would be to remove the bridge rectifier and have a single diode between the fuse and the filter choke L2. Then extend the neutral connection to the line that has a ground symbol at the opposite end.
The same results can be produced by disconnecting the bottom and left corner wires from the bridge and connecting them together. Possibly easier to implement.
 

MisterBill2

Joined Jan 23, 2018
15,689
Can't you just connect pin 1 of the optos to neutral?
That would still leave the "common" side of the circuit at a potentially dangerous voltage. At some point safety should be considered.
A year ago this circuit would not have even been allowed on his site.
 

Ian0

Joined Aug 7, 2020
8,403
That would still leave the "common" side of the circuit at a potentially dangerous voltage. At some point safety should be considered.
What do you regard as the "common". If it is the node with the earth symbol, then that is already at half-wave rectified -325V.
A year ago this circuit would not have even been allowed on his site.
Along with every mains-operated switched-mode supply!
 

nsaspook

Joined Aug 27, 2009
11,786
...
Along with every mains-operated switched-mode supply!
That's a bit of an exaggeration. Most commercial mains-operated devices with switched-mode supplies have galvanic isolation unless they meet specific application requirements like devices that don’t need to be directly touched by the user with proper isolation and insulation.
 

Ian0

Joined Aug 7, 2020
8,403
That's a bit of an exaggeration. Most commercial mains-operated devices with switched-mode supplies have galvanic isolation unless they meet specific application requirements like devices that don’t need to be directly touched by the user with proper isolation and insulation.
If I remember correctly (perhaps I don't) the prohibition applied to any circuit that was directly connected to mains-live, and that would include the front end of a flyback converter.
 

Thread Starter

seanstevens

Joined Sep 22, 2009
213
@Tonyr1084 This is happening at a couple of different locations here in the UK and Germany, so no, neutral reversal is not the issue.

By the way, the other product I mentioned that has been out there for 12 years does exactly the same thing, however, the product usage does not allow Earth to be used as a switching signal, so the user complaining is the first in 4 years, they are just not following the instructions, but that is a different story - as we know, the customer is always right!

@ MisterBill2 That sounds simple, but I am not sure how that would affect the sounder, changing from full bridge to single diode, may not provide enough voltage/current/ripple etc. See the application circuit from the datasheet attached. I found the suggestion of using a bridge rectifier in another application note from the manufacturer.

@Ian0 Yes I suppose so, thats simple enough I guess. However, I dont understand @MisterBill2 concern about leaving the 'common' side at high voltage.

1695066686319.png
 

nsaspook

Joined Aug 27, 2009
11,786
If I remember correctly (perhaps I don't) the prohibition applied to any circuit that was directly connected to mains-live, and that would include the front end of a flyback converter.
Ask a MOD.
May 28, 2019
https://forum.allaboutcircuits.com/threads/why-should-i-isolate-my-power-supply.160217/post-1397224

MOD:
Posts discussing mains powered, non isolated power supplies are not allowed.
https://en.wikipedia.org/wiki/Flyback_converter
The flyback converter is used in both AC/DC, and DC/DC conversion with galvanic isolation between the input and any outputs.

1695070573488.png
 

MisterBill2

Joined Jan 23, 2018
15,689
What do you regard as the "common". If it is the node with the earth symbol, then that is already at half-wave rectified -325V.

Along with every mains-operated switched-mode supply!
NO, it is not "half wave rectified", it is fed by a full wave bridge rectifier.
@Tonyr1084 This is happening at a couple of different locations here in the UK and Germany, so no, neutral reversal is not the issue.

By the way, the other product I mentioned that has been out there for 12 years does exactly the same thing, however, the product usage does not allow Earth to be used as a switching signal, so the user complaining is the first in 4 years, they are just not following the instructions, but that is a different story - as we know, the customer is always right!

@ MisterBill2 That sounds simple, but I am not sure how that would affect the sounder, changing from full bridge to single diode, may not provide enough voltage/current/ripple etc. See the application circuit from the datasheet attached. I found the suggestion of using a bridge rectifier in another application note from the manufacturer.

@Ian0 Yes I suppose so, thats simple enough I guess. However, I dont understand @MisterBill2 concern about leaving the 'common' side at high voltage.

View attachment 303084
My concern is that the "ground" symbol implies a frame attachment, at least in the common usage in my area.
And the bad news is that connecting mains voltage to an equipment frame tends to create a shock hazard. A hazard with a high enough voltage and a low enough resistance that delivery of a lethal shock is easily possible.
And the addition of diode D4 does nothing to reduce that hazard.
 

Ian0

Joined Aug 7, 2020
8,403
NO, it is not "half wave rectified", it is fed by a full wave bridge rectifier.
I might not have been clear here. If you measure between the point with the earth symbol (which I'm taking to mean nothing other than "circuit 0V") and either neutral or earth (which I'm assuming to be connected together somewhere) then you will see a half-wave rectified waveform at -325V peak.Screenshot from 2023-09-19 06-04-43.png
 

Thread Starter

seanstevens

Joined Sep 22, 2009
213
@MisterBill2 Certainly a valid concern, however, the Vss symbol is only the circuits 0v, the unit is housed in an ABS housing with lots of warnings and the usage is in an industrial environment (not that matters), the safety is there. By the way, EE terminal is local Earth parking only inside the unit.

@Ian0 Yes, it is circuit common 0v. I just measured using a multimeter set to AC between neutral and Vss (pin 1 opto) and I got 105VAC. The same thing set to DC, I get -112VDC or 123VDC depending on the prob's polarity position. Doesnt seem to match your calculation, or have I measured it wrong, or do I need to use a scope to measure the peak - By the way my scope is fully isolated.

This issue is only caused by a particular customer feeding the wrong signal i.e. Earth into the S2/3, its not a big deal, but I am just curious if the design can be possibly improved in the future. At the moment modifications are not allowed due to specific certifications but certain customers can ask for special units that do not require approvals.
 

Ian0

Joined Aug 7, 2020
8,403
@Ian0 Yes, it is circuit common 0v. I just measured using a multimeter set to AC between neutral and Vss (pin 1 opto) and I got 105VAC. The same thing set to DC, I get -112VDC or 123VDC depending on the prob's polarity position. Doesnt seem to match your calculation, or have I measured it wrong, or do I need to use a scope to measure the peak - By the way my scope is fully isolated.

This issue is only caused by a particular customer feeding the wrong signal i.e. Earth into the S2/3, its not a big deal, but I am just curious if the design can be possibly improved in the future. At the moment modifications are not allowed due to specific certifications but certain customers can ask for special units that do not require approvals.
Your meter will read average DC or rms.
If it reads average DC then the average will be peak/(2√2) =115V

If you connect between S2 and mains live, you will also get a half-wave signal, the same as if you connect between S2 and neutral.
I still think that the opto pin1 should go to neutral.
 
Top