Manufacturing PCB layouts made in KiCad

Up to this point I have made all my printed circuit boards at home, which is great fun and comes with a great sense of satisfaction when your circuit finally works. But it also takes a lot of time, expensive, and you have to deal with messy corrosive chemicals. But if you really like to print your circuit layout at home, check out how I did it here.

But now I am ready to outsource the manufacturing of my PCB layouts. One of my colleagues told me about this awesome community PCB manufacturing site called OSH Park, where you can get your layout printed at a very reasonable price. And they don’t require you to order a massive number of boards.

I finally finished laying out the component footprints and traces for my new and improved Gyro’clock circuit. Before doing this I ordered all the parts so that I can check them for reference while I am creating some of the custom footprints, and also I don’t run the risk of using obsolete parts after I have manufactured the boards. Here is what my finished design (all layers) looks like in KiCad

New and improved Gyro'clock layout in KiCad

New and improved Gyro’clock layout in KiCad

The 2-layer board is 6.2 cm by 2.9 cm. Not the ideal size I wanted, but I like how everything fits nicely. I chose the following design rules before doing the layout as per specifications on the OSH Park website:

  • minimum trace width: 0.1524 mm (6 mil)
  • minimum via diameter: 0.6858 mm (27 mil)

My default net class values used for all the connections are the following:

  • trace width: 0.2032 mm (8 mil)
  • trace clearance: 0.2540 mm (10 mil)
  • via diameter: 0.6858 mm (27 mil)
  • via drill: 0.3302 mm (13 mil)

I placed all the component on the top plane and made the bottom side into a ground plane, but had to route some traces through the ground plane. Altogether there are 41 vias on the board. A high number of vias, but most of them are ground connections.

In my 2-layer board there are seven layers that are important for getting the board manufactured:

  • top copper layer – contains component pads and traces on the top layer
  • top solder mask – contains regions in the top layer that will be exposed for soldering components
  • top silk screen – contains component references and texts on the top layer
  • bottom copper layer – contains component pads and traces on the bottom layer
  • bottom solder mask – contains regions in the bottom layer that will be exposed for soldering components
  • bottom silk screen – contains component references and texts on the bottom layer
  • PCB edges layer – contains the outline of the PCB board

To manufacture the PCB, OSH Park requires Gerber files for all the layers above plus a drill file. The following steps will explain how to create Gerber files in KiCad for OSH Park. I got these information from this blog, but changed a few options to suit my design.

Step 1: Verify DRC (Design Rules Check) with OSH Park specifications.

  • select DRC from the Tools menu or click the ladybug icon in the top bar. Fix any errors in the DRC before proceeding to next step

Step 2: Open the plot dialog box by selecting plot in the File menu or by clicking the printer with a P icon

Step 3: Select the following options in the plot dialog box

Plot dialog box options in KiCad

Plot dialog box options in KiCad

I used the ‘Subtract soldermask from silkscreen’ option to remove the silkscreen from areas where the holes in the solder mask will be. However, even if you didn’t do that OSH Park and most PCB manufacturers will remove the overlapping areas of the silkscreen. But it is better to check for yourself which parts of the silkscreen will be removed.

Step 4: Click the Plot button in the plot dialog box to generate the Gerber files.

Step 5: To open the drill file option box click Generate Drill File from the plot dialog box

Step 6: Select the following drill file options

Generate Drill File dialog box and options in KiCad

Generate Drill File dialog box and options in KiCad

Here, OSH Park requires you to ‘Keep zeros’, use ‘2:4 precision’ and use a ‘Minimal header’.

Step 7: After selecting the correct options in Step 6, click the OK button to generate the drill file which will be in Excellon format.

Step 8: Finally examine each Gerber file and the drill file for errors using the GerbView tool in KiCad.

Here are what my top and bottom side Gerber files look like in GerbView:

Top side copper, solder mask, and silkscreen Gerbers

