Resistive vs capacitive dropper for 230V AC button sensing

drjohsmith

Joined Dec 13, 2021
1,613
Yes C1, R1 and R5 are rated for mains. C1 is X2 rated, R1 is 500V and R5 is 500V anti-surge. An alternative for R5 is SR1206JR-7W470RL which gives a slightly lower peak current of 700mA. The datasheet also clearly shows the maximum peak pulse power whereas the one for ERJ-P08J391V is very vague about the surge rating.
what about the other parts on the AC side ? they all need to be AC safety rated.
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
what about the other parts on the AC side ? they all need to be AC safety rated.
Why? The voltage across them is clamped by the TVS and they only ever see a few volts. I was planning to use 1206 components for ease of soldering (which are rated for 200V) and of course I'll have a cutout under the optocoupler and proper creepage from the DC side.
 

drjohsmith

Joined Dec 13, 2021
1,613
Why? The voltage across them is clamped by the TVS and they only ever see a few volts. I was planning to use 1206 components for ease of soldering (which are rated for 200V) and of course I'll have a cutout under the optocoupler and proper creepage from the DC side.
And if the TVS fails ,what voltages will they see ?
what power dissipation ..
Your designing something to work reliably , not catch fire when one component fails as all parts eventually will .
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
And if the TVS fails ,what voltages will they see ?
what power dissipation ..
Your designing something to work reliably , not catch fire when one component fails as all parts eventually will .
Ok fair point. What do you recommend? Upgrading to the same 500V anti-surge type of R5, just 500V rated like R1 or something else?
 

drjohsmith

Joined Dec 13, 2021
1,613
Ok fair point. What do you recommend? Upgrading to the same 500V anti-surge type of R5, just 500V rated like R1 or something else?
The parts should be mains voltage safety parts. . there are specific parts designed for just such a project .
Minimum is something that can take your mains maximum voltage.
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
The parts should be mains voltage safety parts. . there are specific parts designed for just such a project .
Minimum is something that can take your mains maximum voltage.
Can you give some examples? I don't understand what failure modes that would require specific parts you are referring to.
 

Pyrex

Joined Feb 16, 2022
504
I've landed on these components and values:
View attachment 366025

The 220nF dropper paired with a 390Ω surge resistor provides a total of 16mA RMS. With the 2.2kΩ shunt included for ghosting immunity, the opto receives 14mA nominal current. R5 dissipates only 0.1W, and 830mA of inrush should be effective for contact wetting. The TVS stays inactive during normal 5.6V peaks but clamps the led current to 25mA in case of surges.
How does it look? Now for the board, hopefully everything fits in the space I have with enough creepage.
The ghost resistor is usually taken as 1 kOhm.

So, let's check those most critical components.

Average current is determined by capacitor, and , right, is 16 mA. So R5 will dissipate 0.1W only. Everything is fine when we calculate steady current.

Now let's check how the components will handle the surge current. We assume that the switch was turned on when the voltage was at its maximum, that is 320 V ( 230 *sqrt 2 , V ) . Peak current is 320/390 =0.82A
Power dissipation on the R5 is I^2 *R =0.82^2*390= 262W.
According to the graph from the datasheet , resistor ERJ-P08xxxx can handle up to 40*Pnom if pulse duration is very short.
40* 0.66W= 26W . 26W and 262W . Not OK.

TVS also needs to be calculated, but since the resistor is not suitable, there is no point in calculating it anymore.

I would advise taking a 1 or 2 W resistor and recalculating again. And, it seems, you will need to take a resistor with a higher resistance.
 

MisterBill2

Joined Jan 23, 2018
27,635
I suggest s eries powerdiode like a 1N4003, and two shunt diodes forward biased across the opto. Also a series resistor, in addition to the series diode. Much cheaper and simpler are my reasons.
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
@Pyrex
Where did you get the 40*Pnom rating? The ERJ-P08J391V datasheet I'm looking at doesn't have a pulse power graph. I might have messed up some numbers before because I've did the calculations again and the 470Ω one, which is comparable and has a graph in the datasheet, (SR1206JR-7W470RL) is also not suitable. Thanks for pointing it out.

So I'm reverting to the initial pick, the 1kΩ AS101AJ0102T4E. At a pulse duration of 220us (the RC charge time), it has a pulse rating of about 800W, around 8 times more than the actual 106W pulse power. Steady state power dissipation is 0.25W, which is also fine. Everything else remains approximately the same.
Similarly, at the same pulse duration of 220us, the SMAJ6.0CA is rated for 700W. It should be fine, do you confirm?

Thanks for the link, it was an interesting read. For this application the X2 one I had seems appropriate to me.

I suggest s eries powerdiode like a 1N4003, and two shunt diodes forward biased across the opto. Also a series resistor, in addition to the series diode. Much cheaper and simpler are my reasons.
It would certainly be cheaper, but the thermal dissipation is the dealbreaker. I don't really mind the complexity, I'm only making 10 boards and my priorities are safety and reliability.
 

