Skip to content

Designing Microcontroller Development Board

hero shot

A microcontroller development board is a hardware platform designed to facilitate the development, testing, and prototyping of applications that use a microcontroller. It integrates the microcontroller itself with essential components and interfaces, making it easier for us to create and test embedded systems – minimizing the needs to use breadboard. The goal is to provide a convenient and accessible way to experiment with and implement embedded microcontroller-based projects.

In this week, the challenge is about learning to design your own development board. Lets go step by step!

Defining Design Requirements and Specifications

Before you can design your own PCB, the first step you need to do is to analyze and synthsize what are the requirements and specifications that you need. In order to know this, we have to answer several questions:

Target Application

What is the primary use case for the board? In this case, I’m going to make this board for development purposes, which means I will use this board for prototyping, experimenting with different components, protocols, peripherals, and interfaces. Since I might need to combine several input and output devices, I will need many pins and easy access to them.

Analysing MCU

Very important step! Learn the technical specifications of the microcontroller that we will be using. We can analyze through the MCU’s datasheet based on factors like processing power, memory, I/O capabilities, power consumption, and cost.

Since in Fab Lab Bali we have supplies of Seeed Studio’s XIAO MCUs, so I will be designing the devboard to be compatible with Seeed’s XIAO MCU series. The XIAO microcontroller series is incredibly powerful and offers a wide array of features in a compact design. However, this small size can be a limitation when using multiple peripherals, as it quickly runs out of available pins. At least among the XIAO mcu series, these are the ones that I have currently in hand:

Alt text

  • Pins: 11 digital pins, 4 analog pins, 11 PWM Pins, 1 I2C interface, 1 UART interface, 1 SPI interface, 1 SWD Bonding pad interface;
  • GPIO Pins working voltage: 3.3 V, voltage input connected to general I/O pins may cause chip damage if it’ higher than 3.3V;
  • Power pins: The built-in DC-DC converter circuit able to change 5V voltage into 3.3V allows to power the device with a 5V supply via VIN-PIN and 5V-PIN.
  • Battery usage: currently only supports battery power supply and cannot connect to Type-C while a battery is connected, as it may pose a safety risk

Alt text

  • Pins: 1x UART, 1x IIC, 1x IIS, 1x SPI, 11x GPIOs (PWM), 9x ADC, 1x User LED, 1x Charge LED, 1x Reset button, 1x Boot button
  • Has more analog pins
  • Same I2C, UART, and SPI pins as RP2040 except on the D7 pin
  • Input voltage: 5V
  • On 5V pin: can be used as a voltage input but must have some sort of diode (schottky, signal, power) between external power source and this pin with anode to battery, cathode to 5V pin.
  • Battery usage: When you use battery power, there will be no voltage on the 5V pin. Do not have a GPIO configured for the battery pin, his means, we cannot get the battery voltage at the software level by reading the analog value of one of the GPIOs. If necessary, you can consider connecting the positive and negative terminals of the battery to two of the pins to measure the battery voltage.

For this assignment, I’ll develop my board based on XIAO ESP32S3.


PCB Layout References

As a noob in electronics, I’m kind of confused how do I design my development board? What is the good practice? What should I consider? How does the ideal board layout look like? I took my time to research different kinds of development board out there and I found these two boards as the best ones, especially the Seeed XIAO Expansion board – which I’ll be using as the main reference for my board deisgn.

I found the Seeed’s one to be highly inspiring, it’s rich in peripherals, mini in size, very compact and easy to understand design & layout and a very complete documentation as well. However, while Seeed’s one seems like an ideal board design, I found that Seeed uses many specific JST connectors that are hard to find here and also will be hard to stuff and assembly as well. For that, I’m looking at Arduino UNO where it provides many analog and digital pins and uses vertical pin sockets.. which look simpler. So, I will base my layout design by combining the two.

Design Plan

Based on these references and also learning from the Quentorres board, this my design plan

Strategy

  • Make all GPIO pins of the XIAO available
  • Separate available pins into Analog, Digial, and PWM. Analog and Digital better to not place next to each other
  • One debugging LED and one button is enough
  • Breakout special pins for I2C and SPI communication, as well as FTDI for serial communication
  • Recommended to have many ground pin and 5V pin connections

Requirements

  • MCU: XIAO ESP32S3
  • Pinout: Make all pins of XIAO available
  • Additional I/O Pins: Analog (4 Pins)
  • Additional Power Pins: 5V (2pins), GND (2pins), 3.3V (2pins)
  • Communication pins: I2C-general (1), SPI (1), FTDI-UART (1)
  • Debugging tools: LED and button
  • Additional peripheral: OLED-I2C (1)

Layout Sketch

Alt text Alt text

Ideally, you should make a system diagram showing the wiring connection between each of your pin to the pin on the MCU. And at this step, you can also already should have a sense of what kind of connectors that you want to use and where you will be placing them.

PCB Design with KiCAD

KiCad is a free and open-source suite of EDA (electronic design automation) software. It consists of multiple interconnected tools, each designed for specific functions in the electronic design pipeline such as schematic design, PCB layout, and circuit simulation. For tutorials on how to use the software, here’s a great and easy-to-understand KiCAD tutorial that you can watch and a more extensive one here.

Install FAB Library

KiCad comes with a wide range of default libraries, but additional components are available, and you can create custom libraries. Fab Academy offers its own standardized components library for KiCad, tailored with components commonly used in the course and fablabs. To install it,

  • Download the FAB Library
  • Store it in a safe directory that you prepare for KiCAD libraries
  • Open KiCAD > go to ‘Preferences’ > ‘Manage Symbol Libraries

    Alt text

  • Click ‘Add existing library’ and select fab.kicad_sym

    Alt text Alt text

  • Do the same to add fab.pretty.

Schematic Design

Drawing Schematics

  • Open KiCAd > Select Schematic Editor

    Alt text

    This is how the workspace looks like when you first open it. These are the tools that you will be using the most

    Alt text

  • Add Symbols

    Alt text

    Search/browse the name of the component you want to include in the schematic. You can see on the same window box the schematic symbol as well as how the footprint of the component will look like. For example, here I’m choosing the XIAO ESP32S3 with a socket SMD pin.

    Alt text

    Another example: PinSocket 1x04

    Alt text

    You can also edit the value or specification of your symbol if needed, like the value of a resistor.

    Alt text

  • Add Labels

    Labels are used as a reference between one pin connection to the other pin connection. This is to minimize the wire lines in our schematic and make our schematic looks more clean, tidy and organized.

    Alt text

    Rename the label according to your need. Alt text

  • Add a wire connection

    You can just hover to the point that you want to make connection from, then a wire line will show up and you can draw connection to other component’s end.

    Alt text

  • Add no-connection flag

    Alt text

    Every pinout has to had connections, otherwise the ERC will send error messages if it can detect unconnected pins. However, there might be occasions when you don’t want to utilize a pin. You can add no-connection mark.

    Alt text

  • Run ERC (Electrical Rules Checker)

    Alt text

    When you’re done with your schematic drawing, you have to run electrical rules checker to check if all connection is right. After being checked, there can be errors and warnings. Ideally, you want to diminish all those issues, but generally the non-negotiables are the errors.

    Below, you can see there are 3 violations/errors in my schematic. You can read and also click on each error item to know what is the error.

    Alt text

    If you go back to the schematic workspace, the red arrows will point you where the errors are. In this case, I forgot to add power flags.

    Alt text

    So I have to add them.

    Alt text

    Once everything is fixed, you can perform the ERC again.

    Alt text

    If all is well, you can procees to next stage: PCB Editing!

  • Schematic Design Result

    Alt text

PCB Editor

  • Open PCB Editor

    If we already have the schematic design we can continue to the PCB Editor. Below is initially how the PCB Editor workspace looks like. You can access this page from the main page of KiCAD and select ‘PCB Editor’

    Alt text

    If we are still in the Schematic Editor workspace, we can just transfer our work to the PCB Editor workspace by clicking the ‘Open PCB in Board Editor

    Alt text

  • Arrange components

    The first time you load your schematic design to a PCB Editor, it will look like this. Basically what were shown here are all the footprints of the components that we have set in our schematic design.

    Alt text

    We just have to move the components around and arrange them based on our intended layout.

  • Setting Design Rules

    ❗ This is a very crucial step, we have to set Design Rules to make sure that our board design will be fabricatable based on the cutting tool and capabilities of our machine. For example, if the endmill we’re using is 1/64” (approximately 0.397mm), the minimum gap between traces or pads should be no less than 0.4mm. Then, to be safe and account for the offset and runout, a minimum clearance of around 0.42mm would be recommended.

    We need to set our design rules first, so when we run the Design Rule Check (DRC) in the Board Design interface, KiCad will alert you if you violate any rules we have set.

    To set our design rules we can go to Board Setup > Design Rules

    Alt text

    Constraints

    Alt text

    Modify the values of minimum clearance, track width, and connection width. Knowing the characteristic of our PCB milling tools and the fact I’m not that confident with my soldering skills, I set mine to this:

    • Min. Clearance > 0.6mm
    • Min. Track Width >0.4mm
    • Min. Connection Track Width > 0.2 mm
    Net Classes Value

    Setting net classes helps to make global adjustments for ‘Power’ versus ‘Signal’ traces. ‘Power’ traces should be wider (0.8mm recommended) to reduce electrical resistance and thus less heat generation. Not only that, wider power traces are easier visually to identify during debugging. On the other hand, ‘Signal’ traces should be narrower to minimize electrical noise (0.4mm recommended, or 0.2mm if we are confident with our soldering skills).

    Alt text

    We need to set 2 new Net Classes by clicking the + symbol. Then modify the value of track width of:

    • Power’ > 0.6mm / 0.8mm
    • Signal’ > 0.4mm.

    Leave all other default settings as is.

    Net Classes Assignments

    Next, assign the Net Classes based on MCU label names that we have created in Schematic design before.

    Alt text

  • Drawing Trace Lines

    Make the track line by use shortcut X or click symbol ‘Route Track’.

    Alt text

    You can see below that the design rules that we have set will be automatically applied when we make the trace lines.

    Alt text

    Handy tips

    • To move the component along with its trace line use ‘D’ shortcut on the keyboard.
    • ‘D’ can also be used to reshape trace lines.
    • To select all lines on the same track: double-click on trace segments (hold SHIFT to select multiple segments)

    Process of PCB editing:

    Alt text

  • Design Rules Checker

    If we are done layouting our PCB, next step we can go perform Design Rules Checker.

    Alt text

    DRC Check 1: Errors

    Alt text

    Initially, the check result showed that I still have 8 errors and 21 warnings in my board. It turns out that.. for whatever reason sometimes even though you already set Net Classes and Constraints it will not always automatically apply to our trace line.

    To fix this, we can just double click on the trace line and make sure we check the ‘Use net class / custom rule widths’ box.

    Alt text

    After that, I tried to fix other errors as well, such as providing more room and space between trace lines and components, because there are some warnings related to outside courtyard. Initially, I wanted to make my board compact, but that made everything very cramped, But I guess I’‘ll just make my board a bit bigger.

    DRC Check 2: Succes!

    Keep doing the process above until we got our DRC result free of errors like this:

    Alt text

  • Plot and Export

    Export the files by using the ‘Plot’ function and ensure the relevant layers are selected. For my design, this includes ‘F.Cu’ (copper layer) and ‘Edge Cut’ (PCB outline).

    Alt text

Result: PCB Design

Alt text

Alt text Alt text Alt text

PCB Production

Next is to produce the board by following the same workflows as I did in Week 4: Electronics Production.

PCB Milling

importncfile

Alt text

Milling Result:

Alt text Alt text

PCB Stuffing and Assembly

Process

Alt text

Production Result

Alt text Alt text

Surprisingly, there are not that many hassles I found when milling, soldering, and assembling my PCB. I managed to get it working in one try!

Testing

Now it’s time to test our board. Just open Arduino IDE and then I use the code that I’ve programmed on Week 6: Embedded Programming, and uploaded the code to the board.

Blinking Test

Button-LED I/O Test

Final Result

Alt text

Alt text

Design Files