Skip to the content
4 layers207 × 78.7 mmRpihw, the printed circuit board in 3D

Raspberry Pi SPI devices board design

Size
207 × 78.7 mm
Copper layers
4
Thickness
1.6 mm
Parts
101
Nets
177
Pads
433
Tracks, vias
1,173, 51
Routed
Yes
KiCad
KiCad 4
Created
13 Jul 2020
Updated
29 Nov 2020

Overview

Rpihw is an open-source printed circuit board by quorten, from the quorten/rpihw repository on GitHub, published under the Unlicense licence. It is a 4-layer board of 207 × 78.7 mm with 101 parts on 177 nets, routed with 1,173 tracks and 51 vias.

It is built around the L293D, SN74HC08N and SN74HC595N, with the CD74HC238E, SN74HC04N and SN74HC161N among its other parts. Its parts include 32 resistors, 18 capacitors, 11 diodes, 9 ICs and 8 transistors.

Main components

10

README

README.md

rpihw -- My First Raspberry Pi Hardware Project

Background Info

This is my first large-scale Raspberry Pi hardware project. The original overly large goals of my Raspberry Pi hardware project was to have one Raspberry Pi hardware device with all imaginable peripheral interfaces I could ever conceivably need, so I could just plug in what I need for a particular session. But, since that's too large sweeping of a goal to achieve... let's simply state what my actual design does.

This is my first iteration at designing a Raspberry Pi SPI devices board. The path to this real implementation started out by playing with the Texas Instruments SN74HC595N shift register from an Arduino parts pack. Cool, it's an integrated circuit, but dang, intimidating... how am I going to program this shift register? But then, I wired up 4 tactile switches, 1 pull-up resistor, 3 pull-down resistors, and a 7-segment LED with decimal point. Then... wow, I was hooked, it's so easy and simple, and it could in theory be daisy-chained to control an unlimited number of devices... limited only by signal timing constraints.

I also went reading in more detail about SPI (Serial Peripheral Interface), and I realized, hey, SPI is really just a glorified interface to a plain old shift register integrated circuit. I should really try making a board that exposes some plain old shift registers to Raspberry Pi as SPI devices. So, that's what I started out doing.

What the main board does

  1. SPI Display/Keypad controller: 8-bit input word, 8-bit output word SPI device. You program an 8-bit shift register that controls the display contents of one 7-segment LED digit, including decimal point. An internal counter circuit automatically advances the current digit, so that when you write on the next cycle, you will set the contents of the next digit. The input is the contents of one row (or column, depending on wiring) of the keyboard. By reading/writing in rapid succession, you can control an 8-digit multiplexed LED digit display and read a 64-key keyboard.

    Technically, with one more demultiplexer chip, the circuit could easily be extended to a 16-digit display and a 128-key keyboard.

  2. SPI motor controller: 8-bit output word SPI device. Since this is an asymmetric SPI device, you must take corresponding caution when daisy-chaining it. Two L293D motor controllers with some glue logic chips to reduce the number of bits to program them. Can control up to 4 DC motors or 8 solenoids. 2 bits indicate one of 4 states for each motor: (0) coast, (1) forward, (2) reverse, (3) brake.

  3. Miscellaneous GPIO device control: Other single pin connections for controlling some LEDs, a PWM buzzer, and an arbitrary higher-powered device.

Of course, there is still more plenty of expansion capability for connecting off-board SPI devices, provided that the distance is not so long that capacitance and signaling delays becomes a problem. In theory, UART transceivers are an easy and cheap way to connect distant devices to a daisy-chained SPI bus.

Oh, and I didn't even cover I2C yet. Sure, you can populate connectors and solder on headers for modular connection to that as you please.

What the auxiliary boards do

  • SPI Debug Board: a fancier, more formal recreation of my original breadboard design for playing with the shift register, give yourself a nice permanent fixture for those four buttons and the official connector interface I use for my SPI devices on this board design. Also, this is a great first time perboard project to build.

  • Additional I/O connectors and device interface board: Everything that didn't fit on the first Eurocard perfboard that I bought, I put on a piece of my own "cardboard circuit board" when building the perfboard prototype.

