Author Topic: Switching mains AC power with small switch  (Read 1512 times)

0 Members and 1 Guest are viewing this topic.

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #25 on: June 29, 2024, 06:54:47 pm »
hmmm, this way the rectifier diode will have some drop before going to the SSR circuit. so can i let the diode be before the zener? so that the zener delivers final regulated voltage.

if not, then i will just assume it is gonna be 3.3v - 0.6v = 2.7v and use another resistor value. this time for 2.7v input voltage and roughly 19-20 mA it will be 75 ohms instead of 100-120 ohms.

also using the 75 ohms as inrush protection resistor in your circuit, if it is not gonna mess it up. this one seems fine: https://www.lcsc.com/product-detail/Chip-Resistor-Surface-Mount_PANASONIC-ERJP06F75R0V_C441974.html

what is your opinion on this?

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5105
  • Country: ro
  • .
Re: Switching mains AC power with small switch
« Reply #26 on: June 29, 2024, 08:23:38 pm »
Look at rocker switches : https://www.digikey.com/en/products/filter/rocker-switches/195

Use heatshrink to insulate any exposed metal bits.

As for fuses, no you wouldn't use fuses with such low current rating, shocking you even have to ask stuff like this. Power supplies have inrush current, they'll pull some current when they're plugged in. Wouldn't use anything less than 100-200mA fuse.

Example :  https://www.digikey.com/en/products/detail/adam-tech/SW-R3-1A-A-1-0/15284400   - 13mm by 9 mm cutout.


There's high voltage regulators like microchip lr8  :  https://www.digikey.com/en/products/detail/adam-tech/SW-R3-1A-A-1-0/15284400
 
ac in -> diode for half wave rectification -> capacitor (4.7-10uF 400v+ should be plenty) -> regulator -> output 24v or 48v -> mechanical relay

But the voltage would still not be isolated so whatever button you use would still have to be isolated, so just waste of components, just as unsafe as straight using ac rocker switch.

Anyway... I'm reluctant to give you advice because of your approach at making these things ... I'm not even sure you can be bothered to get a few of them in your hands to test them, you just  order the pcb and have it assembled by JLC or whatever and dropship directly to customer without being physically involved.

not cool.
« Last Edit: June 29, 2024, 08:35:18 pm by mariush »
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #27 on: June 29, 2024, 08:37:46 pm »
Look at rocker switches : https://www.digikey.com/en/products/filter/rocker-switches/195

Use heatshrink to insulate any exposed metal bits.

As for fuses, no you wouldn't use fuses with such low current rating, shocking you even have to ask stuff like this. Power supplies have inrush current, they'll pull some current when they're plugged in. Wouldn't use anything less than 100-200mA fuse.

Example :  https://www.digikey.com/en/products/detail/adam-tech/SW-R3-1A-A-1-0/15284400   - 13mm by 9 mm cutout.



rocker switches can't work. the PS1 has plastic switch on top shelf which pushes the button switch. this one is the one i need to choose and make a circuit for. rocker switches can't work here as you see.

i will use resistors to limit inrush currents for sure, i said it above i believe.

Quote
Anyway... I'm reluctant to give you advice because of your approach at making these things ... I'm not even sure you can be bothered to get a few of them in your hands to test them, you just  order the pcb and have it assembled by JLC or whatever and dropship directly to customer without being physically involved.

you thought wrong.

in my current product which is a psu for dreamcast, I got units and tested it a lot, then sent it to a friend who is more experienced with power supplies to further test and take readings...etc. after verification that everything works as intended.... I start batch manufacture at pcbway and ship to customers.

i would love to hand test ALL units myself, even hundreds of them but getting them delivered to me will ruin everything as the customs and imports will be too much. However, I do not ship a design until I test it to death and verify it works exactly as i need... which is what happened with my first and second products (www.thundertronics.net).

in this one, i am trying to find nice solution then I will make one to test as mentioned.....etc THEN I will make and sell.

where did you find that I ship products without testing first? if I said it, I need to watch my words to be reflective of what i do

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #28 on: June 29, 2024, 08:43:51 pm »
Quote
There's high voltage regulators like microchip lr8  :  https://www.digikey.com/en/products/detail/adam-tech/SW-R3-1A-A-1-0/15284400
 
ac in -> diode for half wave rectification -> capacitor (4.7-10uF 400v+ should be plenty) -> regulator -> output 24v or 48v -> mechanical relay

