A few months ago I designed and assembled my first PCB featuring multiple SMD components. It essentially is a scaled down pinball machine controller board featuring eight high power outputs, eight LED outputs, and a four by four input matrix. And all of that crammed onto a 10 by 10 centimeter PCB.

Features

I designed this PCB as part of a project named Test-Case, for which I needed a small pinball machine controller. The design of this board is based on the Arduino Uno and Adafruit 16 cannel PWM LED driver module. This meant that the board would at least feature an ATmega328P microcontroller and a PCA9685 PWM LED controller.

To drive the high power outputs, I used IRL540N MOSFETs. The board can have up to eight of these MOSFETs. The MOSFETs are driven by the PCA9685 PWM LED controller. The remaining eight channels on the PCA9685 are used for driving the LED outputs directly.

The controller board has the following features:

  • A +5V power LED
  • A heartbeat LED
  • An ATmega328P microcontroller
  • A PCA9685 PWM LED controller
  • Up to eight IRL540N MOSFETs
  • Eight dedicated LED outputs
  • A four by four input matrix

Front

Back

Design

I designed this PCB using KiCad. Drawing the schematics for this board did not take too long as I could use the schematics of the Arduino Uno and PCA9685 module as inspiration. The only parts I had to add were the switch matrix, the MOSFETs, some resistors here and there, and a whole lot of connectors. KiCad already had all the footprints I needed for my design, which saved me quite some time too.

Drawing the board itself took much longer. It looked like all the parts would fit on a 10cm by 10cm PCB. It took some weeks of moving and rotating part footprints to make it all fit, and it eventually fit pretty nicely.

Production & assembly

This is the first board I designed which needed a stencil and solder paste during assembly. Working with a stencil, solder paste, and small SMD parts always felt a bit daunting and exciting at the same time, but it worked out really well. I would even go as far as to call it easy.

I had the PCBs and stainless steel stencil made by JLCPCB. I used Chipquik TS391SNL10 solder paste and a Quick 861DW ESD hot air solder station to solder the SMD parts.

Soldering SMD parts with solder paste and a hot air soldering station is, surprisingly, quite a satisfying thing to do. The components will start floating in the liquid tin and will align themselves nicely with their pads. At least, until you move to close to some of the smaller parts and they fly off the board because the air stream is too strong…

Sections

Arduino Uno

This is the brain of the controller. It should have a ATmega328P microcontroller, just like the Arduino Uno. I accidentally ordered the ATmega328 instead of the ATmega328P. Luckily, these parts are pin-compatible. However, this specific device is not supported by the Arduino IDE out of the box. I solved this problem by installing MiniCore, which adds support for the ATmega328 microcontroller, amongst many others, to the Arduino IDE.

In addition to the microcontroller there is a 16MHz ceramic resonator, a reset button, and a few capacitors. All pins of the ATmega328P are broken out via standard pin headers which have the Arduino pin names next to them. The UART and I²C pins are also exposed via their own dedicated connectors which also carry +5V power.

And then there is the most important connector: The ISP connector. It is used to program the microcontroller. The standard Arduino bootloader can not be used on this board as it lacks the reset circuitry which can reset the microcontroller via the UART connection. This means that this board always requires an external programmer.

Arduino Uno section

LEDs

The controller has two built-in LEDs. One is a +5V power LED which will turn on once power is applied. The other one is a heartbeat LED, controlled by the microcontroller. This LED can be used to indicate that the processor of the microcontroller is still running.

LED section

Input matrix

The controller has a four by four input matrix. The matrix is completely optional. Any row or column can be left off the board, in which case they free up pins on the microcontroller.

Input matrix section

PCA9685

The controller features a PCA9685 PWM LED controller for driving LEDs and MOSFETs. The PCA9685 is connected to the microcontroller via the I²C bus. The controller has six solder bridges which can be used to change the PCA9685’s I²C address.

PCA9685 section

MOSFETS

The controller can have up to eight IRL540N MOSFETs. The MOSFETs are driven by the PCA9685. All MOSFETs are optional and will free up an additional LED channel on the PCA9685 controller.

Each MOSFET has its own connector and flyback diode. The first and second MOSFETs can be used to drive a flipper coil, which usually has two separate windings. The same can be done with the third and fourth MOSFET.

When the controller has to drive a flipper coil, a single three-pin connector can be soldered to the board, instead of two separate two-pin connectors.

MOSFET section

Final notes

During assembly I found some small things that I can improve on in a future design. For example the clearance around the screw holes could be a bit bigger. Also, the ground plane has one major bottleneck in the middle of the board. This probably won’t a problem as all high current stuff is close to the power connectors.

On the other hand, there were also things I really liked. For example, labeling all pins of the ISP, UART, I²C, and power connectors. This really helps creating the cables to connect everything. Just look up the pin order on the board.