A Common and Dangerous Mistake in PCB Layout
Today’s article isn’t just about anything—it’s about a specific topic, as they say. I’m going to discuss a mistake that, for some reason, crops up quite often. And it’s not just beginners who make it; even experienced engineers do.
Let me say right away: I didn’t write this post to hate on anyone, but rather for the sake of safety. And believe me, I have good, objective reasons for that.
A reminder: to keep up with new topics on the blog, I recommend following me on Instagram. I’ll post notifications about all new topics there, and might also write about something interesting now and then - link to account
You can also subscribe to updates and new articles on the Telegram channel - https://t.me/KirichBlog
The subject of this article goes way back—at least to 2008, when I saw an example of a power supply design on a well-known website. Yes, the title at the top says “ИПБ” (IPB). Only the author probably knows what that means, because I personally know only two similar abbreviations: ИИП (switching power supply) and ИБП (uninterruptible power supply). But never mind; abbreviations are invented so authors can write them however they like... (sarcasm)

The circuit’s design details are a whole other topic and have nothing to do with the problem in this case. The circuit doesn’t even have to work; today we’re talking about something else: PCB layout.
So, the author included a PCB layout that anyone can still download.
There are three key points here:
1. If you look closely at the layout, you can see that the traces carrying current on the hot and cold sides run extremely close to each other.
2. This mistake has no effect whatsoever on whether the device works, but it’s dangerous for anyone who assembles it and then uses it.
3. The layout is publicly available.

Look closely and you can see just how little clearance there is between the traces. The grid spacing in the drawing is 1.27 mm.
The trace on the “hot” side is highlighted on the left, and the “cold” side on the right.
It’s actually quite difficult to tell which traces are which here, since the component locations aren’t marked. In any case, it’s clear that the board has no meaningful clearance at all. The output is on the right; you can see the footprints for the large electrolytic capacitors.

I brought this up on the forum back then. The author spent ages missing the point and wrote things like, “It’s my job to come up with the design; the circuit works, after all. I’ve already built two power supplies, and they’re both great,” and so on.
Some time later, the same author (it shouldn’t be too hard to find his username) suggested using his design again, and got a reply from me and Borodach. There was also talk of asking the admins to remove his design from the site, but I don’t know why they didn’t.

And then, 15 years later, YouTube recommends a video about a charger. Since I’m interested in this sort of thing, I decided to watch it.
And that gave me a sense of déjà vu. Once again, I was looking at a potentially dangerous PCB layout, so I asked the author where he’d learned to lay out boards like that and whether he knew his board was unsafe.
Unfortunately, the author deleted that short comment thread, so all I have left are screenshots. The exchange wasn’t private, so I think it’s perfectly fine for me to post it.

At first, I noticed something odd in the video, but thought I might have imagined it. Luckily, the author had made an archive publicly available, including the PCB layout in Sprint-Layout.

Here I’ve highlighted the adjacent traces. The L-shaped one at the top is the primary side; the rest is the output, including a long section running parallel to it.
That’s the charger’s output ground.

Zooming in, you can see that with a 1.27 mm grid, the distance between the traces is about 0.9 mm. I initially told the author it was 0.7 mm, but I’d only taken a quick look. In any case, it doesn’t change anything.

The key problem is the same one shown at the very beginning. The breakdown voltage is generally taken to be about 1 kV per 1 mm of clearance. In other words, with a 0.9 mm gap, breakdown could occur at just 900 V. And that’s for a dry, clean surface. If there’s a fan blowing dust around, and the device is then used somewhere like a garage (it is a charger, after all), where it’s humid, breakdown could happen at a much lower voltage.
I wrote something along those lines to the author. In reply, he also mentioned “most factory-made devices,” but ignored my request to name even one example. Although I know of at least one factory-made device with a similar problem, and I’ll show it to you at the end.