i was about to write this myself! this was kinda my last resort since it is expensive and must be purchased from digikey not lcsc.

i prefer not using mechanical relays in case i can use something else....looks like LR8 can deliver really small voltage but also just 10 mA of current, with 30 mA max limit. looks like 10mA is the rated one, dunno if it is gonna be enough for the relay.

edit: datasheet of ssr mentions led trigger current of 10 ma, while above mentions Ir=20 ma for led dropout of 1.21v. so I assume the 10mA are enough to trigger the output as with other similar parts such as Sharp
PR39MF51NSLH
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6081
  • Country: es
Re: Switching mains AC power with small switch
« Reply #29 on: June 29, 2024, 09:57:26 pm »
Quote
then i can use that high voltage dc and step it down + regulate it to be able to supply the necessary voltage to SSR right?
I think DavidAlfa means to power device from this voltage directly, without any SSR
Exactly, powering the entire psu.
Of course you need a smps for the isolation and secondary voltages.

May I ask why are you making this, when you can get cheap modules off AliExpress/eBay?
« Last Edit: June 29, 2024, 10:00:48 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #30 on: June 29, 2024, 10:29:41 pm »
Quote
then i can use that high voltage dc and step it down + regulate it to be able to supply the necessary voltage to SSR right?
I think DavidAlfa means to power device from this voltage directly, without any SSR
Exactly, powering the entire psu.
Of course you need a smps for the isolation and secondary voltages.

May I ask why are you making this, when you can get cheap modules off AliExpress/eBay?

now I don't understand what you meant.

take a look at my product here: https://thundertronics.net/product/dreamcast-universal-power-supply/

it is for sega dreamcast, i finished designing one for sega saturn... this one i am asking for is for sony playstation 1. PS1 has power switch which activates the 2 DC rails 8v and 3.5v, thus when you plug it, it is live and consumes power even if device is off.

i want to make it better by completely turning it off when the power button switch is not pressed.

in ALL of my PSU designs I use professional power modules from Recom and now from Meanwell. no cheap modules or so. the rest of the circuit is my own doing.

these professional aftermarket PSUs for old consoles are highly required, I made just 40 units and sold in less than 2 days and have over 80 subscribers to website alone + 2 distributors all demanding new stock.

the idea behind the current circuit we discuss is to deliver AC voltage to the AC-DC power module... instead of the AC-DC module being connected (and active) all the time, that is all.

_______________


On another thought process, I remember I could use MOC opto-coupler with a good TRIAC for this, which is a replica of the solid-state relay if the later is harder to get.

this still needs some form of AC voltage step down and regulation. SSR are kinda affordable and can be replaced if one is not stocked... for example:

https://www.lcsc.com/product-detail/Solid-State-Relay-Thyristor-Output_Everlight-Elec-ELR0223_C367224.html
https://www.lcsc.com/product-detail/Solid-State-Relay-Thyristor-Output_Lite-On-LTV-0223_C2918480.html
https://www.lcsc.com/product-detail/Solid-State-Relay-Thyristor-Output_PANASONIC-AQH0223_C719685.html

all these are pin-to-pin compatible.... Lite-on is very cheap, so is Everlight. Panasonic is obviously more expensive. All should work with 10mA current. I never used lite-on or everlight brands so i don't know if they are reliable.


Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6081
  • Country: es
Re: Switching mains AC power with small switch
« Reply #31 on: June 30, 2024, 01:22:03 am »
It's exactly that, it cuts power to the primary side of the DC/DC module.

Edit: Ah, it's a not DC/DC, but AC/DC module,!
Well, not very different, you can make an AC switch with two mosfets.

The gates are charged only in the positive cycle, so a small 100nF cap is needed to retain some power.
When the switch opens, power remains only for 100-200ms.

Don't even think on using 08050, 0603 or 0402 for R3, must be rated for 400V+, better to use 5x 220K resistors in series, use large size (1206) or through hole!
Otherwiseit might arc over the resistor, thus unsafe. The rest is low voltage so no problem.

The IRF840 is overkill here, anything capable 2-3A continuous is more than enough for these small PSUs - Do some research!

« Last Edit: June 30, 2024, 01:59:18 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #32 on: June 30, 2024, 05:36:57 am »
It's exactly that, it cuts power to the primary side of the DC/DC module.

