Laser Cut Kapton Soldermask Stencil

As part of my ongoing development of the TB6612FNG motor control board, I have created a laser cut Kapton soldermask stencil. In this post, I will first discuss the method of producing a stencil vector drawing from KiCAD. Next, I will discuss the issues that come up with improper settings when cutting Kapton. Finally, I will discuss the laser CNC settings required for cutting it properly.

KiCAD Settings

It is quite easy to generate the soldermask layer from KiCAD as a vector image. To do so, go to File->Plot and select the settings circled in the picture. The file needs to be saved as a DXF (a commonly accepted vector format). Don’t bother plotting anything besides the soldermask you need, the extras will just junk up your folder. Before you plot the file, make sure that the soldermask settings are appropriate. The 0.02mm offset I use is great for this application. If you need to change your settings, you should do so in the design rules of your document.

From there, you need to touch up the vector image. Open the DXF file you created in your favorite vector graphics tool. I prefer using LibreCAD, but the laser CNC I am using requires the use of Adobe Illustrator. The vectors must be colored pure red (#FF0000), and the line width set at 0.001 pt. Then, the file is sent by printer drivers to the CNC machine.

Material Prep

Kapton is a fun little polymer to use. It starts out with a handsome orange color, and can be purchased on convenient rolls. Sadly, the very thin Kapton sheets required for making screens tends to curl after being on these rolls. Therefore, we need to flatten it. Additionally, placing the thin polymer on the metal bed of the laser CNC is unwise, as the heat from the laser ablating the metal could cause portions of the film to melt. To remedy this, I taped my Kapton to some scrap plywood.

Kapton should be taped to a rigid material

This changes how we use our material in the CNC. In an ideal world, we would just tell the machine how thick our material is, and it would adjust the settings appropriately. In reality, we need to work with the optics of the laser. The “material thickness” the machine asks us to enter is not true thickness. Rather, it wants to know the correct focal length for the laser to reduce kerf as much as possible. So even though I am using 0.1 mm thick Kapton, my Z-axis adjustment for thickness is ~4 mm. We would not want a laser cut Kapton soldermask that thick, it would apply too much solder.

First Cut – Using Defaults

The laser CNC I use is a ULS 60W CO2 machine. These machines come with a library of common materials and the required settings for each. Unfortunately, Kapton (or any polyimide for that matter) is not available in this library. Therefore, we need to get a starting place. I chose to start with the settings for another material and see how that performed. These settings were:

  • Power – 90%
  • Speed – 30%
  • PPI – 500

The result was ugly. The laser cut through the material vigorously. Edges of the Kapton are charred and curled. But is this good enough?

A gross laser cut Kapton soldermask

Taking a look through my 10x loupe, we can measure the size of the holes. The width of the rectangles in the following picture are exactly 1.778 mm in the vector file. Our measurement shows that the width of the cut holes are 2 mm. This is unacceptable.

This soldermask stencil melts the features too large

Second Cut

To combat the over-melted cuts in the first attempt, this time I am changing the speed setting. Now it will cut twice as fast, and the laser will linger less on each spot. For those keeping track at home, the updated settings are:

  • Power – 90%
  • Speed – 75%
  • PPI – 500

A slightly less gross laser cut Kapton soldermask

The initial result shows slightly less charring. In the picture, you can see the first cut to the left of the current one for comparison. But will it be enough?

This mask shows better size adherence

Looking through the loupe again, we inspect the feature size. Looking at the same feature as last time, we can see that the width of this rectangle is ~1.8 mm. This is close enough to the proper 1.778 mm that I cannot distinguish differences at this level of magnification. So we are good right? Wrong.

This stencil has issues with close parts merging

Checking another feature, a problem becomes apparent. Two pads of a header have melted unacceptably close together. If we were to solder this part on, the traces might contact each other. Clearly, the localized melting is still an issue, if only for very closely spaced pads.

The Third and Final Cut

For this cut, I lowered the intensity of the laser. Now, it will be cutting at 36 W instead of 60 W. I am also still using the faster cut speed from the second attempt. This puts our final score at:

  • Power – 60%
  • Speed – 75%
  • PPI – 500

A wonderful laser cut Kapton soldermask

I was very happy with this result. The Kapton was still obviously cut, but this time, few of the pieces fell away when I moved the sheet. I had to take a razor to individually pop out each pad. This might seem tedious for complicated boards, but I assure you that this is what we want. If the Kapton is just barely cut, the edges should be less deformed.

With the correct settings, our laser cut stencil allows tightly packed features

When we look at the pads which had issues last time, things seem to have turned out better. There is a clear distinction between the traces. This means that we are more likely to have successful solder paste application. If you intend to make a laser cut Kapton soldermask, I strongly recommend to start with the low settings I have used on this trial.

TB6612FNG Motor Control Board – Update

A few weeks ago, I posted about a circuit board I designed to use the TB6612FNG motor controller, seen here, and went through the steps of producing the board for prototyping in subsequent posts. Now that I have had enough time to work with the prototype board, I have made some changes to the design which should improve performance.

Diode Protection

The first major change in this design is the addition of flyback diodes to the motor out lines of the TB6612FNG. Schottky diodes were added which protect the circuit from sudden overvoltages going either direction, as seen in the schematic image below. As motors can act as inductors, especially when quickly switching direction, I found diode protection to be necessary. The TB6612FNG chip claims to have protection from overvoltages, but it does not specify the kind of protection it provides. The motors I will be using at times will be running at 12V with some hefty current. Since I want to avoid frying my little controllers, it seems natural to exert control over the situation by adding some diodes.

TB6612FNG Schematics

The diodes I picked for this design are NSR0530HT1G Schottky rectifiers. I chose to use Schottky diodes over traditional diodes as these have a low forward voltage to keep the motor running at speed. Additionally, I chose to use rectifier diodes over signal diodes since I am running motors at 12V. Overvoltage spikes which may occur are expected to exceed this, making the high voltage tolerance of a rectifier worthwhile.

As far as I am aware, most commercial TB6612FNG breakout boards do not include diodes. There is some debate about the necessity of diodes for all motor cases, especially when the controller claims to have built-in protection. If a user chooses to add diodes, it will have to be in circuitry in addition to the breakout board. In my opinion, it is easier to leave off diodes from a board if you don’t think you need them than it is to add them on later when you realize how much you do need them.

Extra Thick Traces

While running the prototype board through its paces, I found that the traces on my original design were too thin. I had one board pop a trace while giving myself a reminder of basic electronics and accidental shorts. So, on this updated version of the board, I have significantly increased the trace width using filled zones. As seen in the picture below, Any traces that will be carrying a load above simple signalling have been given filled zones.

TB6612FNG Circuit Layout

The above image omits the back side copper layer so you can see what’s on the front side. This image also shows off a little artistic flair I added in the top corner. On the front copper layer, there will be a tiny Open Source Hardware gear symbol. I had some extra room, so I could not resist doing something fun.

Electrolytic is now MLCC

The last design change is a bit more minor. I changed the 10μF capacitor from electrolytic to multi-layered ceramic. This change saves some board space. I was taught that for capacitors 1μF and above, I should use electrolytic, and I had never questioned this statement.  I discovered the reason I was told this while doing some light reading on capacitor materials.

Apparently, the idea that the electrolytic caps are better for large charges is a holdover from the dark ages of through-holes and Radio Shacks. The old disk ceramic capacitors could not be reliably produced above this capacitance threshold without great expense. As a result, the less expensive electrolytic capacitors became the standard for these applications. However, there have been lots of advances since then, including the ability to produce small, inexpensive, and reliable capacitors with various materials. Electrolytics are not necessarily better, they just remain in the electronics zeitgeist.

The Files

I hope you haven’t been squinting too hard at those pictures. If you intend to actually make use of my designs, use the real thing. I published this on Github. Grab a copy for yourself here.

DIY PCB Etching


Today, I will be showing you the DIY PCB etching workflow used in the lab where I am working. In the post last week, I discussed the design considerations for a TB6621FNG motor control board. This post will document how the physical PCB was created.

Previously, when I have wanted to produce a PCB, I used a fabrication service. For low-budget projects or personal projects, I used OSH Park. While this service is very cost effective for small prototypes, it takes several weeks for the board to arrive. In projects with a heftier budget where timeliness was an issue, I have used Advanced Circuits’ barebones PCB fabrication service. But what if the project is low-budget and in need of a quick turnaround? Easy: take fate into your own hands with a little DIY PCB etching!


For this project, you will need:

  • Inkjet Transferring Supplies
    • Inkjet Printer
    • Glossy photo paper
    • Lamination Machine
    • Scissors and tape
  • Etching Solution Bath
    • 1 parts (by volume) Muriatic Acid (12M HCl)
    • 3 part (by volume) 3% Hydrogen peroxide
    • Disposable container made of PE or PP
    • Hot water bath
    • Plastic tongs
  • Acetone
  • Personal protective equipment

Making an Inkjet Transfer

First, you need we prepare our PCB layout for a transfer process. If you are using KiCAD, this is very simple. Go to “plot” your PCB. When the small screen pops up (see image below), the option “mirrored plot” will be grayed out. So first, you must set the plot type to PDF. Then, the “mirrored plot” option will become available.

Note that I have selected to only plot the front layer of copper. Since we can only put a transfer on one side of the board, we can only select one layer at a time. Thankfully, the board I designed is single sided. Note that if you are also etching a back copper layer, you will not need to mirror that plot.

Now, we print four copies of my PCB onto a single sheet of glossy paper. It is important to make more than one copy when you produce a board, as sometimes not everything goes perfectly and you have to throw one of them out.

I wish I had information on the paper I used for this project. Unfortunately, my post-doctoral advisor just found some old stuff that was being removed from the department. The packaging of the ream of paper has no identifying information aside from the 90’s era IBM logo. So, I can’t help you pick the right paper to use. What is important to note about this paper is its glossy photo finish. When the ink is printed onto this kind of paper, the ink remains in a top layer of plastic instead of penetrating fully into the paper. This is thin polymer film is what we will use as the transfer.

Transfer of the transfer

Copper Clad source for DIY PCB etching.

Next, we cut out our prints and tape them upside-down to the copper side of an FR4 board. This material is called “copper clad board”. The material I used in this instance is pictured above. The part number is not available from that supplier at this time, but there are some other versions instead. See here. The type of tape you use does not matter much. I used brown packing tape, but most will be fine. Personally, I would avoid duct tape, because I suspect that would generate gross fumes and make a mess in the next step, but I have no experience to back this suspicion up.

The cheapo laminating machine.

Now, we take the prepared copper clad board and run it through a desktop lamination machine. While other methods for DIY PCB etching might call for a heat gun or hairdryer to affix the transfer to the board, we found that the laminator works best. The board is rotated and passed through the machine multiple times. For our particular materials and equipment, my advisor stated that the transfer must be passed through exactly 7 times, as this is the correct number to affix the transfer to the copper without melting anything.

The printed reverse screen is taped to the copper of the board.

With the transfer on the copper, we give it time to cool down. Once cooled to room-temperature, the board and paper are submerged into warm water. After a moment of soaking, the paper peels off cleanly from the copper clad board, leaving a nice clean transfer.

After washing the transfer paper off.

DIY PCB Etching

Now that our ink has been transferred to the copper clad board, we can begin etching. The etching solution is prepared by a volumetric mixture of 1:3 muriatic acid and hydrogen peroxide in consumer concentrations. Note that these chemicals can be substituted with ~12M HCl and 3% HOOH, should you be in a setting without the consumer versions I mentioned. As always, remember your safety rules. Add acid. This means that you should add acid to the hydrogen peroxide, not the other way around.

One way to accelerate a reaction is to increase the temperature of the solution. Since we are doing this in an inexpensive disposable PE or PP container, directly heating the solution with an electric heater or burner is impractical. Thus, the solution is floated in a hot water bath during the reaction. We used an ice chest which was on hand when we performed this reaction. This high tech etching bath is full of dangerous chemicals, so I recommend putting a lid on the reaction vessel.

High-tech DIY PCB etching bath.

Once you give the solution a few minutes to equalize in temperature with the water bath, you can place the board in the solution. The exposed copper will begin to bubble, and the solution will begin to turn green. After few minutes, the reaction should be complete. Keep an eye on it though. Once the copper is completely etched from the exposed board, remove it from the solution with your plastic tongs and stop the reaction by submerging the board in the water bath. If you leave it too long, the solution will begin to etch the copper you want to keep for the board.

A look inside the high-tech DIY PCB etching bath.


Now that the board is etched and the reaction has been stopped, we can clean up our product. In the image below, we can see that the copper has been completely removed from the exposed areas, but the ink from the transfer remains. This can be cleaned with acetone.

With the copper removed, and the transfer still on.

Use a minimal amount of acetone and a cloth to wipe the board. You may have to do some scrubbing, but the acetone does a good job removing the ink. This process should not be very difficult. Once you are done, you are left with a copper board that is complete.

Acetone washes the transfer ink right off.

Next week, I will be discussing steps I took to make the board from my DIY PCB etching ready for components.

TB6612FNG Motor Control Board


As part of a to-be-announced project I am working on, I ended up designing a new Toshiba TB6621FNG motor control board which is designed to be compatible with the Raspberry Pi. Before I began this design, the lab I am working in had been using controllers based on the Rohm BD6222HFP chip. This is a chip which is well suited to hefty 12V designs. However, we now need something more efficient and less expensive. The TB6612FNG chip is:

    • Less expensive (by ~$1 at single unit scale)
    • Requires more hobbyist friendly supply voltages ( 3-5.5V instead of 6-18V)
    • Provides similar output amperage compared to the Rohm chip.
    • Input current in standby (IIH) averages 35μA less.

    All this lead me to design around the new chip. Of course, breakouts from the usual suspects such as Sparkfun (seen here) and Adafruit (seen here) are available. Adafruit even provides an advanced version which is (in my opinion) over-specialized (see it here). So why did I reinvent the wheel in this case? Because the basic breakout boards are too limited and the advanced version is too limiting.

    Pi Woes

    The GPIO pins on the Raspberry Pi are a wonderful thing. They provide so much room for innovation. However, when you only need one or two specific pins, and those pins are scattered all over the GPIO, it is inconvenient and slightly expensive to design a board with the full 26 pin socket. Instead, selective use of 3-pin servo headers can be used at lower cost. The TB6612FNG motor control board I designed uses this type of design.

    Additionally, there is a problem unique to certain pins of our good ol’ GPIO friend. During boot, pins are not consistently pulled up or down. This can mean that a motor run by these pins may do strange things during boot. If one of those motors is controlling some sort expensive optics as in my case, this is to be avoided. There are a few work around options for this. It is possible to set up a cron job at boot which will set all of the pins to pull up or down, but this may be a challenge to a user with less bash experience. For my project, I need something that allows a user to run the device without worrying about the details. So I implemented a hardware solution. The GPIO pins are pulled down by 100k resistors on my TB6612FNG motor control board.

    An advanced setting was made available to divorce the chip ground from the motor power ground by way of a solder jumper.


    Pictured below is the schematic for my TB6612FNG motor control board. The project was designed with KiCAD.

    TB6612FNG motor control board schematics

    The picture below shows the layout of the board, omitting the back copper plane. I was able to fit all of the traces on one side of the board, so the B.Cu layer is mostly ground plane thermal relief.

    TB6612FNG motor control board copper layout

    Next week, I will show how I made the board.

Dissertation: Development and Applications of Chemical Sensors for the Detection of Atmospheric Carbon Dioxide and Methane

It is a new year, and my dissertation has finally made it past embargoes to publication. Allow me to present: Development and Applications of Chemical Sensors for the Detection of Atmospheric Carbon Dioxide and Methane. You can view the ProQuest entry here. There is a download link to the full text at the bottom of this entry.


Development and Applications of Chemical Sensors for the Detection of Atmospheric Carbon Dioxide and Methane


This is a description of the design of a low-power, low-cost networked array of sensors for the remote monitoring of carbon dioxide and methane. The goal was to create a scalable self-powered two-dimensional array for the detection of these gases in a large area. The sensor selection, electronic design, and data communication was studied and optimized to allow for multiple units to form a self-assembling network for acre-scale coverage with minimal human intervention. The final electronic design of the solar-powered units is flexible, providing a foundation for future field deployable remote monitoring devices. Sensors were selected for this application from commercially available models based on low-power, low-cost, market availability, detection range, and accuracy around the global baseline criteria. For environmental monitoring, carbon dioxide sensors are characterized near 400 ppm and methane from 2 to 200 ppm. For both gases, exertions up to several 1000 pm were examined to mimic large releases. An Xbee mesh network of radios was utilized to coordinate the individual units in the array, and the data was transferred in real-time over the cellular network to a dedicated server. The system was tested at a site north of the Oklahoma State campus, an unmanned airfield east of Stillwater, OK, and an injection well near Farnsworth, TX. Data collected from the Stillwater test sites show that the system is reliable for baseline gas levels. The gas injection well site was monitored as a potential source of carbon dioxide and methane leaks due to the carbon dioxide injection process undertaken there for carbon sequestration and enhanced oil recovery efforts. The sensors are shown to be effective at detecting gas concentration at the sites and few possible leak events are detected.

Reference Information

Subject Classification 0485: Chemistry
0486: Analytical chemistry
0494: Physical chemistry
Identifier / keyword Pure sciences
Carbon dioxide
Enhanced oil recovery
Remote monitoring
Author Honeycutt, Wesley T.
Number of pages 196
Publication year 2017
Degree date 2017
ISBN 9780355396188
Dissertation/thesis number 10276467
ProQuest document ID 1965485293
Advisor Materer, Nicholas F.
Committee members Apblett, Allen W.
Fennell, Christopher J.
Ley, M. Tyler
White, Jeffrey L.
University/institution Oklahoma State University
Department Chemistry
University location United States — Oklahoma
Degree Ph.D.


Here is a download link to the complete dissertation file: Dissertation.pdf

NOTE: This file is a 166.7MB PDF document. Since I am not a rich man, my website is hosted on a slow, inexpensive server. This download may take some time. It may be quicker to download from a library site, but I want to make sure the document is available to everyone.