Skip to content

Week 8: Electronics Production

Our assignment:

Group Assignment: 1. characterize the design rules for your in-house PCB production process 2. submit a PCB design to a board house

Individual Assignment: 1. make and test an embedded microcontroller system that you designed


Group Assignment

Find our group assignment documented in full here and my documented learnings below.

Our lab's machine for CNC milling is the Other Mill Pro.

othermill

Our lab's CNC milling machine

Characterizing our in-house PCB production process

To characterize our machine, we used Neil's line test. See group page for more images.

Within the Bantam software itself, it previews a lot of what the machine's milling tools can and can't do. We have 1/16'', 1/32'', and 1/64'' Flat End Mills and we have PCB engraving bits at 0.005''. Essentially, as the milling tool gets smaller, it can mill smaller and smaller lines. The PCB engraving bit could cut even smaller -- it is a V-bit tool and that shape affects how it cuts. Also, it's good practice to use the 1/16'' flat end mill for edge cut layer so as not to cause strain on the other tools.

Overally, the standard set of 1/16'', 1/32'', and 1/64'' Flat End Mill milling job didn't have reliable lines until it reach at least 0.10'' whereas the PCB Engraving bit paired with the 1/32'' could cut a few degrees smaller.

linetest

Uploading and milling the line test file was simple. First I converted the PNG image into an SVG file using Inkscape. Then I uploaded the SVG file into Bantam Tools and set it up to be milled with the two different milling tool arangements described above.

When Castor deburred and cleaned the line test prints, this showed which lines could withstand deburring.

This process and practical experience with the workflow from designing boards in KiCAD, printing, and soldering helped me get a feel for being minful of trace width and placement. More of these lessons documented in my individual assignment below.

Submit a PCB design to board house (showing workflow)

Castor and I both practiced with submitting our own PCB designs to a board house.

I looked into PCBWay's website. The basic workflow:

  • Calculate estimate cost by going to "PCB Instant Quote" page and and select specifications for PCB based on your design. Click "save to cart"
  • Create Account and Verify Email (or login if account already exists)
  • Attach Gerber Files and submit the file
  • Wait for files to pass review process
  • Make payment and process order

PCB Way website

PCB Way website

PCB Way website

Inputting specifications for cost estimate

PCB Way website

Cost estimate for board and stencil

PCB Way website

Cost estimate for board itself. Minmum purchase of 5 boards required for this

PCB Way website

Uploading gerber files and awaiting review before payment

I didn't actually intend to purchase this so this is as far as I got in the workflow for this website.

Making and Testing my PCB (LED Circuit Board)

Another week, another software program to download! In our lab, we use the Legacy Bantam Tools Milling Machine software. This software supports EAGLE (.brd), Gerbers, SVG (.svg), and G-code (.nc, .tap, .gcode). Their linked documentation and Sparkfun's PCB Basics page offered me preliminary resources for this assignment.

First, I'll document my successful attempt at making an LED circuit board with a push button. Originally, I worked on my ping pong game board designed in Week 6 which I made good progress on but I didn't get to reliably work yet.

Circuit Design
On Wokwi, I selected a simple LED circuit board with a XIAO-ESP32-C3 microcontroller. I added a button component and referred to the provided template code by urish and I referred to Arduino's button code template to edit the code so that the LEDs start flashing in order whenever the button is pressed.

wokwi LED

Circuit working in Wokwi

Next, I designed the PCB in KiCad using components in the Fab Lab plug-in library.

LED kiCad schematic

Schematic of circuit in KiCAD

LED kiCad PCB

PCB design in KiCAD. Castor showed me how to add text! For this one, I decided to add routes for ground rather than fill in the board with ground plane to see how that would impact my soldering experience

Code created from a reference on Wokwi's template by user urish and Arduino's button code template and created by angela for Fab Academy learning purposes

    const int buttonPin = 10;

    int buttonState = 0;

    void setup() {
    pinMode(buttonPin, INPUT_PULLUP);

    Serial.begin(115200);
    pinMode(D2, OUTPUT);
    pinMode(D3, OUTPUT);
    pinMode(D4, OUTPUT);
    }

    void loop() {

    buttonState = digitalRead(buttonPin);

    if (buttonState == LOW) {
    Serial.println("Red");
    digitalWrite(D2, HIGH);
    delay(500);
    digitalWrite(D2, LOW);

    Serial.println("Green");
    digitalWrite(D3, HIGH);
    delay(500);
    digitalWrite(D3, LOW);

    Serial.println("Blue");
    digitalWrite(D4, HIGH);
    delay(500);
    digitalWrite(D4, LOW);
    } else {
        digitalWrite(D2, LOW);
        digitalWrite(D3, LOW);
        digitalWrite(D4, LOW);
    }
    }