Edit: Ah, it's a not DC/DC, but AC/DC module,!
Well, not very different, you can make an AC switch with two mosfets.

The gates are charged only in the positive cycle, so a small 100nF cap is needed to retain some power.
When the switch opens, power remains only for 100-200ms.

Don't even think on using 08050, 0603 or 0402 for R3, must be rated for 400V+, better to use 5x 220K resistors in series, use large size (1206) or through hole!
Otherwiseit might arc over the resistor, thus unsafe. The rest is low voltage so no problem.

The IRF840 is overkill here, anything capable 2-3A continuous is more than enough for these small PSUs - Do some research!

(Attachment Link)

last circuit you posted kinda felt like it was for cutting off the entire circuit but you put positive and negative terminals and one mosfet... this confused me since i mentioned lots of times that my target is ac not dc. good thing now it is clear for both.

i mentioned before that i did an ac switch circuit before (was for ATS) and it used MOC + Triac not dual mosfets. seeing a mosfet immediately gives me the signal it is a dc circuit for some reason. :box:

so instead of the 2 mosfets can't i just use a simple triac? like for not depending on the capacitor charge but rather continuously connected current. I attached a simple circuit drawn roughly in mspaint since i am away from my pc.

my old ATS circuit had to use MOC opto-coupler since it was controller by MCU. this time I don't need that since I do have a physical button. so since the button is a switch then triac will keep working until switch is switched off, i remember this is called natural commutation. i.e, no need for special off circuit since ac voltage itself reaches 0 and goes negative each cycle... thus if you want triac to be on you have to keep supplying ac voltage to it and if you want it off then you release the ac voltage off its gate. this is exactly my case.



I found lots of good triacs available, cheap and more than powerful enough.

Here is a very simple simulation to prove the idea. It shows a complete off status as needed. but i have to say that ssr seems more robust and guaranteed.

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #33 on: June 30, 2024, 06:53:51 am »
If the triac route is not best suited... then we revert back to using dc control.

so if LR8 won't deliver enough current, I found AL17050 (and similar ICs) to be able to do the job. It has to be paired with a SSR as mentioned.

AL17050 uses very cheap inductors but requires high voltage elec. caps, of such LR8 also requires at its input.

price-wise don't know if LR8 is gonna be cheaper than AL17050 solution with its extra components. al17050 will provide more than enough current for sure. LNK305 is another solid choice

from digikey LR8N8-G is about 0.63$ at 100 quantity while in lcsc it is 0.3$ but in lcsc it seems not in-stock. pair it with 0.2$ bridge rectifier from LCSC and it will be around 0.8-1$.

AL17050 from lcsc is about 0.3$ without external components. inductors are about say 0.3$, diodes and resistors can be 0.3$ = nearly 1$.

for 5v using lr8 and about 270 ohms series resistor to the ssr, it will allow 14 ma of current.

going with capacitor dropper could be a bit cheaper but these above solutions seem more robust.


Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6081
  • Country: es
Re: Switching mains AC power with small switch
« Reply #34 on: June 30, 2024, 06:41:45 pm »
Here is a very simple simulation to prove the idea. It shows a complete off status as needed. but i have to say that ssr seems more robust and guaranteed.
Triacs are robust devices, they handle rough current spikes and voltages. Just go with it.
I think SSR here is "killing flies with gunshots"
« Last Edit: June 30, 2024, 06:43:39 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: ie
    • LinkedIn
Re: Switching mains AC power with small switch
« Reply #35 on: June 30, 2024, 06:51:09 pm »
so can i let the diode be before the zener?
No. Zenner works on both polarities of AC input. At positive it provide 3.3V (or whatever it will provide), at negative it keep current path to recharge capacitor C1. If you move diode before zener negative part of AC will be blocked and C1 just will be charged to peak AC value. And it will not be function as dropper, just as level shift. All curcuit will blow out.

Quote
if not, then i will just assume it is gonna be 3.3v - 0.6v = 2.7v
Yes, it will. But you can use shotky diode and/or get 5V zenner.

Quote
and use another resistor value. this time for 2.7v input voltage and roughly 19-20 mA it will be 75 ohms instead of 100-120 ohms.
Better do not reduce voltage drop on resistor. Zenner is not ideal, so its output voltag can slightly be changed over time/temperature/etc. If you reduce voltage gap after zenner you will enlarge range of possible currents through SSR LED.