MisterBill2

Joined Jan 23, 2018
27,635
Given that for this specific application the button is only going to be pressed for a short length of time, and only a few times a day, it isnot likely that the resistor will ever be heated very much. Likewise, the wasted power will be a very small amount.
CERTAINLY it is important to be aware of the application when making design choices, and just as certain to understand the functioning of the whole system. Certainly I would not have suggested using a resistor if the control had been a maintained closure switch. That would be a different situation entirely.
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
Given that for this specific application the button is only going to be pressed for a short length of time, and only a few times a day, it isnot likely that the resistor will ever be heated very much. Likewise, the wasted power will be a very small amount.
CERTAINLY it is important to be aware of the application when making design choices, and just as certain to understand the functioning of the whole system. Certainly I would not have suggested using a resistor if the control had been a maintained closure switch. That would be a different situation entirely.
Initially I limited the dissipation to 1W, because what if contacts were to get stuck? What if an object is left leaning against one of the buttons? The prototype worked ok. Then I found out about contact oxidation and wetting currents. A friend of mine has a fancy system with buttons and a PLC that was installed less than 10 years ago and you often have to press the button multiple times or very hard to make it actuate. I don't know the specifics of his installation but I suspect it has to do with this. So I wanted to increase the current, which I couldn't do with the resistive dropper because the heat would become too much even during normal operation. Hence the capacitive one. More complex and harder to design, though it seems worth it to me.
 

Pyrex

Joined Feb 16, 2022
504
@Pyrex
Where did you get the 40*Pnom rating? The ERJ-P08J391V datasheet I'm looking at doesn't have a pulse power graph. I might have messed up some numbers before because I've did the calculations again and the 470Ω one, which is comparable and has a graph in the datasheet, (SR1206JR-7W470RL) is also not suitable. Thanks for pointing it out.

So I'm reverting to the initial pick, the 1kΩ AS101AJ0102T4E. At a pulse duration of 220us (the RC charge time), it has a pulse rating of about 800W, around 8 times more than the actual 106W pulse power. Steady state power dissipation is 0.25W, which is also fine. Everything else remains approximately the same.
Similarly, at the same pulse duration of 220us, the SMAJ6.0CA is rated for 700W. It should be fine, do you confirm?


Thanks for the link, it was an interesting read. For this application the X2 one I had seems appropriate to me.


It would certainly be cheaper, but the thermal dissipation is the dealbreaker. I don't really mind the complexity, I'm only making 10 boards and my priorities are safety and reliability.
The datasheet you found is not the only one:

Datasheet.Directory: Sale ERJ-P08J391V - Global Supply Chains, Offer Electronic Components, Industrial Automation, Process Automation.

Concerning the TVS, everything is OK
 

MisterBill2

Joined Jan 23, 2018
27,635
Now I see that there will be multiple pushbutons around a room, used to control the lighting.
Stop and consider that the mains power will be present on one side of each of the buttons, and that means that all of the electrical codes requirements need to be followed for the wiring to and from the buttons. THAT is a BIG DEAL, really! I see that the buttons are intended to be types suitable for 120 volt circuits, which is correct for this application. BUT, consider that the plan already includes opto-isolators, it would be simple to use an isolated 6 volt or 12 volt source to power the button side of the system, which would allow the use of "Class C wiring", which is a whole lot simpler and less expensive, and does not carry any shock hazard at all.
In addition, it will allow the selection of the button types from a vastly wider array of choices. AND, the only design changes would be to the series resistor value.
 

MrAl

Joined Jun 17, 2014
13,716
I've landed on these components and values:
View attachment 366025

The 220nF dropper paired with a 390Ω surge resistor provides a total of 16mA RMS. With the 2.2kΩ shunt included for ghosting immunity, the opto receives 14mA nominal current. R5 dissipates only 0.1W, and 830mA of inrush should be effective for contact wetting. The TVS stays inactive during normal 5.6V peaks but clamps the led current to 25mA in case of surges.
How does it look? Now for the board, hopefully everything fits in the space I have with enough creepage.
Hi,

That actually looks like a very reasonable design.
The surge device is very robust from what I gather, and the two LED currents do not need to be very high for a 10k pullup to 3.3v. In fact, you can probably get away with as little as 2ma LED current for that arrangement and still get a pull down to around 0.4v I think, but you can check the data sheet for the 814 opto and check the CTR around 2ma LED current.

What is BTN connected to exactly (especially with attention to impedance to ground) ?
 

MisterBill2

Joined Jan 23, 2018
27,635
Certainly the load connected to the output is rather important. With the pull-up resistance being 11K ohms to only 3.3 volts, that is not very much power available to any load other than CMOS logic. That small a signal would not operate any of the most common solid state relays, even.
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
I appreciate everyone's feedback!