Unfortunately, my replies are no longer available, but I wrote back that I have no academic or practical interest in doing someone else’s work—in other words, the payoff from doing it is close to zero.
The author apparently thought that by “payoff” I meant money, but that’s not what I meant at all, and I’ll come back to this later.

So what do we actually have here? Let’s work through it using a typical power supply circuit as an example.
A power supply (which is what we’re talking about here) usually has three components that connect the “dangerous” and “safe” sections:
1. A transformer—sometimes there are two, for example, a power transformer and an isolation transformer
2. A Y capacitor. Again, there may be several; sometimes two are even connected in series to improve safety. One example is power supplies for medical equipment.
3. A feedback circuit, usually an optocoupler.

The required withstand voltage for the insulation is also specified. For consumer-grade equipment, this is usually 2 × MOOP; for medical equipment, 2 × MOPP.
The table below lists the minimum creepage distances and insulation voltages for two scenarios: a board that may be exposed to dust and a board in a clean environment. Put simply, the first is an open-frame power supply or one with a fan, while the second is a power supply in a fully enclosed case.
There is also a 1 × factor, used for insulation requirements to a grounded enclosure.
So, for a typical consumer power supply operating in an open enclosure, the insulation must withstand 3 kV, and the minimum clearance must be 5 mm. These are minimum values, of course—if you can make the clearance larger, do so. It certainly won’t hurt.
The minimum clearance is usually under the optocoupler. It’s measured not between the centers of the lead holes, but between the nearest edges of the pads. For example, the typical lead spacing on a PC817 optocoupler is 7.5 mm, and the pads are 2 mm in diameter. So if you install it “as is,” you get a clearance of 5.5 mm, which is cutting it pretty close.
To increase the creepage distance, you can either use a different type of optocoupler or increase the spacing between its leads. I usually add 1.25 mm. A slot in the PCB in the most critical areas also helps a lot.
An example of a power supply for medical applications is covered in my review of the Meanwell RPS-120-27

Now let’s look at some examples.
First, a branded power supply, the Meanwell EPP-100-12. The photo shows where the transformer and Y capacitor are installed.

The optocouplers are installed on an auxiliary board. As I mentioned above, they have increased lead spacing—and there’s even a slot underneath them.

Moving on to a less well-known manufacturer, Sanmim, and its GPT70A-12 power supply.
Here we see exactly the same thing: generous spacing between components and safety slots.

Here’s another power supply, probably branded as well. I bought it used. I did review it, but honestly, I can’t be bothered to look for it; these and the other photos are from my reviews.
It has two Y capacitors, safety slots, and generous spacing. This power supply was clearly intended to be installed in an enclosed case.

But let’s make things more challenging and look at some blatantly Chinese power supplies. By “Chinese,” I mean completely unbranded units.
Here we see a simpler solution, but the spacing between the contacts is still clearly more than 5 mm.

The situation is similar with slightly better-quality units, but now we also see safety slots.

The second power supply in the photo above has a different problem: it uses a regular high-voltage capacitor instead of a Y capacitor. That’s bad too, and I’ve already talked about it in one of my videos and in an article.
Now for the bad news: some Chinese power supplies do have problems. One example is the “people’s” power supply.

For some reason, the Chinese manufacturers messed up and made the clearance too small. Yes, they tried to add a safety slot, but if they had extended it—or, more precisely, joined the two slots together—it would have been fine. But alas.

To be fair, the gap was even smaller in the first revision. In the new one, they simply narrowed the trace, thereby increasing the clearance.

A fair question: why am I only showing factory designs? No problem, I'll show you some of my own.
First, a charger for a 24 V battery, with a charging current of up to 8 A. We installed these in UPS units when Ukraine was having rolling blackouts.
Yes, that was 20 years ago, as the files' last-modified date shows. And yes, there are plenty of mistakes of my own here, but there are certainly no safety concerns: at the narrowest point, the clearance is about 6.5 mm, even though the output was grounded!

Here's another example of a simple power supply; I talked about it here.

By the way, someone posted their own routing in my thread. What do you think—is it safe?

