Author Topic: PCB design with 5v and 120v  (Read 15198 times)

0 Members and 1 Guest are viewing this topic.

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
PCB design with 5v and 120v
« on: March 10, 2024, 07:27:46 pm »
Hi, I've only designed 2 or 3 PCB's ever and this project includes 120v AC, which I have not worked on with a PCB before. I was hoping to find out if this is safe or if there is anything I should be doing differently.

This project uses a 5v Trinket to turn a 120v vibratory pump on to a specific pressure, then hold it there (an extremely minimal and simple version of the Gaggiuino).

I'm planning to do a single sided prototype at home and maybe send it out at a later date after testing for some time. All components are mounted on the top, except a SMD triac that is mounted to the bottom

Thanks for the help!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #1 on: March 10, 2024, 08:05:42 pm »
There should be no tracks whatsoever under the optocouplers (their pin spacing allowing for standard pads is designed to provide enough creepage and clearance distance but  there little or none to spare).  Keep *ALL* low voltage tracks and parts to the left of them and all mains tracks to the right of them.

How are you going to power the 5V side?
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #2 on: March 10, 2024, 08:28:12 pm »
Awesome, thanks for that info, I will adjust those traces and repost in a little bit!

I think I'm going to use a USB wall wart to power the trinket
« Last Edit: March 10, 2024, 08:32:20 pm by ImpulsiveJames »
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #3 on: March 10, 2024, 08:57:40 pm »
Any better?

 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #4 on: March 10, 2024, 09:19:49 pm »
Looks OK from the creepage/clearance safety viewpoint.  As long as your circuit design is good, it should be OK. 

However why not neaten it up a bit so its clearer at a glance to anyone working on it where the division between the hazardous mains and safe low voltage sides is?   I'd move the MCT2EM right two grid squares and up one so it lines up with the other opto.  You'll also need to move the zero ohm jumper up one.  That gives you a straight line running under the middle of both optos, safe zone to the left and 'hot' zone to the right.   Mark your proto pcb accordingly.
« Last Edit: March 10, 2024, 09:23:05 pm by Ian.M »
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: ua
Re: PCB design with 5v and 120v
« Reply #5 on: March 10, 2024, 09:41:00 pm »
That 10k resistor on the bottom is begging to be turned and placed alongside the other one; or vertically, parallel to the three traces. Or 45 degrees! Its right hand lead is sticking too much in the direction of the high voltage zone, even if the clearance may technically be sufficient.

There's a good advice above: lay it out in such a way that it will be very clear at a glance to anyone where the low voltage and high voltage areas are and that they are well separated.

Make it so that your leftmost rows of pads of the optocouplers become the rightmost pads of any of the low voltage side. Likewise for the high voltage side. Align the optocouplers vertically along the same axis.

You seem to have the luxury of enough space on the board, so why not use it to arrange everything in a neat and tidy way?
« Last Edit: March 10, 2024, 09:47:27 pm by shapirus »
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #6 on: March 11, 2024, 01:58:27 am »
This was all super helpful! Thanks so much!

I did take your advise and move them so they are vertically inline and I also moved that resistor to a 45 degree angle.

This traces are so small, I'm not sure if I'll be able to make them here at home, but I'm still going to give it a try.