Concerning the TVS, everything is OK
That actually looks like a very reasonable design.
Great! So this is were we are at:
schematic.png

What is BTN connected to exactly (especially with attention to impedance to ground) ?
Certainly the load connected to the output is rather important. With the pull-up resistance being 11K ohms to only 3.3 volts, that is not very much power available to any load other than CMOS logic. That small a signal would not operate any of the most common solid state relays, even.
BTN is connected to a GPIO on the RP2040 so the opto is only driving a logic level signal. The board will interpret the button presses, dim the led strips accordingly, handle RS485 communication to a central node, etc.

The surge device is very robust from what I gather, and the two LED currents do not need to be very high for a 10k pullup to 3.3v. In fact, you can probably get away with as little as 2ma LED current for that arrangement and still get a pull down to around 0.4v I think, but you can check the data sheet for the 814 opto and check the CTR around 2ma LED current.
No one has really addressed this so far, so I'll re-state again: using higher currents is intentional to hopefully clear oxidation on the contacts. I'm worried that running just a few mA though the wall buttons, which don't have gold plated contacts, would make them unreliable in the future. As far as I'm aware the manufacturer doesn't have specific ones for SELV systems.

Now I see that there will be multiple pushbutons around a room, used to control the lighting.
Stop and consider that the mains power will be present on one side of each of the buttons, and that means that all of the electrical codes requirements need to be followed for the wiring to and from the buttons. THAT is a BIG DEAL, really! I see that the buttons are intended to be types suitable for 120 volt circuits, which is correct for this application. BUT, consider that the plan already includes opto-isolators, it would be simple to use an isolated 6 volt or 12 volt source to power the button side of the system, which would allow the use of "Class C wiring", which is a whole lot simpler and less expensive, and does not carry any shock hazard at all.
In addition, it will allow the selection of the button types from a vastly wider array of choices. AND, the only design changes would be to the series resistor value.
My electrician recommended and wired the whole house already with 1.5mm² cable. It's simpler, abeit slightly more expensive, and if I sell the house or want to revert to standard AC lighting most of the wiring is already there. Also the series of sockets we installed doesn't have buttons suitable for SELV systems as far as I can tell. So I accepted the tradeoff and adapted the design of my board. I agree 12V signals for example would have been much easier to work with, but for the stated reasons I decided against it.
 
Last edited:

ronsimpson

Joined Oct 7, 2019
4,704
R1 & R5 need to be rated for 500V. Many surface mount parts have low voltage ratings. I use two resistors in series or pick a "HV" resistor.
I would not have R3. It steels some power from OP1.
I do not see the need for R2 or D1. I know you want protection from high voltage, but it is not important. I will explain. C1 sets the LED current to about 20mA. If the power sent from 0V to 300V in 10nS, the current would be high because at 10nS C1 is a short. The 300V will be across R5, 1k. That will limit the current to 300mA. The PC814 is rated for 1A peak. If you are worried about peak current at turn on, you might increase R5 to 2.2k or more.
o1776456708296.png
I do not have R6.

Right now, you are using OP1 at 20mA. The transistor out pins 3,4 can handle 22mA in this mode. If you made C1=22nF (R5=10k) the LED current will be 2mA which will drive the transistor to 1.4mA. This will save you money on C1.
 

Thread Starter

AleMonti

Joined Aug 11, 2024
30
R1 & R5 need to be rated for 500V. Many surface mount parts have low voltage ratings. I use two resistors in series or pick a "HV" resistor.
R1 and R5 are indeed rated for 500V. R5 is 1.5W and also anti-surge (800W rating with a pulse of 220us).

I would not have R3. It steels some power from OP1.
R3 was intentionally added to steal power from the opto for better ghosting immunity. The forward current is overkill anyway to drive the logic on the DC side. Again, high current is on purpose as explained below.

I do not see the need for R2 or D1. I know you want protection from high voltage, but it is not important. I will explain. C1 sets the LED current to about 20mA. If the power sent from 0V to 300V in 10nS, the current would be high because at 10nS C1 is a short. The 300V will be across R5, 1k. That will limit the current to 300mA. The PC814 is rated for 1A peak. If you are worried about peak current at turn on, you might increase R5 to 2.2k or more.
This is what I thought initially too. Other users recommended to add them to clamp the current through the led. Even if not strictly required, I would keep them to lower the stress on the opto and make the board more reliable. I'm only manufacturing 10 boards, the price difference is negligible.

Right now, you are using OP1 at 20mA. The transistor out pins 3,4 can handle 22mA in this mode. If you made C1=22nF (R5=10k) the LED current will be 2mA which will drive the transistor to 1.4mA. This will save you money on C1.
If I wanted to make the forward current 2mA I would just use a single 100k resistor in series with the opto. The whole point was having higher currents in order to reduce the risk of oxidation on the button's contacts.
 
Top