This power supply was actually manufactured in series. You can also see the clearance between the primary and secondary sides here.


Of course, I've made mistakes too—only people who do nothing never make mistakes.
This is also a charger for a UPS, and it was manufactured in series as well. It was designed around 2001, and here's a mistake I admit to: the clearance between the primary and secondary sides was only about 4 mm, which is a bit too little.

The second design oversight is a little more complicated: it's the primary-side power supply in my bench power supply.
At first glance, everything looks fine: the clearance between the primary and secondary sides is clearly more than 5 mm.

But the heatsink mounting screw ruined everything, because a short could occur through it. Heatsinks generally add complications, and you need to account for them too. As a simplified rule, add the clearance to the parasitic conductor (heatsink, mounting hardware) to the clearance from it; the total should be more than 5–6 mm.
By the way, you can see some text on the circuit board in the screenshot. That can sometimes cause problems too. Find the routing image above that we're discussing and answer this: what's wrong with the text on it? Consider it a spot-the-detail challenge.

Now I'll answer my own question about factory-made devices that don't meet safety requirements.
So far, I think I've come across only one such device (Chinese gadgets don't count; that's a separate topic). It was an industrial automation device: an automatic transfer switch.
At the end of my review, I talked at length about the problem. I don't know whether the manufacturer has fixed the routing since then.

And here's some more "beauty" from the same device. Blue marks the "cold" side, red marks the circuits directly connected to the input voltage, and orange marks the circuits connected to the mains neutral when wired correctly.

As I wrote back then, the problem turned out not to be hypothetical but very real—and it cost me some of my equipment.

Sometimes you come across a design where someone seems to have done everything right, then makes a blunder and doesn't notice. In other words, they started with adequate clearance and a safety slot, but then forgot that the ground plane runs right next to the contacts (photo from Habr).

So, what's the point of all this, and why did I put this post together in the first place?
It's very simple. I can live with a circuit that doesn't work properly, with one that lasts not 10k hours but only 100, or even one that doesn't work at all. But whatever the case, the device must be safe. That's an absolute rule: SAFE, period!
What's worse is when you share your creation with others, often with viewers or readers who have even less experience.
Do you know how they see your PCB routing when some authors tell them to "finish it themselves"?
Yes, I'm not joking—that's exactly what your circuit board looks like to an inexperienced person. And often, the person knows nothing about circuit design and even less about PCB routing, but can hold a soldering iron, has an iron at home, and can buy the components at a store. Should I go on?

To wrap things up, I'll say it again: your device may work poorly, not work at all, look ugly, or work perfectly—but the most important rule is that it must be safe. The author suggested coating the circuit board with varnish. I can say that varnish only helps to some extent; sometimes the voltage breaks through even a layer of urethane.
The same goes for people who put 12 V on USB connectors, run 220 V through twisted-pair cable, and so on, but that's a topic for another discussion.
That's all for today. I hope I wasn't too harsh, but the author asked for constructive criticism, and that's what I gave. I didn't mean to offend anyone, let alone hate on them—though you can find examples of hate (wrong pronunciation, bad filming, too long, too short) under some of my videos. The author of the video we're discussing has some good ideas and is doing useful work overall, but safety must come first.
Be careful. Human life is priceless—take care of it.
Let me say right away: I didn’t write this post to hate on anyone, but rather for the sake of safety. And believe me, I have good, objective reasons for that.
A reminder: to keep up with new topics on the blog, I recommend following me on Instagram. I’ll post notifications about all new topics there, and might also write about something interesting now and then - link to account
You can also subscribe to updates and new articles on the Telegram channel - https://t.me/KirichBlog
The subject of this article goes way back—at least to 2008, when I saw an example of a power supply design on a well-known website. Yes, the title at the top says “ИПБ” (IPB). Only the author probably knows what that means, because I personally know only two similar abbreviations: ИИП (switching power supply) and ИБП (uninterruptible power supply). But never mind; abbreviations are invented so authors can write them however they like... (sarcasm)