Credits

  • Digi-Key: I used Digi-Key to prepare the Bill of Materials from my initial design specifications. Also, I used the Digi-Key KiCad parts library when designing the formal schematics in KiCad.

  • KiCad: The formal design documentation for this project is drafted in KiCad. That is, anything that is not specified straight up in generic documentation formats like Markdown, HTML, SVG graphics, PDFs, spreadsheets, etc.

  • UltraLibrarian: I used UltraLibrarian to get KiCad library files for some of the Digi-Key parts. It's not great, and had I known in advance, I should have used the Digi-Key KiCad parts library for as many of the parts that were available over there.

  • KiBoM: Some of the early versions of KiCad (if you're stuck using an older Debian-based distro for various odd reasons) don't have very nice BOM generators bundled by default, KiBoM is a fairly nice BOM generator to use in these cases. It might also provide some other useful advanced features not in the BOM generators in the newer KiCad versions.

  • Icarus Verilog: Open Hardware tools are not as integrated as they could or should be... it seems the best way to simulate digital glue logic is to code it up in Verilog. Of course, this doesn't provide simulation for any of the analog glue connections, I'm just relying on careful eyeing of the schematics and best effort with my current, somewhat limited, design experience for that one.

N.B.: Modern versions of KiCad don't have the simple internal autorouter, it wasn't forward ported when was Pcbnew was extensively refactored. That's another benefit of the older versions, if you just want to play around with simple auto-routing because you can. I'm still developing this project in KiCad 4 rather than the latest version.

Copyright Info

The rest of this project, i.e. the board design itself excluding the library files, is in public domain via the UNLICENSE.

The Digi-Key KiCad parts library uses the Creative Commons Share-Alike, with a special exemption that tantamounts to "fair use" under copyright law if only bits and pieces are used for a particular project, as opposed to most of the library.

The UltraLibrarian library parts are under proprietary copyright, but also come with a special exemption that tantamounts to "fair use" under copyright law if only bits and pieces are used for a particular project, as opposed to most of the library.

Parts

101
QtyValueFootprintReferences
11100nFCapacitors_ThroughHole:C_Rect_L4_W2.5_P2.5C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11
11220rpihw:STA_RNMF14R1, R2, R3, R4, R5, R6, R7, R8, R101, R102, R107
951Krpihw:STA_RNMF14R17, R18, R19, R20, R21, R22, R23, R24, R25
82N3904BUrpihw:TO-92-3Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8
84.7Krpihw:STA_RNMF14R9, R10, R11, R12, R13, R14, R15, R16
65ADiodes_ThroughHole:Diode_DO-201AD_Horizontal_RM15D3, D4, D101, D102, D103, D104
4CONN_01X02Pin_Headers:Pin_Header_Straight_1x02P1, P2, P101, P102
4Mounting_HoleMounting_Holes:MountingHole_3mmMH101, MH102, MH103, MH104
4SW_PUSHButtons_Switches_ThroughHole:SW_PUSH-12mmSW103, SW104, SW105, SW106
3100uFCapacitors_ThroughHole:C_Radial_D5_L11_P2.5C14, C101, C102
310Krpihw:STA_RNMF14_STPR103, R104, R105
2220uFCapacitors_ThroughHole:C_Radial_D8_L11.5_P3.5C12, C13
2L293Drpihw:PowerDIP-16CR1, CR2
2LDQ-N516RIDisplays_7-Segment:Cx56-12AFF1, AFF2
2LED REDLEDs:LED-5MMD105, D107
2SN74HC08Nrpihw:N14U3, U9
2SN74HC595Nrpihw:N16U1, U7
110uFCapacitors_ThroughHole:C_Radial_D5_L11_P2.5C103
116V 2ACapacitors_ThroughHole:C_Radial_D5_L11_P2.5F1
11Krpihw:STA_RNMF14_STPR106
11uFCapacitors_ThroughHole:C_Radial_D5_L11_P2.5C104
133V 53.3Vrpihw:Diode_R-6_Horizontal_Unpol_RM15D2
15V 9.2VDiodes_ThroughHole:Diode_DO-35_SOD27_Horizontal_RM10D1
160V 1.1ACapacitors_ThroughHole:C_Radial_D5_L11_P2.5F2
1CD74HC238Erpihw:N0016AU5
1CONN_01X08Connectors_Molex:Connector_Molex_PicoBlade_53047-0810P103
1CONN_02X20Pin_Headers:Pin_Header_Straight_2x20P3
1DPST 4Arpihw:Hack_L201SW101
1DPST 6Arpihw:Hack_S201SW1
1LED YELWLEDs:LED-5MMD106
1SN74HC04Nrpihw:N14U4
1SN74HC161Nrpihw:N16U2
1SN74HC165Nrpihw:N16U6
1SN74HC32Nrpihw:N14U8
1SPDT 200mAButtons_Switches_ThroughHole:SW_Micro_SPSTSW102

Similar boards

  • 2 layers38.1 × 24.1 mmCharging interlock rev a, the printed circuit board in 3D

    Charging interlock rev a

    dsorensen228/sherman

    Desktop robot project with C++ personality and display runtimes, Python hardware services, Pico 2 firmware, and PCB and enclosure design.

    17 parts1
  • 2 layersSchematics, the printed circuit board in 3D

    Schematics

    jamestiotio/compstruct

    SUTD 2020 50.002 Computation Structures Code Dump

    13 parts3MIT
  • 2 layers100 × 140 mmFULL PC, the printed circuit board in 3D

    FULL PC

    Iluhaprog/IN-machine

    Homemade computer architecture. Schemes, model and tools.

    97 parts
  • 2 layers166.4 × 181.6 mmCalculator ver1, the printed circuit board in 3D

    Calculator ver1

    PhdWizards/4-Bit-Discrete-Transistor-Adder

    The core 4-bit binary adder is implemented entirely using discrete transistor-resistor logic. The resulting 5-bit binary value is converted to BCD using 74HC-series logic and displayed on two 7-segment displays.

    308 parts
  • 2 layers100 × 100 mmAbcPcClk, the printed circuit board in 3D

    AbcPcClk

    sarocs/Atanasoff-Berry-Computer

    60 parts
  • 2 layers100 × 200 mmH Bridge BLDC, the printed circuit board in 3D

    H Bridge BLDC

    l4m4re/H_Bridge_BLDC

    Simple experimental H bridge BLDC controller

    131 parts2CC-BY-4.0
  • 2 layers57.1 × 456.8 mmSensors+LEDs, the printed circuit board in 3D

    Sensors+LEDs

    aaronluebbert/ChessLink

    houses code from our Microcontroller Project Lab from Summer 2026 at TTU

    41 parts1

Questions

How big is the Rpihw PCB?

It measures 207 × 78.7 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Rpihw use?

101 parts, built around the L293D, SN74HC08N, SN74HC595N and CD74HC238E. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Rpihw KiCad files?

From the quorten/rpihw repository on GitHub, at the commit this page was made from: the board is rpihw.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rpihw design in my own project?

Its repository publishes it under the Unlicense licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).