Tutorial: Pi Top Module PCB creation


The Pi Top is becoming a popular platform for software development using the Raspberry Pi (RPi) singleboard computer. However, interfacing hardware to the Pi Top can be challenging, since the hub does not conform to the layout of the familiar RPi GPIO header. The former has 34 pins, the latter 40 pins. Guidelines for developing custom circuit boards that plug directly into the Pi Top hub are therefore relevant. Hence this tutorial.

The purpose of this tutorial is to give the reader a basic understanding of the steps involved in designing a simple printed circuit board (so called Pi Top Module) for the popular Pi Top Raspberry Pi platform.

Why would you need a customised printed circuit board in the first place?

Currently there are not many options in the market for Pi Top Modules. Anyone interested in exploring specialised integrated circuits, sensors etc. therefore need to tweak the few boards that are actually available. The basis for this tutorial is to attack the problem from a proper engineering perspective and customise the plug in hardware for the Pi Top hub.

Design basis

Design objective: to create a simple plug in module (Pi Top Module) that allows user-interaction via pushbuttons, LEDs, and a buzzer.

Starting from scratch

Start by reading the design rules from your printed circuit board manufacturer. I have good experience with iTEAD – among other of the low-cost manufacturers – so their design rules apply in this case.

Next, download and install DipTrace along with the 3D models.

DipTrace Schematic walk-through

Start DipTrace Schematic. First, go to File, Titles and Sheet Setup, and select an appropriate sheet size. For Europeans that would be A4 (297 mm x 210 mm). For US residents, letter size A (11 in x 8.5 in) would be default:

Sheet size setup


Click the pane Title Blocks, select the drop-down menu Bottom-right, and choose ANSI (BR):

Title block setup


Select All Sheets in the Apply Settings To drop-down menu.


Your sheet now looks like this:

Fresh sheet with title block


Enter project details in the title block:

Modified title block


Click Objects, Find Component, select All libraries, and enter 951234-7622 in the box titled Name:

Component search


Then, click Apply filter. The search may take some time. Click on the blue highlighted component on the left hand side and place the component on the design area. Cancel the search filter.


One match to the search query:

Component search result


Zoom in on the component. It has 34 terminals labelled 1 through 34. Each of these has a corresponding connection in the Pi Top hub:

34-way header placed in design area


Note, the official documentation for the Pi Top hub designates pin 1 as PWR, whereas pin 2 is 5V0. However, due to a component rotation and side-change, which will happen, when we get to laying out the actual printed circuit board, the rows should – in my opinion – be flipped on the Pi Top Module connector, i.e. pin 1 becomes pin 2 and vice versa. The reason for this will become clear later on.


Right click the first pin, select Add to Net, and click the blue plus sign:

Add to net dialogue


Name the net and click OK:

Naming the net


Check “Connect without wire” and click OK:

Net connection dialogue


Now, the first pin is connected to a named net:

Pin 1 connected to a net


Repeat the procedure for the other pins until you have this pin to net relation:

Nets assigned to header pins


Note that pins 2, 3, 4, and 6 are unconnected. We will use net port symbols for these instead of connecting by name.

Go to the Net Ports library and add symbols for +5V, +3V3, and GND:

Net port symbols placed on design area


Copy the +5V symbol, paste it, right click, and rename to PWR.

Renaming net port to PWR


Repeat and create another one labelled 3V3P:

All net ports defined


Now, disconnect the first pin from the VCC#5V0 net (!) and connect the pin to the +5V net port in stead:

Net port connected by wire


Right click the wire and rename it to VCC#5V0:

Renaming net


Right click the wire again, choose Properties. Select Connect nets by name, check Global nets for hierarchy, and click OK:

Configuring net as globally available net


Hover over the wire with the mouse cursor. It should read VCC#5V0 (Global). Do the same for the other four net ports: PWR goes to pin 2, 3V3 goes to pin 3, 3V3P goes to pin 4, and GND goes to pin 6:


Net ports connected, renamed, and properties adjusted to global nets


That concludes setting up the header that connects to the Pi Top header and transfers both power and signals between the RPi and your custom circuit board.


Next, right-click the pane that says Sheet 1 and rename it to main_01:

Renaming sheet


Right click the pane again and select Add. Rename the second sheet to 02_LED. Right-click the second pane and choose Hierarchy Block under Sheet Type:

Second sheet created and transformed into hierarchy sheet


Create another two hierarchy sheets labelled 03_button and 04_buzzer, respectively:

Three hierarchy sheets created


Go the second sheet, 02_LED, and place an LED_10R_Red from the library Optosensors & LED onto the design area:

LED component placed


Add two RES_1206 resistors from the library Discrete SMD. Finally, Go to Objects, Find components, and search for an MMBT2222A transistor. Place it on the design area as well:

Components placed on design area


Rename the LED to LED instead of D1 and rotate the components using the space bar key:

Components rearranged


Connect the components by wire:

Components wired together


Go the 01_main sheet and copy the net port symbols for GND and +5V, paste them onto the design area on sheet 02_LED, and connect to the appropriate terminals:

Power net ports connected


Add a hierarchy connector and wire it to R1:

Hierarchy connector wired


Rename the hierarchy connector to LED#X:

Hierarchy connector renamed


Modify component properties and markings as to reflect important component properties in the schematic:

Components with RefDes and Values visible


That concludes the LED hierarchy sheet.


Go to the 03_button sheet and add a B3S-1002 pushbutton, a resistor, net ports for VCC#3V3 and GND, and a hierarchy connector:

Pushbutton and related components placed onto design area


Wire up the components and rename the hierarchy connector to button#Y:

Pushbutton components wired up


That concludes the pushbutton sheet.


Go to the 04_buzzer sheet and add a CSQ-706BP piezo electric buzzer, a 2N2222 transistor, a 1206 resistor, a 1N4148 diode, a hierarchy connector, and net ports for GND and +3V3 (hint: you used some of the components previously).

The general-purpose silicon diode you choose should have the 1206 land pattern. You can change that by right-clicking, search for the DIO_1206 pattern, and associate it with the component.

The design area should now look like this:

Buzzer related components placed


Wire up the components and change properties, so you get:

Buzzer components wired up


That concludes the buzzer.


Now, go to the main sheet and click on Hierarchy Blocks:

Available hierarchy blocks


These are the three hierarchy sheets we created. Add five of the 02_LED block, five of the 03_button block, and one of the 04_buzzer block:

Hierarchy blocks placed


Connect the hierarchy blocks consecutively to GPIOs 2 through 12 (in the same way as you did with the 34-way connector):

Hierarchy blocks connected to RPi GPIOs


That concludes the schematic documentation. You can inspect your work using Print Preview and save a PDF print of your schematic for reference. Do not forget to save your work.


Now, click ‘Ctrl’ and ‘B’ to export the schematic to the PCB layout editor. This will start up a second program.

You will get a warning. Ignore that:

DipTrace net list warning

Start by saving the file.


At first sight, there are too few components:

Schematic exported to PCB layout editor


Actually, they are superimposed due to the hierarchy blocks. Click on the Arrange components button to untangle the components:

Components re-arranged


Go to Objects, Board Points, and select Create RoundRect Board with 56 mm height, 84 mm width, and 2 mm radius:

Circuit board setup


That gives you the outline of the circuit board:

Circuit board outline created


Select the header J1. Rotate it 180 degrees using the space bar key. Now right click and select Change side. You will side that pin 1 is in the wrong place. Go to Edit and select Flip Group vertically to obtain the following:

Header J1 rotated, flipped, and sent to the backside of the circuit board


Pin 1 is now, where it should be. You will note that the header changed from green to blue, since it is now on the backside of the circuit board (you can change between top and bottom by pressing keys T and B, respectively).

Align the five LEDs on a row, align the five pushbuttons on a row, and move the buzzer to the bottom row:

LEDs and pushbuttons aligned

Note that the blue ratlines have been deactivated (menu on the right hand side) and all the other components moved outside the perimeter of the circuit board.

Now, align the header so that it is in the middle of the circuit board and the silk screen on the bottom is within the board perimeter (hint: use the Place dimension tool to measure distances between – carefully selected – anchor points):

Header centered on circuit board


Add four mounting holes with 2.50 mm hole diameter, 4.00 mm outer diameter in a distance of 3.75 mm from each side of the circuit board:

Mounting holes placed


Rearrange the remaining components: each LED has two resistors and a transistor associated; each pushbutton a resistor; the rest goes to the buzzer:

Components re-arranged


Select all of the remaining components, right click, and choose Value and Markings to obtain the following:

Component values showing


Now, all these components go to the backside of the circuit board. Select the all, right click, and choose Change side. then click “B” to switch to the backside:

Components moved to the backside


It is important not to place any SMD components on the backside outside the horizontal delineation of the 34-way header. This is due to the fact that the Pi Top has a magnetic rail with some sharp plastic edges that might tear off any component crossing their way:

Components aligned


Add a bit of silk screen, i.e. printed text that will appear on the final circuit board product. First and foremost, the LEDs are polarised components. However, only the square pad indicate the cathode. It is advisable to add some more information in the silk screen, since this particular land patter does not show the cathode, which could be expected. Similarly, the buzzer has a positive terminal:

Silk screen modified


You could also put your name, date, design name, website etc. in the silk screen.


Now it is time to route the circuit board, i.e. replace the ratlines with wires that will be etched into the circuit board. Go To Route, Route setup:

Route setup


Change the appropriate fields and click OK. Then go to Verification, Design Rules:

Minimum settings


These are the minimum settings based on my experience. They may differ from your board house, so double check with the relevant design specification guidelines.


Next, Go to Route and select Run Autorouter.

Autorouting completed


Then select Verification and Check Design Rules:

Design rules not violated


Next, select Verification and choose Check Net Connectivity:

Check net connectivity dialog


Leave the defaults checked and click OK:

All nets connected and no violations


As a last sanity check, go to File, Layout Information:

Layout information after routing


Observed that the number of routed nets equals the number of nets. Also, observe total trace length, board area, and the other key parameters.


We are now going to add a copper pour to both top and bottom side. Go to Objects, Add Copper Pour. Click somewhere on the design (only once) and press ENTER:

Copper pour dialog, first pane


Go to the second pane. Connect to the GND net, since we are making a ground plane copper pour, and select Direct Thermals (there are excellent reasons for this, which we will discuss shortly):

Copper pour dialog, second pane


One the last pane, select the following and click OK:

Copper pour dialog, third pane


Now, the top of the circuit board looks like this:

Copper pour applied to top side


Press “B” and add a copper pour to the backside as well:

Copper pour applied to back side


The 3D Preview button allows you to inspect a 3D rendering of the circuit board:

3D rendering of the top side


The model can be rotated and different zoom factors applied:

3D rendering of the backside


Now, the copper pour had Direct Thermals selected, which is unusual, if the circuit board is going to be hand-soldered (it is less important for reflow processes). The reason for this deliberate choice is the design of the 34-way Pi Top hub connector. It only has one return pin (GND), which must handle all the current that is drawn by the circuit board. Had we selected e.g. 4 spoke 45 instead, there might only have been one thin wire, 0.22 mm wide, connected to this ground pin. That is critical. In stead, we make a direct connection (Direct Thermal) and put some effort into handsoldering our board (i.e. crank up the temperature on the solder iron).


Finally, export the production files in a format accepted by you board house. I already covered that in an old tutorial.

Schematic, PCB layout, and Gerber files for this tutorial can be downloaded from the 0x2F design website.

Also, there is a tutorial for developing a graphical user interface (GUI) in Qt for the RPi.


Comments are closed.