The circuit’s design details are a whole other topic and have nothing to do with the problem in this case. The circuit doesn’t even have to work; today we’re talking about something else: PCB layout.
So, the author included a PCB layout that anyone can still download.
There are three key points here:
1. If you look closely at the layout, you can see that the traces carrying current on the hot and cold sides run extremely close to each other.
2. This mistake has no effect whatsoever on whether the device works, but it’s dangerous for anyone who assembles it and then uses it.
3. The layout is publicly available.

Look closely and you can see just how little clearance there is between the traces. The grid spacing in the drawing is 1.27 mm.
The trace on the “hot” side is highlighted on the left, and the “cold” side on the right.
It’s actually quite difficult to tell which traces are which here, since the component locations aren’t marked. In any case, it’s clear that the board has no meaningful clearance at all. The output is on the right; you can see the footprints for the large electrolytic capacitors.

I brought this up on the forum back then. The author spent ages missing the point and wrote things like, “It’s my job to come up with the design; the circuit works, after all. I’ve already built two power supplies, and they’re both great,” and so on.
Some time later, the same author (it shouldn’t be too hard to find his username) suggested using his design again, and got a reply from me and Borodach. There was also talk of asking the admins to remove his design from the site, but I don’t know why they didn’t.

And then, 15 years later, YouTube recommends a video about a charger. Since I’m interested in this sort of thing, I decided to watch it.
And that gave me a sense of déjà vu. Once again, I was looking at a potentially dangerous PCB layout, so I asked the author where he’d learned to lay out boards like that and whether he knew his board was unsafe.
Unfortunately, the author deleted that short comment thread, so all I have left are screenshots. The exchange wasn’t private, so I think it’s perfectly fine for me to post it.

At first, I noticed something odd in the video, but thought I might have imagined it. Luckily, the author had made an archive publicly available, including the PCB layout in Sprint-Layout.

Here I’ve highlighted the adjacent traces. The L-shaped one at the top is the primary side; the rest is the output, including a long section running parallel to it.
That’s the charger’s output ground.

Zooming in, you can see that with a 1.27 mm grid, the distance between the traces is about 0.9 mm. I initially told the author it was 0.7 mm, but I’d only taken a quick look. In any case, it doesn’t change anything.

The key problem is the same one shown at the very beginning. The breakdown voltage is generally taken to be about 1 kV per 1 mm of clearance. In other words, with a 0.9 mm gap, breakdown could occur at just 900 V. And that’s for a dry, clean surface. If there’s a fan blowing dust around, and the device is then used somewhere like a garage (it is a charger, after all), where it’s humid, breakdown could happen at a much lower voltage.
I wrote something along those lines to the author. In reply, he also mentioned “most factory-made devices,” but ignored my request to name even one example. Although I know of at least one factory-made device with a similar problem, and I’ll show it to you at the end.

Unfortunately, my replies are no longer available, but I wrote back that I have no academic or practical interest in doing someone else’s work—in other words, the payoff from doing it is close to zero.
The author apparently thought that by “payoff” I meant money, but that’s not what I meant at all, and I’ll come back to this later.

So what do we actually have here? Let’s work through it using a typical power supply circuit as an example.
A power supply (which is what we’re talking about here) usually has three components that connect the “dangerous” and “safe” sections:
1. A transformer—sometimes there are two, for example, a power transformer and an isolation transformer
2. A Y capacitor. Again, there may be several; sometimes two are even connected in series to improve safety. One example is power supplies for medical equipment.
3. A feedback circuit, usually an optocoupler.

The required withstand voltage for the insulation is also specified. For consumer-grade equipment, this is usually 2 × MOOP; for medical equipment, 2 × MOPP.
The table below lists the minimum creepage distances and insulation voltages for two scenarios: a board that may be exposed to dust and a board in a clean environment. Put simply, the first is an open-frame power supply or one with a fan, while the second is a power supply in a fully enclosed case.
There is also a 1 × factor, used for insulation requirements to a grounded enclosure.
So, for a typical consumer power supply operating in an open enclosure, the insulation must withstand 3 kV, and the minimum clearance must be 5 mm. These are minimum values, of course—if you can make the clearance larger, do so. It certainly won’t hurt.
The minimum clearance is usually under the optocoupler. It’s measured not between the centers of the lead holes, but between the nearest edges of the pads. For example, the typical lead spacing on a PC817 optocoupler is 7.5 mm, and the pads are 2 mm in diameter. So if you install it “as is,” you get a clearance of 5.5 mm, which is cutting it pretty close.
To increase the creepage distance, you can either use a different type of optocoupler or increase the spacing between its leads. I usually add 1.25 mm. A slot in the PCB in the most critical areas also helps a lot.
An example of a power supply for medical applications is covered in my review of the Meanwell RPS-120-27

Now let’s look at some examples.
First, a branded power supply, the Meanwell EPP-100-12. The photo shows where the transformer and Y capacitor are installed.

The optocouplers are installed on an auxiliary board. As I mentioned above, they have increased lead spacing—and there’s even a slot underneath them.

Moving on to a less well-known manufacturer, Sanmim, and its GPT70A-12 power supply.
Here we see exactly the same thing: generous spacing between components and safety slots.

Here’s another power supply, probably branded as well. I bought it used. I did review it, but honestly, I can’t be bothered to look for it; these and the other photos are from my reviews.
It has two Y capacitors, safety slots, and generous spacing. This power supply was clearly intended to be installed in an enclosed case.

But let’s make things more challenging and look at some blatantly Chinese power supplies. By “Chinese,” I mean completely unbranded units.
Here we see a simpler solution, but the spacing between the contacts is still clearly more than 5 mm.

The situation is similar with slightly better-quality units, but now we also see safety slots.

The second power supply in the photo above has a different problem: it uses a regular high-voltage capacitor instead of a Y capacitor. That’s bad too, and I’ve already talked about it in one of my videos and in an article.
Now for the bad news: some Chinese power supplies do have problems. One example is the “people’s” power supply.

For some reason, the Chinese manufacturers messed up and made the clearance too small. Yes, they tried to add a safety slot, but if they had extended it—or, more precisely, joined the two slots together—it would have been fine. But alas.

To be fair, the gap was even smaller in the first revision. In the new one, they simply narrowed the trace, thereby increasing the clearance.

A fair question: why am I only showing factory designs? No problem, I'll show you some of my own.
First, a charger for a 24 V battery, with a charging current of up to 8 A. We installed these in UPS units when Ukraine was having rolling blackouts.
Yes, that was 20 years ago, as the files' last-modified date shows. And yes, there are plenty of mistakes of my own here, but there are certainly no safety concerns: at the narrowest point, the clearance is about 6.5 mm, even though the output was grounded!

Here's another example of a simple power supply; I talked about it here.

By the way, someone posted their own routing in my thread. What do you think—is it safe?
This power supply was actually manufactured in series. You can also see the clearance between the primary and secondary sides here.


Of course, I've made mistakes too—only people who do nothing never make mistakes.
This is also a charger for a UPS, and it was manufactured in series as well. It was designed around 2001, and here's a mistake I admit to: the clearance between the primary and secondary sides was only about 4 mm, which is a bit too little.

The second design oversight is a little more complicated: it's the primary-side power supply in my bench power supply.
At first glance, everything looks fine: the clearance between the primary and secondary sides is clearly more than 5 mm.

But the heatsink mounting screw ruined everything, because a short could occur through it. Heatsinks generally add complications, and you need to account for them too. As a simplified rule, add the clearance to the parasitic conductor (heatsink, mounting hardware) to the clearance from it; the total should be more than 5–6 mm.
By the way, you can see some text on the circuit board in the screenshot. That can sometimes cause problems too. Find the routing image above that we're discussing and answer this: what's wrong with the text on it? Consider it a spot-the-detail challenge.