To upload code I had to install the ESP32 board on Arduino IDE which I did by following the instructions on this forum.

Preparing Files for Milling
To get started in Bantam Tools, I would need to generate a Gerber file from my design on KiCad from Week 6. Their documentation here walks through how to do this.

Go to file >> fabrication outputs >> Gerber (.gbr). Then select the layers to include. In my case I just needed the top layer ("F.Cu"), and the Edge.Cuts layer. After making needed selections, click "Generate Drill Files" to pull up that menu and make selections. Click "generate" and it will create a drill file in the folder location specified. NOTE: unless there's a reason the keep them separate, it's typically fine to select "PTH and NPTH in single file" which generates just one drill file for any "plated through hole" and "non-plated through holes." Close out and now click "Plot" to create the files for the specified layers. It's really convenient in Bantam Tools because whenver I need to update the PCB design, I can just re-generate and re-plot and the file management is smooths as it saves over the previous version.

gerber

The settings for my Gerber file exports

Next, I upload the board in Bantam Tools selecting the top layer, skipping the bottom layer since it's a one-sided board,, selection the edge cut layer for outline, and selecting the drill file for holes. I decided to mill two boards at once just in case I had errors with soldering.

With caliphers, I measured the board with a piece of fixturing tape to account for thickness (it's ~1.5mm). I also set width (x) at 127mm and height (y) at 101.6. In my first design my board was actually bigger than what the machine could mill.

Another step was to offset the milling job 4mm from the X and Y axes to give some clearance and not mill too closely to the edges.

Selecting the milling tools, I chose 1/64'', 1/32'', and 1/16'' Flat End Mills. This range would go small enough to cut some of the finer details (like the text! but it couldn't quite get it but no worries because that's just for fun aesthetics) and big enough to make the print more efficient. Also that 1/16'' is needed for the edge cut layer becuase its more wear on the smaller end mills to complete. Once this was complete, I was ready to begin milling.

bantam LED

My LED board in Bantam Tools

Milling my Board Bantam Tools walks you through the process really nicely.

But first, ensure the area is clear, the milling bed is clear and smooth, the machine has been "homed," and one big one is to make sure the the clip on the edge bed isn't stickig out because that could cause damage. Flatness is key! User scraper tool to make sure there is no gunk/defects.

Next apply our doublesided tape to the material and carefully place on the bed. Now click "Mill all visible..." button to start the process. Follow prompts for changing out the milling tools.

wrench for changing milling tools

Changing out the milling tools after prompted (this was actually during my ping pong board mill)

When the machine is finished, use the scraper to remove the board and extra material (the tape holds it down pretty securely), and remove. You can hit "loading" in the Bantam software to bring the bed forward. Make sure to vaccuum out the machine so it's ready for the next person!

milling LED

Milling LED board

milling LED

Milled LED board after unfixturing from the bed

Now, it's time to deburr to remove the excess dust and give it a clean finish. We don't want any sneaky bits of copper causing circuitry issues! For this I used a coffee filter and then a toothbrush and alcohol. Could also use a ruler and 1500 sandpaper.

deburring LED

Board after deburring

milled LED

The board is ready for soldering!

Learning to Solder
Before all this, I spent some time doing learning to solder on practice boards.

practicing solder

Practice board for soldering! I used a clamp to hold in place. Learned how to set temperature for the soldering iron (between 350 and 400 degrees celsius). Technique for placing components. How to "tin" the soldering iron so that solder can flow better. How to use the flux pen to help flow.

This and many failed attempts at my ping pong board (see below) helped me get in some good hours of practice.

Soldering my Board

While soldering, I learned some helpful tricks with using the Multimeter.

You can test for continuity to make sure the soldering of components was successful by turning the multimeter to the continuity setting. I also did this to ensure there weren't any accidental bridging to other routes (which I did a lot on the ping pong board).

You can also test the LEDs by setting the multimeter to diode mode and touch either side of the diode. With the correct orientation (negative probe to ground), the LED will light up a bit and helpfully show the color. After soldering LEDS on you can also test the continuity in a similar method by selecting the pin its connected to and a later point in its route. The multimeter won't beep, but the LED should slightly light up.

soldered LED

soldered LED 2

The board after soldering and uploading code

The Final Result!

My working LED board!

Making and Testing my PCB (Ping Pong Game Board - Still working on debugging!)

Before making the LED circuit board documented above, I attempted to may a ping pong game board. Couldn't quite get it to reliably work. However, some lessons learned:

  • Ensure layout of components in KiCAD fits within a 100mm x 125mm rectangle (which I can put in KiCAD for reference). That is just about the max size for the board that can be milled with our machine.
  • Keep in mind an offset from the orgin which we set to 4mm in Bantom
  • Board set-up!! The defaults in KiCad aren't what I want. How I set up constrainst and Net Classes will impact how I can layout components and how easy or difficult will be for soldering. I can optimize constraints for myself since I am a beginner at soldering and not the most precise. I set via diameter of 0.6mm
  • Improving design - I found out I needed to 1) get the correct size pinout for the OLED screen so the legs would fit without bending and 2) switch out the potentiometers for single-gang slide potentiometers for better gameplay. I tested the new potentiometer out on Wokwi, updated components and PCB design on KiCad, and uploaded into Bantom. FYI found this page on potentiometer footprints on KiCad, I found the data sheet that confirmed the Bourns single-gang slide potentiometer, 60mm travel matched the components we had in the lab. For guidance on the correct footprint for the OLED screen, I prompted Deepseek and had to clarify that the OLED display I was using was a breadboard-compatible pin pitch since there are multiple versions of the 0.91'' OLED: "I am designing a PCB in KiCad for a 0.91'' 128x32 OLED display. The module has a breadboard-compatible pin pitch. What is the correct KiCad footprint library and pitch, and what are the steps to measure it with calipers to confirm?" As a result, I updated that footprint to "Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_Vertical" and verified this was the correct distance by using digital caliphers to measure the distance between pin1 and pin4 on the OLED and dividing by 3.
  • Debugging! See below for practice with this