Thanks!!!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #7 on: March 11, 2024, 03:45:34 am »
So double the width of all the low voltage traces!
Also the TRIAC could do with a lot more copper area for heat dissipation,  so put its tab on a rectangular fill extending up from the 'PUMP' trace between the opto and the pump connector (but you'll need a high power soldering iron with a fat bit to solder the tab),  and double the width of 'ACL', only necking down to the TRIAC pad width just before the pad.
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #8 on: March 11, 2024, 03:47:53 am »
Will do! I was messing with Trace width and pad diameter, but I assume I can't change the pad diameter for the AC components, correct?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #9 on: March 11, 2024, 04:04:00 am »
Pads come with the component foot print which is generally a PITA to mess with if you don't have to.  OTOH if you can easily use larger pads for the AC side passives and diode, without running into clearance issues, you might as well.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7239
  • Country: ca
Re: PCB design with 5v and 120v
« Reply #10 on: March 11, 2024, 04:38:57 am »
Don't forget a fuse, OK?
 
The following users thanked this post: tom66, Ian.M

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20083
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: PCB design with 5v and 120v
« Reply #11 on: March 11, 2024, 09:24:50 am »
Hi, I've only designed 2 or 3 PCB's ever and this project includes 120v AC, which I have not worked on with a PCB before. I was hoping to find out if this is safe or if there is anything I should be doing differently.

When a teenager, I did something similar with 240V..

During testing and debugging, eventually I touched a neutral track with one hand and a component's live metal case with a finger on the other hand. Both biceps instantly and forcefully contracted, breaking contact.

A lucky escape.

If the muscle contraction hadn't broken the contact, I expect I would be dead. At least nowadays you could (and should!) power your circuit from an RCD/GFCI/ELCB with a <=30mA trip current.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: ua
Re: PCB design with 5v and 120v
« Reply #12 on: March 11, 2024, 10:57:47 am »
If the muscle contraction hadn't broken the contact, I expect I would be dead. At least nowadays you could (and should!) power your circuit from an RCD/GFCI/ELCB with a <=30mA trip current.
These will only protect against current leaking to earth (which isn't even shown in the circuit being discussed), but not when it's flowing between hot and neutral (which will look like any normal load), so high voltage circuits need to employ all practically reasonable safety measures, which basically boil down to "avoid using metal objects which can potentially become connected to hot or neutral, and isolate those you can't avoid". Oh and yes, there is a good reason why an experienced electrician never touches even his wife's boobs with two hands.

That said, the mentioned earth leakage breakers should be present in the breaker box anyway.
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #13 on: March 11, 2024, 01:01:06 pm »
Luckily we are 120v here, so a tiny bit better, but yes, I will try to be careful. Luckily this is going in a espresso machine, so it's not like the whole chassis is metal or there is water and wires everywhere :P

I'll look up the data sheet of the pump and use an appropriate fuse.. Can I probably can't use an 12v automotive fuse huh? I would put the inline with ACL?

Thanks!
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #14 on: March 11, 2024, 01:21:16 pm »
As far as I can tell, the pump uses 50w, so 2.4A. Is a 3A fuse good or is there a fuse calculator out there? This pump should only be on once a day for about 40 sec
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #15 on: March 11, 2024, 01:49:51 pm »
The pump *does* have a mains motor  (or are you designing this board for sh!ts and giggles)?

50W/120V=0.417A

However motor inrush (starting) current can be an order of magnitude higher so I'd go for a 4A slow-blow fuse, probably 20mm 250V glass.  Ideally you'd find space for a clip type fuseholder, but if you cant, one can get push on caps with leads that turn 20mm fuses into axial thru-hole solderable components, and there's certainly enough space for one mounted vertically.  Insulate its top lead with small bore sleeving or heatshrink.  Glass fuses can rupture if dead-shorted on a mains circuit, so sleeving the fuse body with heatshrink or pushing silicone/glassfiber sleeving over it is helpful to contain the carnage.  OTOH you can pay the premium for a ceramic body, sand filled HRC fuse that is far far less likely to rupture, so doesn't need sleeving.

Edit: I fubared the units above. :-[  Now fixed.
« Last Edit: March 11, 2024, 02:09:26 pm by Ian.M »
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: ua
Re: PCB design with 5v and 120v
« Reply #16 on: March 11, 2024, 01:51:07 pm »
Can I probably can't use an 12v automotive fuse huh?
Technically you can, but a) test it before you use it; b) still it's better to design it properly and use a standard cylindrical fuse instead, ideally in a ceramic case -- and test this one too.
« Last Edit: March 11, 2024, 01:52:39 pm by shapirus »
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #17 on: March 11, 2024, 01:53:02 pm »
Doh, I did 120/50, I knew 2.4 seemed way high for AC....

Slow blow it is. Thanks!
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20083
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: PCB design with 5v and 120v
« Reply #18 on: March 11, 2024, 02:00:54 pm »
However motor inrush (starting) current can be an order of magnitude higher so ...

My freezer is nominally 90W, but I have seen >1.2kW for between 0.2 and 1s.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4094
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: PCB design with 5v and 120v
« Reply #19 on: March 11, 2024, 02:05:54 pm »
Setup your design rules for minimum distances between net classes.
At least 5mm between low and high side.
 

Offline sparkydog

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
Re: PCB design with 5v and 120v
« Reply #20 on: March 11, 2024, 07:52:31 pm »
I'd go for a 4A slow-blow fuse, probably 20mm 250V glass.  Ideally you'd find space for a clip type fuseholder [...]

Okay, I'm curious, is there some reason why axial glass cartridge fuses are preferred over radial leaded fuses? The latter are equally available in 250V, take up a lot less board space (and aren't that much taller!), and you can still use them with holders. I've drawn (but not yet built) a number of boards using e.g. Littelfuse 370/372s with 559/560 holders. Are these somehow worse than glass cartridge fuses in clips?
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7239
  • Country: ca
Re: PCB design with 5v and 120v
« Reply #21 on: March 11, 2024, 08:23:08 pm »
For a fuse, non-replaceable I would consider Belfuse MRT or 0697 series, that package. I guess it depends on how well behaved the pump is, if it ever jams and you get nuisance fuse blows. Note a 1A part blows in a few seconds at 2-3A. I think a 4A fuse is too high. Ballpark overload is 2x rated motor current and fuses are rated for the current they will carry forever. 5x20mm fuses are great but take up a lot of room.

I have a concern about the triac overheating, it's good to maybe 0.5A using the minimum PCB footprint before, it's too hot. Make the tab copper pad much larger if you can. I don't like tiny triacs like that, they don't any abuse.

Your snubber cap 10nF is usually a square part, so I find the footprint might be oddball.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #22 on: March 11, 2024, 11:01:16 pm »
@Sparkydog,

Call me biased by too long in the service trade!

Axial glass fuses are cheap and nasty for mains use.  However *any* repair workshop can be expected to have a good selection of plain 20mm glass fuses, and the push-on axial end caps I suggested, although supposed to be use once can be reused several times.   We used to stock both fuses (in fast, slow blow and some values of ceramic HRC), and axial end caps.

The various styles of radial fuse are generally much much nicer, and typically are immune to the rupturing problem I noted at typical domestic mains receptacle peak short circuits, but good luck having the correct one in stock for a repair.  Sometimes we were able to match up the radial fuse to one we did stock, but often the markings left us guessing about its characteristic, or what we had was a different pin spacing, so we were stuck with closing up the item to get it off the bench, and waiting for a parts order.  Spend enough time closing stuff up only to have to strip it down again next week, and you too will develop an irrational dislike for the part causing the delays!
« Last Edit: March 12, 2024, 06:24:01 am by Ian.M »
 

Offline ImpulsiveJamesTopic starter

  • Contributor
  • Posts: 30
  • Country: us
Re: PCB design with 5v and 120v
« Reply #23 on: March 12, 2024, 06:13:30 am »
I'll probably just go inline so I don't have to make the board any bigger.

I just realized when I created this, I placed a dc cap next to the pump and that was just wrong. Can anyone recommended a cap for this circuit? Do I use ceramic disk? Do those come in 120v?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12986
Re: PCB design with 5v and 120v
« Reply #24 on: March 12, 2024, 06:30:46 am »
Traditionally one would use an appropriately rated metallised film or high voltage disc ceramic capacitor for a line voltage snubber.  Nowadays, there are a lot more choices, and you may suffer from choice overload!  You'll pay a little more for it but any capacitor of the right value with a class X safety rating (for mains line to line or line to neutral applications) will do the job.   

Incidentally, thru-hole disc ceramic capacitors are available with ratings up to several kilovolts.  However with the demise of the CRT TV and monitor industry, many of those are no longer in production, so there's a lot less choice nowadays.
« Last Edit: March 12, 2024, 06:34:29 am by Ian.M »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf