Skip to the content
2 layers199.3 × 160 mmPiadcio, the printed circuit board in 3D

PIADC-IO is a versatile and I/O expansion project designed to enhance the GPIO capabilities of the Raspberry Pi.

Size
199.3 × 160 mm
Copper layers
2
Thickness
1.6 mm
Parts
43
Nets
72
Pads
222
Tracks, vias
445, 20
Pours
19
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
18 Sep 2024
Updated
19 Sep 2024

Overview

Piadcio is an open-source printed circuit board by DouniaBoudefla, from the DouniaBoudefla/piadcio repository on GitHub. It is a 2-layer board of 199.3 × 160 mm with 43 parts on 72 nets, routed with 445 tracks and 20 vias.

It is built around the MCP23S08-E/P and BS170. Its parts include 19 connectors, 6 capacitors, 6 resistors, 4 ICs and 3 diodes.

Main components

2

README

README.md

PIADC-IO

PIADC-IO is a versatile and I/O expansion project designed to enhance the GPIO capabilities of the Raspberry Pi. The project integrates the MCP23S08 I/O expander and the MCP3208 ADC (Analog-to-Digital Converter) with the Raspberry Pi, enabling efficient control of multiple devices and precise analog signal measurements via the SPI protocol. This repository contains all the necessary resources, including schematics, PCB designs, code, and documentation, to set up and use the PIADC-IO system for various applications, such as slow control in experimental setups and monitoring analog inputs.

Features

I/O Expansion: Utilize the MCP23S08 to expand the Raspberry Pi's GPIO capabilities by 8 configurable pins per expander, supporting multiple input/output configurations. Analog-to-Digital Conversion: Integrate the MCP3208 to enable reading from up to 8 analog input channels with 12-bit resolution. Power Indication LED: Monitor power status with a controllable LED, which can be managed via the Raspberry Pi. Modular and Configurable: Easily adapt the system to different hardware setups with a TOML configuration file used to define hardware-specific settings like SPI bus numbers and chip select lines.

Repository Structure

pcb/ - Includes PCB design files and contains the electronic schematics used for the project, designed in KiCad. src/ - Source code for interacting with the MCP23S08 and MCP3208, including Python classes for each.

Preliminary Configuration

Before starting, you need to enable the SPI function on your Raspberry Pi using 'raspi-config'. The Raspberry Pi have 2 different SPI bus: one will be known as /dev/spi0.* and the other as /dev/spi1.*.

Enabling SPI1

if '/dev/spi1.0' and '/dev/spi1.1' are not available, you need to enable SPI1 manually:

  1. Edit the boot configuration file:

    text
     sudo nano /boot/config.txt
  2. Add the following lines at the end of the file to enable SPI1:

    text
     dtparam=spi=on
     dtoverlay=spi1-3cs
  3. Save the file and exit the editor (Ctrl + O, Enter, Ctrl + X)

  4. Reboot your Raspberry Pi to apply the changes:

    text
     sudo reboot

After rebooting, you should see '/dev/spi1.0' and '/dev/spi1.1' available for use.

Communication with MCP23S08

To communicate with MCP23S08, you need to send and receive data via the SPI interface. Here is how you can read from and write to the the MCP23S08 registers using Python with the 'spidev' library.

Understanding MCP23S08 Communication

Commmand Structure

Communication with the MCP23S08 involves sending a sequence of bytes over the SPI interface. Each command generally consists of the following parts:

  • Opcode: Determines whether the operation is a read or write
  • Register Address: Specifies which register to access
  • Data: The value to write to the register (for write operations)

Opcode

Write Opcode: Ox40 (A0=0, A1=0) Read Opcode: 0x41 (A0=0, A1=0)

The opcode is followed by the register address and then the data byte

Register Address

The MCP23S08 has several registers for configuring and controlling the I/Os. Here are some key registers:

  • IODIR (0X00): I/O Direction Register (1 = input, 0 = output)
  • GPIO (0x09): GPIO Register (read/write I/O values)
  • OLAT (0x0A): Output Latch Register (maintain output values)

Data

The data byte is the value you write to the register. For read operations, the data byte received from the MCP23S08 will contain the registers's current value.

Parts

43
QtyValueFootprintReferences
5Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ3, J4, J18, J19, J22
4100nFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC2, C4, C5, C6
4Conn_01x06Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_6-G-5,08_1x06_P5.08mm_VerticalJ8, J9, J10, J11
4MountingHoleMountingHole:MountingHole_3mmH1, H2, H3, H4
34.7KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R3, R5
3470RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2, R4, R6
3Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ1, J6, J17
3LED RedLED_THT:LED_D3.0mmD1, D2, D3
210nFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC1, C3
2Conn_01x10Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_10-G-5,08_1x10_P5.08mm_VerticalJ5, J13
2MCP23S08-I/O ExpanderPackage_DIP:DIP-18_W7.62mm_LongPadsU1, U5
2MCP3208-ADCPackage_DIP:DIP-16_W7.62mm_LongPadsU2, U3
15V Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_2-G-5,08_1x02_P5.08mm_VerticalJ21
1BS170Package_TO_SOT_THT:TO-92_InlineQ1
1Conn_01x06Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ20
1RPI connConnector_PinHeader_2.54mm:PinHeader_2x20_P2.54mm_VerticalJ15
1Raspberry Pi USB PowerConnector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_2-G-5,08_1x02_P5.08mm_VerticalJ16
1Raspberry_Pi_2_3PiADC-IO:raspberrypi_NOCONNECTORJ2

Similar boards

  • 2 layers271.5 × 91.8 mmFusion, the printed circuit board in 3D

    Fusion

    crides/fusion

    A folded minimally spaced choc mini (PG1232) keyboard for traveling

    126 parts84
  • 2 layers91 × 120 mmAgc dsky, the printed circuit board in 3D

    Agc dsky

    Gregox273/Embedded-AGC-DSKY-emulator

    157 parts3GPL-3.0
  • 4 layers60.1 × 48.1 mmPrototypeRTDBoard, the printed circuit board in 3D

    PrototypeRTDBoard

    SBC-Collaboration/SBC-RTD-Boards

    RTD board in KiCAD and simulations done in LTSpice

    71 parts
  • 2 layers93.3 × 80.6 mmTRSIO, the printed circuit board in 3D

    TRSIO

    apuder/TRS-IO

    TRS-IO gives a TRS-80 Model 1/III online capabilities and provides access to a variety of services. TRS-IO currently features the following capabilities:

    39 parts75GPL-3.0
  • 2 layers50.8 × 58.4 mmMEZ80RAM SD, the printed circuit board in 3D

    MEZ80RAM SD

    hanyazou/MyPCBs

    27 parts2
  • 2 layers82 × 95 mmEl MIDI, the printed circuit board in 3D

    El MIDI

    DiegoRosales/PCB_Designs

    This repository contains some of the designs I've made. Everything here is Open Source Hardware

    44 parts1
  • 2 layers21.1 × 26.9 mmDemo, the printed circuit board in 3D

    Demo

    easyw/kicadStepUpMod

    kicadStepUp: ECAD to MCAD FreeCAD WorkBench

    16 parts704
  • 2 layers94.6 × 46.1 mmHeaterMeterPI, the printed circuit board in 3D

    HeaterMeterPI

    CapnBry/HeaterMeter

    HeaterMeter and LinkMeter Arduino BBQ Controller

    66 parts557MIT

Questions

How big is the Piadcio PCB?

It measures 199.3 × 160 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Piadcio use?

43 parts, built around the MCP23S08-E/P and BS170. 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 Piadcio KiCad files?

From the DouniaBoudefla/piadcio repository on GitHub, at the commit this page was made from: the board is rsrc/kicad/PiADC-IO.kicad_pcb and its schematic rsrc/kicad/PiADC-IO.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Piadcio design in my own project?

Its repository states no licence, so its author keeps all rights: ask DouniaBoudefla before reusing the design.