Here are some snapshots of progress on the ping pong board:

soldered LED

Running simulation on Wokwi with new sliding potentiometer components

pong board 1

printed board for original ping pong design

OLED error

the legs didn't fit! had to bend them inwards to solder

pong board fail

Some overly heavy handed soldering and I messed up one of the potentiometer connections! Between bridging to ground repeatedly and desparate attempts to use the solder wick to start again and one of the traces breaking, I had to give up. I salvaged the components thought! Still, the game should've booted up in theory but the OLED screen did not light up even though the Nano board showed it was working.

updating PCB

Updating PCB i KiCAD to swap out potentiometers and the pin holes for the OLED. This was much easier to route which was nice!

updating netclasses

Updating net classes in KiCAD's board set-up to make bigger via size and track width. With the hopes of easing the soldering.

pong board 2

My updated ping pong board! Included special tape that would prevent the potentiometer from touching the ground plane (except at the pin where we want it).

mm pong

checking power to GND connection on OLED -- it's getting close to 5V so that didn't seem to be the issue. But then when I measured the voltage of SDA and SCL pins it was only around 1.9 V. Turns out.....

bridge

Did more troubleshooting with multimeter. Discovered this bridge between SDA and SCK pins of the OLED which would explain why the screen still wouldn't turn on

glitchy board

Eventually, the screen and game finally started to work! But it kept glitching. So, I set out to further investigate..

oscillator on pong

Will help show me how to use oscillator to troubleshoot. While using the game worked intermittenly but still had challenges. Here, we saw that it's takign a long time to get to the voltage level

oscillator on pong

Here, we observed a lot of noise. Power going in to screen is rippling. Could we need a capacitor to hold a well of charge to address?

screen test

Eventually the screen went back to not turning on at all. I plugged it into a breadboard circuit to make sure the screen wasn't the issue but this worked fine. And I ran a simple LED blink code to the Arduino Nano to confirm it was still receiving code

Ultimately, I had to move on from this for time's sake. Some things to consider:

  • Add more trace clearance in PCB design and try to route ground rather than fill it. This will ease soldering mishaps and lessen options for debugging. Big ground planes could create more opportunities for shorts
  • Alternatively, consider thermal relief pad vias to help with better sodering to ground plane
  • Consider using a 1206 capacitor between the PWR and GND of OLED pins
  • Consider orienting components so they can be fixed on the bottom side of the board

Design Files

Link to design files