

Piadcio
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
2README
README.mdPIADC-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:
-
Edit the boot configuration file:
text sudo nano /boot/config.txt -
Add the following lines at the end of the file to enable SPI1:
text dtparam=spi=on dtoverlay=spi1-3cs -
Save the file and exit the editor (Ctrl + O, Enter, Ctrl + X)
-
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| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | Conn_01x02 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J3, J4, J18, J19, J22 |
| 4 | 100nF | Capacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm | C2, C4, C5, C6 |
| 4 | Conn_01x06 | Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_6-G-5,08_1x06_P5.08mm_Vertical | J8, J9, J10, J11 |
| 4 | MountingHole | MountingHole:MountingHole_3mm | H1, H2, H3, H4 |
| 3 | 4.7K | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1, R3, R5 |
| 3 | 470R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R2, R4, R6 |
| 3 | Conn_01x03 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J1, J6, J17 |
| 3 | LED Red | LED_THT:LED_D3.0mm | D1, D2, D3 |
| 2 | 10nF | Capacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm | C1, C3 |
| 2 | Conn_01x10 | Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_10-G-5,08_1x10_P5.08mm_Vertical | J5, J13 |
| 2 | MCP23S08-I/O Expander | Package_DIP:DIP-18_W7.62mm_LongPads | U1, U5 |
| 2 | MCP3208-ADC | Package_DIP:DIP-16_W7.62mm_LongPads | U2, U3 |
| 1 | 5V | Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_2-G-5,08_1x02_P5.08mm_Vertical | J21 |
| 1 | BS170 | Package_TO_SOT_THT:TO-92_Inline | Q1 |
| 1 | Conn_01x06 | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J20 |
| 1 | RPI conn | Connector_PinHeader_2.54mm:PinHeader_2x20_P2.54mm_Vertical | J15 |
| 1 | Raspberry Pi USB Power | Connector_Phoenix_MSTB:PhoenixContact_MSTBVA_2,5_2-G-5,08_1x02_P5.08mm_Vertical | J16 |
| 1 | Raspberry_Pi_2_3 | PiADC-IO:raspberrypi_NOCONNECTOR | J2 |
Similar boards
- 2 layers271.5 × 91.8 mm

- 2 layers91 × 120 mm

- 4 layers60.1 × 48.1 mm

PrototypeRTDBoard
SBC-Collaboration/SBC-RTD-Boards
RTD board in KiCAD and simulations done in LTSpice
71 parts - 2 layers93.3 × 80.6 mm

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 mm

- 2 layers82 × 95 mm

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 mm

- 2 layers94.6 × 46.1 mm

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.