Now I'll answer my own question about factory-made devices that don't meet safety requirements.
So far, I think I've come across only one such device (Chinese gadgets don't count; that's a separate topic). It was an industrial automation device: an automatic transfer switch.
At the end of my review, I talked at length about the problem. I don't know whether the manufacturer has fixed the routing since then.

And here's some more "beauty" from the same device. Blue marks the "cold" side, red marks the circuits directly connected to the input voltage, and orange marks the circuits connected to the mains neutral when wired correctly.

As I wrote back then, the problem turned out not to be hypothetical but very real—and it cost me some of my equipment.

Sometimes you come across a design where someone seems to have done everything right, then makes a blunder and doesn't notice. In other words, they started with adequate clearance and a safety slot, but then forgot that the ground plane runs right next to the contacts (photo from Habr).

So, what's the point of all this, and why did I put this post together in the first place?
It's very simple. I can live with a circuit that doesn't work properly, with one that lasts not 10k hours but only 100, or even one that doesn't work at all. But whatever the case, the device must be safe. That's an absolute rule: SAFE, period!
What's worse is when you share your creation with others, often with viewers or readers who have even less experience.
Do you know how they see your PCB routing when some authors tell them to "finish it themselves"?
Yes, I'm not joking—that's exactly what your circuit board looks like to an inexperienced person. And often, the person knows nothing about circuit design and even less about PCB routing, but can hold a soldering iron, has an iron at home, and can buy the components at a store. Should I go on?

To wrap things up, I'll say it again: your device may work poorly, not work at all, look ugly, or work perfectly—but the most important rule is that it must be safe. The author suggested coating the circuit board with varnish. I can say that varnish only helps to some extent; sometimes the voltage breaks through even a layer of urethane.
The same goes for people who put 12 V on USB connectors, run 220 V through twisted-pair cable, and so on, but that's a topic for another discussion.
That's all for today. I hope I wasn't too harsh, but the author asked for constructive criticism, and that's what I gave. I didn't mean to offend anyone, let alone hate on them—though you can find examples of hate (wrong pronunciation, bad filming, too long, too short) under some of my videos. The author of the video we're discussing has some good ideas and is doing useful work overall, but safety must come first.
Be careful. Human life is priceless—take care of it.
This page was found when searching for:
как влияет пересечений сигнальных линий при разводке печатной платы, ршибки разводки сигналов на пп, блок питания на ir2153 печатная плата, примеры разводки платы под pic16f, разводка платы повышающего пушпул, 2, ошибки трассировки испульных бп, типовые ошибки трассировки печатных плат, зазор между "горячей" и "холодной" частью платы, 4, 1, полигоны между токоведущими дорожками печатной платы, https://www.kirich.blog/stati/informaciya-dlya-nachinayuschih/1160-tipovaya-i-opasnaya-oshibka-pri-razvodke-pechatnyh-plat
как влияет пересечений сигнальных линий при разводке печатной платы, ршибки разводки сигналов на пп, блок питания на ir2153 печатная плата, примеры разводки платы под pic16f, разводка платы повышающего пушпул, 2, ошибки трассировки испульных бп, типовые ошибки трассировки печатных плат, зазор между "горячей" и "холодной" частью платы, 4, 1, полигоны между токоведущими дорожками печатной платы, https://www.kirich.blog/stati/informaciya-dlya-nachinayuschih/1160-tipovaya-i-opasnaya-oshibka-pri-razvodke-pechatnyh-plat
Calculate manuallyAll calculators
Discounted products
You may be interested in
Discounted products
Support the project
All the content on the site and the advice are free, but we’d be grateful for your support of the project and the channel!
Comments8
Discuss on the forumHave a question or some experience to share? Discuss the article with the author and readers: the forum is a convenient place to share schematics and photos.
Go to the forumOnly registered readers can comment. It takes a minute to sign up, and you can log in with the same account you use on the forum.
Log inRegister




Comments are published in their original language.