The goal of this document is to walk through the design decisions I made when designing the 2022 electrical tutorial board. I hope it can serve as an example of the thought process that goes into designing a board (even one as simple as this!) and give some jumping off points for your own board design.
Define Requirements
First, I needed to establish the specific requirements of the board. Ideally, any board that meets these requirements would be an acceptable tutorial board. In this case, I came up with the following:
It must be simple. We want members to be able to easily understand and recreate the design.
It must be cheap. We are effectively giving away the parts for the board to new members, we don’t want to spend a ton of money on each one.
It must showcase a variety of components to be used in the software tutorial. In particular, there must be at least one LED, button, and variable analog input.
It must be easy to solder. In many cases this will be members' first time doing surface mount soldering.
High Level Design
Now, it's time to figure out how I’m going to meet the requirements. Zach made a very nice tutorial board in 2020 that I’m taking inspiration from, and he picked out the PIC16LF15313 as the main microcontroller. This is a super cute PIC with only 8 pins and it’s worked great so far, so I didn’t have any reason to switch it up. This gives us 5 pins to do fun stuff with.
I can immediately allocate one pin to an LED and one to a switch. To satisfy the analog input requirement I can just use a potentiometer between 3V3 and GND, so that’s the third pin gone. Zach mentioned wanting to add a variable-frequency piezo buzzer controlled by PWM and that sounds fun, 4 pins. Since I didn’t have any other great ideas for the last pin I figured a second LED could be useful. Having two LEDs is also nice since two of the pins are shared with the programming circuitry, so I didn’t want to have anything that could interfere (like a pot or buzzer) on them.
The last thing to figure out is how we’re going to power this thing. Zach’s tutorial board last year had a coin cell battery but it was a real pain to solder and I wanted to teach people how to use the bench top power supply, so that’s gone. One option is to just power it through the programming connector, which already breaks out 3V3 and GND so that the PICKit3 can power it while programming. Unfortunately, we have another programmer (the Snap) that can’t power the board using those pins (but still takes them up!) so we needed another connector for just power. I figured screw terminals are a pretty common connector on the team and are reasonably cheap.
Just a quick comment on how each requirement will be met:
Simplicity - we are using an 8-pin PIC and very simple external components (LEDs, button, buzzer, pot) so the schematic is pretty simple.
Cost - the PIC is pretty cheap and we can select cheap resistors, switches, buzzers, etc on DigiKey since we don’t have very strict requirements on them at all.
Variety - yep.
Solderability - the PIC is a nice SOIC package, most of the other components are through-hole, and we will use 0805s and 1206s for the passives and LEDs.
Making the Schematic
I started by copying Zach’s 2020 schematic, which had the PIC and its passives along with the programming connector all ready for me. LEDs are nice and simple, I aimed for 5-10 mA using resistor values we already had in the bay for simplicity and to not overstrain the PIC. I also glanced at the PICs datasheet and saw it had configurable internal pull-up resistors, which makes the switch a simple pull-down to ground.
The buzzer was the first tricky thing to figure out. To choose one, I sorted by lowest price on DigiKey (with applicable filters for the type) and chose the first one with decent stock. Its datasheet gives a couple of ways to drive it using transistors, but I didn’t want to add all that complexity. It also offhandedly mentioned that you could drive the buzzer from a microcontroller with a 1k-2k resistor in series, which I didn’t particularly trust off the bat. After some searching around for how Arduinos do it (“Arduino” is a great keyword if you want to learn how to abuse a microcontroller), it seems like this was actually a pretty common method, so I went for it. Here’s hoping it’ll work.
Last up was the potentiometer. Here, my selection was actually limited mostly by which ones KiCad had built-in footprints for since I really didn’t feel like making a custom footprint. I found a pretty cheap option in stock fairly quickly, and I was off to the races. I also realized that when people are figuring out how to set up the ADC they are going to want to know what the correct voltage is, so on went two test points (one for the value and one for GND). Never forget your GND test points kids!
With that all done the schematic was topologically finished, I just needed to make it pretty. This is as much of an art form as it sounds, I don’t have too much advice other than to space stuff out and leave 2 grid units of wire around all corners. Here I also added some text notes explaining the slightly less obvious stuff (see the schematic for the exact notes). Note that on a non-tutorial schematic I probably wouldn’t explain stuff like the LED current calculation or the circled programming connections since most people on the team will be familiar with all that.
PCB Design
After assigning footprints (based mostly on DigiKey stock and what KiCad has built in, I had to model the buzzer as a capacitor) it was onto PCB layout. Here again I could get a bit artsy, although depending on where a board needs to integrate your choices may be more constrained.
I started by laying out the rough positions of the major physical parts: the programming connector, power connector, buzzer, switch and pot. I wanted you to be able to hold the board with two hands like a tiny game controller and operate the inputs, so the button and pot naturally went in opposite bottom corners. I also thought about how the board would work when plugged into both the power supply and your computer for programming, and so I didn’t want the programming connector and power connector right beside each other. It looked nice and symmetrical to have the programming connector centered at the top and then the power connector and buzzer in opposite top corners, so that’s what I went with. I spaced the components out to give enough space for the rest of the electronics and the board shape was defined.
I then finalized the board shape in KiCad (giving it nice pretty rounded corners!) to fully constrain my work. I could then fiddle with the exact positions of those major components to make sure they were nicely aligned and symmetrical. Up next was getting the rest of the components placed, this was a matter of trying a few arrangements and seeing which ended up with the least tangled rats nest (the white lines KiCad shows you for missing connections) and then again precisely aligning everything for symmetry. You don’t have to make your board nice and symmetrical, but I had a lot of space to play with and wanted to have fun.
As part of finalizing the layout I also figured out what silkscreen decals I wanted, since you can’t have the silkscreen overlapping anything. I decided to fill some empty space on the front with a small logo, and put the full size logo and team name across the back. I also added info about the board (name, nickname, author, date) in silkscreen text along the back. Lastly, I added a label on the programming connector marking which pin is MCLR (ie the orientation to plug it in) and the voltage, and also marked the pinout of the terminal block.
I forgot at this point, but you should also think about mounting holes in the layout phase. The tutorial board doesn’t need to get mounted to anything but I later went back and added in an M3 hole for stuff like attaching it to a backpack.
Lastly, routing! Once again I spent way more time getting it to look nice that necessary, but I’m pretty happy with the result. For this board I wanted to avoid traces on the back at all cost (since I had the pretty logo and text there), which ended up being totally fine except for one overly wiggly trace. General routing principles apply (no right angles, try not to cross wires, use filled zones) but I don’t have anything to add to the tutorial itself.
TLDR - Jack’s board design process:
Define requirements.
Make it pretty.