Quote
what is your opinion on this?
Seems good. But may be a little higher resistanse and may be little biger chip size (1206 at least). It should be capable to consume big peak energy serge (unfortunately datasheet doesn't say its energy absorption capability)

And check for current through zener - it could be too much (max zenner power dissipation should be considered). At your current values it almost at limit.
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: ie
    • LinkedIn
Re: Switching mains AC power with small switch
« Reply #36 on: June 30, 2024, 06:58:16 pm »
Triacs are robust devices, they handle rough current spikes and voltages. Just go with it.
I think SSR here is "killing flies with gunshots"
SSR that OP use is a basicly triac + control net. So both versions are roughly the same.
Separate triac could be much more powerfull, but OP says that power budget of SSR will be enough.

On the other hand one of main advantage of SSR - galvanic isolation, is not used here. So separate triac can be used instead SSR - it's almost equivalent replacement for this cuircuit.
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #37 on: June 30, 2024, 07:43:21 pm »
Here is a very simple simulation to prove the idea. It shows a complete off status as needed. but i have to say that ssr seems more robust and guaranteed.
Triacs are robust devices, they handle rough current spikes and voltages. Just go with it.
I think SSR here is "killing flies with gunshots"

you mean this circuit is totally fine?

I really liked it since it requires no extra components at all. I just want to verify if it is safe to use with no potential failures as well as won't generate heat.


Quote
Seems good. But may be a little higher resistanse and may be little biger chip size (1206 at least). It should be capable to consume big peak energy serge (unfortunately datasheet doesn't say its energy absorption capability)

And check for current through zener - it could be too much (max zenner power dissipation should be considered). At your current values it almost at limit.

if i use this circuit then i will pair it with capable regulator such as that LNK or AL17050 which can deliver several tens or hundreds of milliamps.

Quote
SSR that OP use is a basicly triac + control net. So both versions are roughly the same.
Separate triac could be much more powerfull, but OP says that power budget of SSR will be enough.

On the other hand one of main advantage of SSR - galvanic isolation, is not used here. So separate triac can be used instead SSR - it's almost equivalent replacement for this cuircuit.

so it is this circuit right?

I mean by using 100 ohms or so resistor from AC line to triac base, and the circuit is cut by the switch. the switch is pressed down = it works forever. once button is off = immediately shuts off. I am understanding correctly?

as you mentioned galvanic isolation is not really used since no MCU and no isolated dc supply, thus triac alone should be enough. correct?

Here is a suggested triac: https://www.lcsc.com/product-detail/TRIACs_STMicroelectronics-T405Q-600B-TR_C144390.html

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: ie
    • LinkedIn
Re: Switching mains AC power with small switch
« Reply #38 on: June 30, 2024, 08:31:42 pm »
Quote
so it is this circuit right?
Yes

Quote
as you mentioned galvanic isolation is not really used since no MCU and no isolated dc supply, thus triac alone should be enough. correct?
Correct. The original circuit had no galvanic isolation, despite the use of SSR.
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #39 on: July 01, 2024, 06:55:09 am »
well, i will do the triac circuit tonight.

however, i am thinking of the gate resistor value which suits all voltages from 100 to 240v ac.

triac gate current ranges from 5-10ma to 10-25ma depending on which to choose from.

a lot of triac circuits i see use 100-180 ohms resistor.

assume i used 330 ohm resistor:

triac gate voltage = 1.3v (add 0.2v for Igd = 1.5v)
series resistor = 330 ohms
gate current = 10 mA

line voltage necessary to turn it on = 1.5v + 10mA*330ohms = 1.5v + 3.3v = ~ 4.8v

which is too low, i don't know if this is gonna cause a problem... i feel it should not.

but for argument sake let's make it 1k ohm:

v_line = 11.5v

I think choosing a very big size resistor with some wattage is a safe guard to heating and problems. they are cheap anyway.

but which resistor value do you recommend i choose for all line voltages from 100v to 240v?


Online Phil1977

  • Regular Contributor
  • *
  • Posts: 205
  • Country: de
Re: Switching mains AC power with small switch
« Reply #40 on: July 01, 2024, 09:05:15 am »
What is the advantage of using the triac compared to direct switching of the mains load? A mains switch does not get much smaller if it carries 10mA instead of 2A. The only way to make the switch smaller would be to have galvanic isolation in the relais box, so that you can use a non-insulated low voltage switch, but the triac can't do that.

The idea with the FETs could be an alternative. It´s also not galvanically isolated, but the current through the megaohm-resistors could be that low that it is safe to touch.
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #41 on: July 01, 2024, 11:07:22 am »
What is the advantage of using the triac compared to direct switching of the mains load? A mains switch does not get much smaller if it carries 10mA instead of 2A. The only way to make the switch smaller would be to have galvanic isolation in the relais box, so that you can use a non-insulated low voltage switch, but the triac can't do that.

The idea with the FETs could be an alternative. It´s also not galvanically isolated, but the current through the megaohm-resistors could be that low that it is safe to touch.

i need a middleman circuit since the switch I have is not suitable or rated for high voltage power line. I know i can easily get a rocker switch or so but as i mentioned earlier, I am forced to use a certain switch shape and formfactor.

in short, it is a PSU for sony PS1. top shell of ps1 has plastic part which presses the button therefore the button must be push type not rocker, and of a certain height at least. when i searched i found these mostly suitable for just lower currents at high voltages. don't want to risk run it on higher voltage and cause problem.

my small triac circuit above still use the power line but in a very small current which even may not be totally ok due to high voltage

Online Phil1977

  • Regular Contributor
  • *
  • Posts: 205
  • Country: de
Re: Switching mains AC power with small switch
« Reply #42 on: July 01, 2024, 11:59:05 am »
Can you show the type of switch you want to use? I´m just curious what switch is specified for high voltage and that little current.
 

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #43 on: July 01, 2024, 12:15:17 pm »
Can you show the type of switch you want to use? I´m just curious what switch is specified for high voltage and that little current.

Please check image in attachment, I want to build a replacement PSU for this. the button must be in that exact place (can take care of routing easily) and of the same height.

PS1 is rated at maximum of 17 watts, for worst case is gonna be 100v AC @ 17 watts = 170 mA.

all buttons i am finding are rated for smaller voltages, i was at least hoping for one which is rated for high voltages but withstand small current which will work with triac circuit.

Thus, after finding this i started searching again from scratch and found these:


https://www.lcsc.com/product-detail/Push-Switches_Legion-MPS21-BBDAM-S1-R_C309203.html
https://www.lcsc.com/product-detail/Push-Switches_Legion-MPS01-BBCAA03-A-R_C5186997.html
https://www.lcsc.com/product-detail/Push-Switches_HONGJU-PB-04B-R_C268253.html
https://www.lcsc.com/product-detail/Push-Switches_Legion-MPS21-WWBCB-R_C309205.html
https://www.lcsc.com/product-detail/Push-Switches_HONGJU-PB-05B-R_C268254.html

they can be used to switch it directly, since i could not find 250v AC rated switches with the formfactor I showed in attached picture but these can definitely work easily.

it is just that they are suited and made for "panel mount" but I believe I can just solder them as a through hole component easily.

gonna find if the height is suitable or not since it is important that it fits and can be pushed by the top shell plastic button. The one in first link is promising... if so then the remaining problem is the big contacts. these should be cut but they would need pcb house to have big plier to do so.

what do you think?

can you find a better button which is more suitable?

Offline VEGETATopic starter

  • Super Contributor
  • ***
  • Posts: 1992
  • Country: jo
  • I am the cult of personality
    • Thundertronics
Re: Switching mains AC power with small switch
« Reply #44 on: July 01, 2024, 05:53:34 pm »
I measured original button to have height above board of about 25.5mm without being pressed. plastic top shell button can travel 3mm down.

https://www.lcsc.com/product-detail/Push-Switches_Legion-MPS21-BBDAM-S1-R_C309203.html
this one is 24.1mm, so I don't really know if it will press well. there is almost 1.5mm difference.

however i found these 2 in mouser:

https://eu.mouser.com/ProductDetail/E-Switch/PA512C?qs=QtyuwXswaQjHWi%2FoiLfOww%3D%3D
https://eu.mouser.com/ProductDetail/E-Switch/PA511C?qs=QtyuwXswaQgztMXaZA20Zw%3D%3D

basically the same but one is 2 poles and the other is 1. their height above board is about 26.5mm. so this one is about 1mm taller, i guess these can actually get pressed well but they are a lot more expensive.



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf