Relay board PCB layout - Page 1
Forum section: electronics / projects

author: DanielJulianGR
author_rank: Newbie
timestamp: November 25, 2020, 01:52:42 pm
content: Hello everyone!I have designed this little board to power up a pump through a relay. The signal for the relay is 12 VDC and comes from an external board.Pump works at 120 VAC and I'm not sure on how to deal with mains properly here. I've used mains in other projects previously but never through a PCB.Perhaps you can help me check if everything is good or what can I change.I'm specially concerned on how to deal with the exposed mains pads of the relay and header connectors.Many thanks for your help!

author: Twoflower
author_rank: Frequent Contributor
timestamp: November 25, 2020, 03:20:08 pm
content: Have you calculated the power the resistors need to withstand? Do the SMD resistors allow the required voltage (about 170V; not including any spikes on the mains)?The creeping distances between the bridge rectifier and the control traces are too small.Why do you use a bridge rectifier at all? LEDs are only lit if the polarity is correct.The signal LED won‘t survive long. The self inductance of the relay coil will probably kill it very soon.

author: DanielJulianGR
author_rank: Newbie
timestamp: November 25, 2020, 04:42:26 pm
content: Quote from: Twoflower on November 25, 2020, 03:20:08 pmThanks for your response!1. The SMD resistors I planed to use are 10k at 1/4 W, so I don't think they will withstand the power. Thanks for pointing that out, will make the due change there.2. I'll move the rectifier a little to the right. (Perhaps delete the rectifier from the design even)3. I'm using the rectifier so that the LED doesn't flicker on and off. Perhaps it will be simpler as you say and it would reduce the BOM.4. I have a flyback diode connected to the relay signal at the other board. I don't think is necessary to add another one over this board. Do you thing I should add one?

author: Twoflower
author_rank: Frequent Contributor
timestamp: November 25, 2020, 05:37:01 pm
content: 1. You should reduce the current through the LEDs a lot. Few mA are usually bright enough. And you should use more than one resistor in a row to reduce the voltage and power over the resistors. Add plenty of margin here and keep in mind that the 2x 2W or so needs to go somewhere.2. Unfortunately I can't provide a definitive answer about the creeping distance.3. You need either a diode or a bridge rectifier. Without a diode no current is flowing (no voltage will drop on the resistor) until the reverse breakdown voltage over the diode is reached. That will destroy the LED. Against flicker a small cap will help. Probably a cheap 1uF will be enough.4. Depending on the cable length, which acts also as inductor, the remote diode won't be as effective as one close by. And having the diode there the PCB can be reused elsewhere.

author: wraper
author_rank: Unknown
timestamp: November 25, 2020, 05:43:15 pm
content: QuoteYou should be concerned about creepage distance between low voltage and mains parts. You completely screwed up with that. This thing is dangerous.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: November 25, 2020, 05:56:45 pm
content: With regard to the LEDs, for AC operation you could use a same-colour dual LED package and wire them up in anti-parallel. That way, one LED of the pair will be illuminated on each half wave of the AC current. No other diode or cap needed. The LEDs will have barely noticeable flicker (at line frequency, 50/60 Hz), but for a simple indicator that shouldn't be an issue.Suitable current-limiting resistor(s) still necessary of course, as mentioned earlier.

author: DanielJulianGR
author_rank: Newbie
timestamp: November 25, 2020, 06:52:49 pm
content: I have good ideas to take from here:1. I'll definitely will avoid the bridge rectifiers. I like the solution of the dual LED package. And add a couple of resistors to deal with power better.2. Removing the rectifiers I'll have more space and creepage distance should be better then.3. I'll add the flyback diode in this board as well. It is a good argument to make this board work standalone from the other one.Thank you all for your input!I have now another matter in my mind about this design, regarding the in rush current the load may need. Do you think I should add an NTC thermistor in series with the fuse or should I go with a more sophisticated solution?

author: Twoflower
author_rank: Frequent Contributor
timestamp: November 25, 2020, 07:06:13 pm
content: Just as an idea: Can you rotate the relay 90° and put the mains-related part on the right side of the PCB and the control on the left side. That provides a more natural separation of the voltages and simplifies the creepage distances much easier.

author: floobydust
author_rank: Super Contributor
timestamp: November 25, 2020, 07:34:06 pm
content: For 300VAC you need at least 1.5mm spacings between hazardous live and the secondary LV side. If your device (secondary side) is not PE earth-grounded then double that to 3mm. You don't have that in a few spots on the board.Always remember my EE mantra "the fuse comes first". Here, it is after the relay which is not right.For a 10A load, the pcb traces and annular ring look a bit thin. Usually you double up the traces- duplicate them on both the top and bottom layers.Add a back-EMF diode for the relay coil, so bench testing it does not kill the signal LED.You can use a smaller SMT bridge rectifier. Do not use a single series-diode with an LED, they fail due to mains transients. If you have only one diode anti-parallel with the LED that works, or the dual LED mentioned.Your mains LED dropping resistors need to be suitable for 300VAC plus transients so their spacings and voltage rating need to be considered. A 1206 is 2mm pad spacing and maybe 250VAC rated but it will breakdown with mains transients. You will see two or three 1206's in series used or a MELF.I would not use an inrush limiter as they make heat and your board is just too small. Just design it for inrush, so the traces do not melt at 25A.

author: wraper
author_rank: Unknown
timestamp: November 25, 2020, 07:49:37 pm
content: Quote from: floobydust on November 25, 2020, 07:34:06 pmYour distance numbers are like 2 times too low. Sounds more like functional creepage distance rather than safety. Or it needs to be according to pollution degree II and material group I, while a typical PCB is a measly material group IIIa.

author: floobydust
author_rank: Super Contributor
timestamp: November 25, 2020, 08:15:46 pm
content: I make huge assumptions about what and where the board will be used, as far as spacings requirements.It's too bad we don't have a sticky on how to design PC boards with mains safety, instead of reinventing the wheel. I guess it's too dangerous to get that wrong and nobody wants to stick their neck out and get beat up offering engineering advice "the bridge will not collapse" kind of thing.I follow IEC 61010, Cat. II for the (smallest) safety numbers. Functional spacing is less.If it's a reinforced/double-insulated design OP has, then min. 3mm for Cat. II is what I believe is specified.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: November 25, 2020, 09:30:34 pm
content: Quote from: DanielJulianGR on November 25, 2020, 06:52:49 pmBy the way, you may not be able to find dual LED package with the same colour - they are much more common in separate colours (e.g. red/yellow, red/green, etc). If not, just use one LED and one regular diode in anti-parallel. The downside is the LED will illuminate only every other half cycle, at half AC line frequency, which may make it look dimmer; could bump up the current by reducing the resistor values. Oh, and if you do it this way, use something like a 1N4007 diode, not a 1N4148, because it has a maximum reverse voltage above line voltage (1N4148s are typically rated at only 100V). Arguably, it doesn't matter, because the anti-parallel LED is conducting whenever the diode would be facing reverse voltage,but, if the LED dies and goes open-circuit, that would then also kill the diode; a 1N4007 will survive.

author: DanielJulianGR
author_rank: Newbie
timestamp: November 25, 2020, 10:27:40 pm
content: I redesigned the PCB following your advice: moved the fuse to mains input, added three resistors in series and went for the 1N4007 diode for the LEDs.Keeping creepage distance between stuff was tricky, so I had to add 10mm to the board layout.Here I attach how it came out. Your comments for the new layout are welcome.Many thanks to all of you!

author: Benta
author_rank: Super Contributor
timestamp: November 25, 2020, 10:37:02 pm
content: @floobydust:Your tables seem to refer to phase-neutral or phase-earth or phase-phase creepage distances.For safety, the phase-human is the important one, and this is normally 8 mm at 230 VAC (for non-earthed equipment = double-insulated). Otherwise, why would Broadcom (ex HP/Agilent) make widebody optocouplers? Or why would other suppliers make VDE/DEMKO/SEMKO-approved couplers? All with 8 mm creepage distance.Would be total waste of time and money. And I highly doubt that manufacturers would do that just for fun.EDIT: i see Colombia has 110 VAC. This would reduce the creepage distance, I expect.

author: floobydust
author_rank: Super Contributor
timestamp: November 29, 2020, 07:39:48 am
content: The 8mm spacing withstands a 5,000V 1-min hi-pot test and I think it's to conform to the IEC 60601 medical standard:https://www.analog.com/media/en/technical-documentation/frequently-asked-questions/FAQs_Certified_8mm_Creepage_Pkg.pdfSome safety standards have sections specifically for opto-isolators. But 8mm is more than I see in 300VAC Cat. II (2,500V impulse) use.Relevant is OP's relay - perhaps anOmron G2Rhaving also 8mm internal spacings between coil-contacts.

author: Le_Bassiste
author_rank: Frequent Contributor
timestamp: November 29, 2020, 08:37:31 am
content: i see 4 mounting holes in the p.c.b..did you account for extra space that is required for the screw heads and washers?

author: Benta
author_rank: Super Contributor
timestamp: November 29, 2020, 12:00:05 pm
content: Quote from: floobydust on November 29, 2020, 07:39:48 amThat sounds plausible.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 29, 2020, 12:24:19 pm
content: I can see the idea of using LED deliberately backward-biased is mentioned multiple times yet no one mentioned yet LEDs are typically rated to 5V max reverse voltage. In reality, they can usually take more than that without blowing up, but it's a good idea to stay within specifications, that's why you see rectifiers (single diode or bridge) even when just driving LED. With two LEDs anti-parallel to each other, one forward-biasing limits the reverse voltage seen by the other so that should work.What comes to creepages and clearances, this is a massive can of worms because so many different standards exist. If you are not sure, use some 8-10mm of creepage distance if at all possible so it passes basically all common requirements everywhere and is definitely safe (from the creepage viewpoint, obviously there are more to safety than just this).Here, miniatyrization is clearly not required and the component footprints used easily allow some 8mm of clearance no problem.Another comment, do you really think you need two layers here? I would consider doing that in single layer. For LEDs, I'd consider just through hole because most components are through hole anyway.Fuse looks suspiciously small, it's possible but please double-check from the fuse datasheet it's really up to the task of being used in mains.

author: ledtester
author_rank: Super Contributor
timestamp: November 29, 2020, 05:18:18 pm
content: bigclive did a video on using LEDs as mains indicators:https://youtu.be/Q23uh7AjjXwAround 6:00 he demos a simple red LED + resistor indicator using older LED technology which seems to imply that they can withstand very high reverse voltage.

author: Benta
author_rank: Super Contributor
timestamp: November 29, 2020, 05:54:48 pm
content: Never understood why people bother with LEDs for mains indicators. Too complicated and too much bother.Use a simple old-fashioned neon lamp instead. OK, it's not red, but amber. Who cares.

author: floobydust
author_rank: Super Contributor
timestamp: December 01, 2020, 04:39:00 am
content: NEVER use just one diode with an LED on AC mains or even 24VAC systems - system transient voltages are easily over an 1N4007 1,000PIV rating and the LED gets killed.Here are some LED on mains circuits, including ones that will last.