Top side copper (green), solder mask (blue), silkscreen (white) Gerbers and the drills (purple)

The bottom side copper (green), solder mask (blue) and silkscreen (white) Gerbers

That’s it! I have submitted my board for fabrication to OSH Park, and it cost me $14.35 for three copies. I will add another post when the boards arrive. Meanwhile I have started work on my other spin-off project, which is to create a reflow oven to assemble the surface mount components into the Gyro’clock boards.

Fixing Keypad door entry – The solution

In my last post I talked about a problem I am having with an electronic keypad door entry unit. I have narrowed down the problem to the keypad interface, which is either worn out or in some other way not doing its job. The conductive traces in the keypad interface is laminated, making it very difficult to fix any broken traces.

So I decided to create my own keypad for this unit with a solid PCB and real push buttons. In making this PCB, the biggest challenge I am facing is reducing the overall height of the keypad so that it will neatly fit inside the original housing. To achieve a thickness close to the thickness of the original keypad I have made two design choices,

  1. Use surface mount push buttons instead of through hole push buttons.
  2. Remove the spacers from the original keypad membrane, which will go on top of the new PCB.

Instead of buying surface mount push buttons I decided to modify a bunch of through hole push buttons I already had. Converting the push buttons from through hole to surface mount was easy with a needle nose plier and a wire cutter. Afterwards, I took measurements of a transformed push button and made a footprint for it in KiCad.

Push buttons transformed from through hole to surface mount

Push buttons transformed from through hole to surface mount

The surface mount push buttons have a thickness of 3 mm, which is 1 mm shorter than the thickness of the buttons on the original keypad membrane. This means the push buttons should be able to fit inside the membrane buttons. However, I will have to carve out the insides of the membrane buttons to get the push buttons inside.

Spacers of the original keypad membrane, which will be removed in the new keypad to make room for the PCB

The membrane has spacers around it to fit the original keypad tightly inside the housing. With the spacers, the thickness of the original keypad (without the buttons) is 4 mm. With the spacers removed, the thickness of the PCB (without the buttons) with the membrane placed on top is 3 mm. This means that the new keypad should fit easily inside the housing.

Having figured out all the details I set out to make the PCB. First I made a simple schematic for the button connections in KiCad, followed by the layout. Since I will be using surface mount push buttons, I kept the components and traces all on the top layer.

Layout of the new keypad

Layout of the new keypad

The layout is very similar to the layout of the laminated traces of the original keypad, except I avoided a via since I didn’t want to go into a second layer. Three hours of work developing, etching, drilling and trimming later I had the PCB ready for soldering.

The new keypad PCB is ready to solder

The new keypad PCB is ready for soldering

Although I have had a bit of practice soldering  surface mount components before, this is my first time trying it on one of my own PCBs. I have stayed away from surface mount components before mostly because I didn’t have a soldering iron designed for surface mount devices. Also I didn’t have flux, which is the secret sauce to soldering SMT components properly.

I still don’t have these equipment, but decided to give it a go anyway since I didn’t really have a choice but to use surface mount push buttons. One of the biggest difficulties with soldering SMT components is holding it in place while trying to solder since you only have two hands to hold the soldering iron, solder and the component! Yes, I did consider melting the solder on the iron first and then bringing it to the component pad, but in the time it takes to do that, the flux inside the solder smokes away making it very difficult to make a good connection.

Thankfully, I had bought this PCB holder with alligator clips and it did a really good job of holding the push buttons in place while I soldered.

The alligator clip holding the push button in place while soldering

The alligator clip holding the push button in place while soldering

As it turned out soldering the surface mount push buttons wasn’t too bad. I found this more satisfying than soldering through hole. The solder did spread a little bit along the track since I don’t have a solder mask on my home made PCB.

The push buttons neatly fit inside the housing where the holes for the buttons are located

The push buttons fit inside the housing where the holes for the buttons are located

The next step is to solder a connector from the keypad PCB to the control PCB, where the processor is located. For the connecting wire I chose an old ribbon wire I found in my  collection of scrap wire, which had six wires – exactly what I needed! I soldered a female header to one end and soldered the other end to the keypad PCB.

Ribbon wire that connects the keypad PCB to the header of the main control PCB

Ribbon wire that connects the keypad PCB to the header of the main control PCB

After soldering all the components it was time to test the device. As expected it worked without any issues and with that satisfying feel of a real button press.

The final step is to put everything back inside the housing. In order to fit the membrane of the original keypad on top of the new keypad push buttons the insides of the membrane buttons need to be carved out. However, this task turned out to be rather difficult since the membrane buttons are strechy and didn’t flake off very easily.

After a few unsuccessful attempts, I managed to poke through one of the buttons with an X-Acto knife, partly removing it from the membrane. And then I had the idea to remove the membrane buttons from the membrane and then glue it on top of the push buttons. Removing the membrane buttons from the membrane was easy since the buttons were connected to the rest of the membrane with a very thin layer.

So I placed the new keypad PCB inside the housing using the rest of the membrane (without the buttons) and white electrical tape to insulate the traces from the metal housing.

The new keypad for the door entry unit installed

The new keypad for the door entry unit installed

My attempts to attach the membrane buttons on top of the push buttons were fruitless. I tried several different types of super glue and even double tape, but nothing would make the membrane stick to anything! May be it needs some special type of glue to make it stick, but at this point it is not worth it to try and find it.

After all the new keypad works better than the original, which is the main problem I set out to fix. Sure the buttons aren’t labeled, but that will make it that much harder for burglars to try to figure out the correct password.

How reliable is this new keypad? Only time will tell. But for now, it is fixed!

 

Music and Lights – the layout

I have finally finished designing the layout of the PCB, and I am very happy with the way it turned out. Everything fitted nicely on a 100 x 150 mm double-sided board. Here are some of my design guidelines before I started:

  • Keep the AC signals separate from the DC signals. Specially the speaker amplifiers.
  • Have a large ground plane and connect GND pins directly to it.
  • Place decoupling capacitors close to the respective device pins of the speaker amplifier and MCU.
  • Place the speaker amps symmetrically on the board to evenly distribute the heat.

And here is the result,

Front side of the Music and Lights PCB layout.

Front side of the Music and Lights PCB layout.

The smallest traces are 0.7 mm wide. The power rails are 1.5 mm wide. All the components are on the front side of the PCB except the speaker amps. The speaker amps will be heat sunk to the ground plane, so I placed them on the bottom side of the PCB.

I tried to line up similar components the best I could. It gives an aesthetic look to the board and actually makes it easier to mount the components and solder them.

Bottom side of the Music and Lights PCB layout

Bottom side of the Music and Lights PCB layout

The bottom side mostly consists of the GND plane. I had to put a few traces on the bottom side because they didn’t fit on the top side. Also this is the first time I am incorporating a filled zone into my PCB, and I am curious what challenges this will bring when I am going to etch the actual PCB.

One advantage of having filled zones, as far as etching is concerned, is that it reduces the amount of Cu needed to etch away. Also it reduces the amount of time needed for etching. But, because there are no filled zones on the front side I don’t think it will save me significant etching time.

One potential problem with having to etch filled zone is that it increases the chance of having unintended connections due to inadequate etching, since all the pads and traces are very close to the filled zone edges. I might increase the clearance a little bit more to reduce the chance of this happening.

Also here’s a 3D view of what the board will look like once its made and populated,

3D rendition of populated Music and Lights PCB. Note that some of the custom footprints do not show up in the 3D view

3D rendition of populated Music and Lights PCB. Note that some of the custom footprints do not show up in the 3D view

So I am onto the next step, making the PCB! I will keep you posted on that as well. Stay tuned and Thanks for reading!