How To Create High Voltage Isolation Slots In Kicad – Voltlog #364

Back when I published the video on the aquarium controller I built, someone asked how are these high voltage isolation slots or cutouts done in Kicad and I thought I’d do a short video to explain how you can design these into your next project but first, let’s talk about their purpose and whether or not you need them.

There is a common confusion between the terms creepage and clearance, myself I’m guilty of sometimes making this confusion but to give you a clear view on this, I found this picture online which shows everything very clear. Spacing between conductive elements through air is clearance while Creepage is spacing between conductive elements over an insulating surface.

By adding these cutouts in the PCB we are only increasing creepage distance, but if you would also like to increase clearance you will need to add some kind of barrier, and this is usually built into the enclosure and it will slide through the slot creating a barrier to prevent any potential high voltage arc to jump over the barrier by increasing the length.

There are also secondary purposes for putting cutouts into your PCB, I have used them in the past to create a thermal barrier or to accommodate various enclosure walls and features but I won’t talk about those today, those applications tend to vary a lot on a case by case basis.

But if you are using them as high voltage isolation you need to be aware of some aspects: first and most important remember to make the slot at least 1mm wide, if possible go with 2mm as this is required by some standards. There is a min width required by the fab house anyway because they are going to use a router bit on a CNC machine to cut that slot into the PCB and this may vary from one board house to another but I’ve seen 0.8mm mentioned by most PCB manufacturers. For example PCBway which is the sponsor of the channel, gives a min value of 0.8mm non plated slot and 0.5mm for plated ones. For isolation purposes you only want non plated ones.

There might also be other limitations on the size of the corner radius, I’ve not hit any of those so far myself but just imagine that router bit going around, it will not be possible to create very small features at your request.

Use These LEDs For Your Next Project – Voltlog #362

Welcome to a new Voltlog, this will be a rather short video where I will be talking about a rather common subject, LEDs. I’m sure everyone uses them in their projects but if you are like me you probably never cared about the efficiency of the LEDs you use for signaling the status of something on your microcontroller board. So what I was doing most of the time was picking the least expensive LED available while still picking a known manufacturer like Kingbright or Lite-on or Osram just to avoid quality issues. And that was my voltage rail indicator LED or my blinky LED for signaling some status. But this ofcourse meant I needed to drive those LEDs with a fairly high current of 15-20mA to get decent brightness out of them and that might be OK for numerous applications but in this video i want to talk about high efficiency LEDs and how your project could be nicer because of them.

ESP32 Aquarium Terrarium Controller – Voltlog #361

This project started when a friend of mine which has a snake terrarium asked for my help to build a system that is capable of regulating temperature and humidity so the snake can live in optimum conditions. I’m not necessarily a snake lover, I would rather stay away from these kinds of creatures but that doesn’t stop me from helping my friend.

I started by figuring out what he uses to control temperature and humidity and it turns out there is some sort of a lamp to provide heat from above, some sort of mains powered stone that heats up and a water fountain, probably one that runs with fog to control the humidity. All of these are mains powered and only need simple on/off control which makes things simple when designing the electronics board.

In terms of digital control I figured it would be nice to have to be able to update the set points and check on the status values wirelessly so I went with an ESP32 modules. This also helps to add an extra layer of protection to keep the user away from the dangerous mains voltages present on the relays. I can have the whole board, enclosed in a plastic box so the user never goes near the mains voltages.

Silabs CP2104 No Activity on RX TX LEDs Bug – Voltlog #359

In Voltlog #357 I talked about a bug affecting the programming of ESP32 modules via Serial Bootloader, basically the issue was caused by an incorrect reset sequence regarding the EN and IO0 signals and I also showed a fix which involved adding a capacitor to delay the EN line.

Well, this week I’m gonna show you another bug which I encountered recently but this time with the CP2104 USB to serial converter chip from Silabs. So recently I designed this little board called VoltLink, it’s basically a usb to serial converter board but one that also integrates the auto-reset circuitry needed for programming Espressif modules like the ESP8266 & ESP32. I also have a 1mm pitch JST-SH connector with a standard pinout that I use in all of my designs and this helps with space savings on small circuit boards.

Well after assembling one of these boards, I connected it to my computer, the new virtual serial port was created and I thought everything was running fine, except it wasn’t. I quickly discovered that the status LEDs were not reacting when there was communication on the serial lines. I don’t know about you but I want my status LEDs to be functional, it helps me get a quick visual understanding of the communication happening on the serial lines. I don’t need anything specific, I just need to know that there is activity and if there is a lot of activity or less activity.

VoltLink™ A Fancy USB Serial Adapter (ESP32 Programmer) – Voltlog #356

Welcome to a new Voltlog, today I’ll be showing you how I created my own usb to serial adapter board and we’ll go through some of the design decisions I had to make and I will explain the reasoning behind making these choices but first let me tell you the background of the story, Personally I’ve always liked having my own usb to serial adapter and here is one that I designed something like 10 years ago maybe more. The layout is not great, my PCB skills were obviously not as good as they are today but nonetheless, I created this adapter as an exercise but also for the important purpose of having a reliable and flexible tool. Reliable because I could control the chip that I’m using. It was a Silabs CP2103 and I was getting it from a well known distributor.

Flexible because I had all the IOs of the chip broen out to 0.1 inch headers which could mean that I had the option to trigger a reset on a particular board or something along those lines. And I’ve also designed other adapters based on FTDI chips and more recently based on the CH340 family of chinese chips. 

So this brings me to today’s project, I designed this new adapter for two reasons: one is the good old reason of reliability, you can’t trust the adapters you’re getting from aliexpress, they’re almost always using fake chips and generally are of lower build quality. I want a reliable CP2104 series chip in here, I want it to be able to sustain high bit rates for fast uploading of firmware images to target boards.

Reverse Battery Protection With Mosfet (no voltage drop) – Voltlog #353

Welcome to a new Voltlog, today we’re going to be talking about reverse battery protection, I’m gonna be showing you a few methods for achieving this protection but I’m going to be focusing specifically on low power designs, where you might be using let’s say a single coin cell battery.

When we’re talking about higher input voltages, battery protection is pretty simple, you can simply add an inline Schottky diode, if the input voltage is reversed, the diode will be reversed biased and it will block the current flow. There is about 0.5V voltage drop on your diode but if you have a 9V input into a 5V regulator, there’s plenty of margin to afford losing half a volt. There is also the power dissipation to consider in that case, so you multiply the current with the voltage drop and you get your power dissipation into the diode, you pick an appropriate diode capable of dissipating that and the problem is solved.

Now when you start talking about low power devices, specifically those powered by coin cells, it gets a little tricky to get some reverse polarity protection into your circuit. Because our battery voltage is now just 3V we can’t afford losing 0.5V on our input diode, that will ruin our battery life, it will waste the little precious energy we have stored in the coin cell and might prevent our circuit from powering up.

JTAG Adapter PCB 20pin 2.54mm to 10pin 1.27mm – Voltlog #347

Welcome to a new Voltlog, this will be a rather short project video, I thought I’d start the year with something simple. If you’ve ever used JTAG before, either to program or debug an ARM processor, or something like an ESP32 or maybe to load a bitstream into an FPGA, you’ve likely encountered the ubiquitous 20 pin JTAG connector which is this 2×10 0.1inch spaced connector. It’s a rather large connector, it takes up a lot of space on a PCB, you don’t really need that many pins but you can’t go without it because it’s usually present on the fully featured programmer/debugging tools. Here is an example: this is an ST-Link V2, or to be precise a cheap clone from aliexpress but for the purpose of this discussion it doesn’t matter, it looks the same as the original and it has this 20 pin JTAG connector. 

And to some extent this isn’t really a problem if you are using big development boards like this STM32F4 dev board that I got from Aliexpress. This features the same 20 pin connector for programming so it’s a matter of connecting a simple ribbon cable and you’re up and running. However, most modern boards that you are going to be designing might not have enough space to install such a big connector, you might for example use the simpler 10 pin JTAG connection, cause you don’t even need that many signals, most of the pins are GND anyway on the 20 pin connection. And instead of using 2.54mm pin header you can use something smaller like half the size, 1.27mm, and this can save a lot of space on a board.

Designing PCBs With Castellated Holes | Voltlog #335

Welcome to a new Voltlog, in today’s video we’re going to be talking about castellated holes and how you can create them in your CAD tool. If this term is new to you, it’s pretty simple, you’ve certainly come across them if you’ve ever played with a bluetooth or wifi module because those 99% of the time will use castellated holes, which are these semi-plated holes on the edges of a PCB.  Having these connection points allows these modules to be soldered on top of a main PCB which contains our main circuit.

You might ask yourself why do we use castellated holes, why not use a simple through hole header as a board interconnect or just some simple SMD pads. Well in my opinion the most important reason is the relatively low difficulty for soldering castellated holes. If you think about it, having some SMD pads that go on the bottom of the PCB makes it pretty hard to solder, at least without proper equipment, you need to deposit solder paste on those pads, you need to get it in the right amount and then you need to have perfect alignment of the module on top of the pads which reside on the main PCB. Having these connection points underneath our module makes it very hard to align because you can’t see them. Also debugging such a module is going to be a pain because you won’t have access to all of those connection points.

So this where castellated holes improve, by having the plated half-holes at the side you can solder them even with a simple soldering iron, alignment is pretty easy because you can clearly see the connection points and debugging these is much easier because once again you can access them, you can do measurements with your scope probes or whatever instrument you are using.

Another advantage of having castellated holes on a design is to think of it like a building block, you might improve this building block externally or switch to a new building block that uses the same pinout and you just drop it into your system as a simple upgrade.

And believe it or not but having a module with castellated holes can lower your BOM cost in some cases because let’s say you need to use an RF module which might be 4 layers or a complicated system on module that may be 6 or 8 layer PCB with a powerful processor. Instead of building your entire system on an 8 layer PCB and assembling that complicated BGA chip yourself, you can buy the module ready made, it has castellated holes and you just drop that module into your system which may be a 2 layer mainboard or 4 layer mainboard that costs less.