Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ParkWardRR/bd07673f6094cb2fcc8dc04c1fad78dd to your computer and use it in GitHub Desktop.

Select an option

Save ParkWardRR/bd07673f6094cb2fcc8dc04c1fad78dd to your computer and use it in GitHub Desktop.
Complete hardware design specification, bill of materials, and assembly instructions for a custom PCB to interface Apple 30-pin accessories with Raspberry Pi for MFi authentication chip analysis. Features include: INA219 current monitoring on 3.3V and 5V rails, I2C/UART serial communication for authentication protocol capture, USB digital audio …

Project Name: 30-Pin MFi Accessory Testing & Analysis Board


Overview

Purpose: Interface between Apple 30-pin accessories (MB129LL/A cables, docks) and Raspberry Pi for MFi chip authentication analysis, digital audio extraction, and accessory feature testing.

Design Approach: Two-board system

  1. APPLE-30F-BO-V1A (pre-made, $12.98) - Female 30-pin connector with 2x15 pin headers
  2. Custom testing PCB (to be designed) - Accepts APPLE-30F-BO-V1A via socket headers + adds instrumentation

Mechanical Specifications

Board Dimensions

  • Size: 100mm x 80mm (4" x 3.15")
  • Layers: 2-layer PCB
  • Thickness: 1.6mm
  • Finish: ENIG (gold) - better for test points and repeated probing
  • Soldermask: Black (easier to see traces for debugging)
  • Silkscreen: White, both sides with comprehensive labels

Mounting

  • 4x M3 mounting holes (3.2mm diameter) in corners, 5mm from edges
  • Standoff height: 10mm (clearance for APPLE-30F-BO-V1A underneath)

Main Connector Interface

APPLE-30F-BO-V1A Connection (Pre-Made Board)

Mounting on custom PCB:

  • 2x15 (30-pin) female socket headers on custom PCB
  • APPLE-30F-BO-V1A plugs in from bottom with male pin headers[1]
  • Pin pitch: 2.54mm (0.1")
  • Socket type: Samtec SSQ-115-03-G-D or equivalent
  • Placement: Near board edge for mechanical support

Pin mapping (from APPLE-30F-BO-V1A to your PCB):

Row 1 (Left) Pin # Row 2 (Right) Pin #
GND 1 GND 16
GND (Audio R) 2 Reserved 17
Audio R 3 3.3V Accessory 18
Audio L 4 FireWire 12V 19
Line R 5 FireWire 12V 20
Line L 6 Accessory Detect 21
Reserved 7 FireWire TPA- 22
Line GND 8 USB/Power 5V 23
S-Video Y 9 FireWire TPA+ 24
S-Video C 10 USB D- 25
GND/Acc ID 11 FireWire TPB- 26
Serial TX 12 USB D+ 27
Serial RX 13 FireWire TPB+ 28
Reserved 14 GND (FireWire) 29
GND (Composite) 15 GND (FireWire) 30

Critical signals (bold): Route to instrumentation circuits and headers


Power Architecture

Input Power

  • Primary: Raspberry Pi GPIO header (5V + 3.3V rails)
  • Secondary: USB-C input (5V 3A) for standalone operation
  • Selection: Jumper-selectable power source

Power Distribution

Rail Source Max current Protection Usage
5V_MAIN RPi or USB-C 3A Polyfuse 3A Main 5V bus
5V_ACC 5V_MAIN → INA219 1A Polyfuse 500mA 30-pin Pin 23 (accessory power)
3V3_MAIN RPi or TPS62172 1A Polyfuse 500mA Main 3.3V bus
3V3_ACC 3V3_MAIN → INA219 100mA Polyfuse 100mA 30-pin Pin 18 (MFi chip power)

Current Monitoring

  • INA219 #1: Monitor 3.3V accessory rail (pin 18) - I2C address 0x40
  • INA219 #2: Monitor 5V accessory rail (pin 23) - I2C address 0x41

Signal Routing & Instrumentation

MFi Authentication Signals (Critical)

30-pin signal Pin # Route to Notes
Serial TX 12 - RPi GPIO2 (I2C SDA)
- Test point TP_TX
- Logic analyzer header
4.7kΩ pull-up to 3.3V
ESD protection diode
Serial RX 13 - RPi GPIO3 (I2C SCL)
- Test point TP_RX
- Logic analyzer header
4.7kΩ pull-up to 3.3V
ESD protection diode
3.3V Accessory 18 - INA219 #1 input
- Test point TP_3V3
- LED indicator
Power for MFi chip
Accessory Detect 21 - Resistor network (DIP switch)
- RPi GPIO17
- Test point TP_DET
Mode selection circuit

USB Digital Audio Signals

30-pin signal Pin # Route to Notes
USB D+ 27 - USB-A female breakout
- Test point TP_DP
- Logic analyzer header
ESD protection
90Ω series termination
USB D- 25 - USB-A female breakout
- Test point TP_DM
- Logic analyzer header
ESD protection
90Ω series termination
USB 5V 23 - INA219 #2 input
- Test point TP_5V
- LED indicator
Power monitoring

Analog Audio Signals

30-pin signal Pin # Route to Notes
Audio Right 3 - 3.5mm stereo jack (R)
- Test point TP_AUDIO_R
AC-coupled via 10µF cap
Audio Left 4 - 3.5mm stereo jack (L)
- Test point TP_AUDIO_L
AC-coupled via 10µF cap
Line Out Right 5 - Test point TP_LINE_R Optional second output
Line Out Left 6 - Test point TP_LINE_L Optional second output
Audio GND 2, 8 - 3.5mm jack ground Separate from digital GND

Raspberry Pi Interface

GPIO Header (2x20 Female Socket)

Pin allocation:

RPi Pin GPIO Function Connects to
1 3.3V Power input (if RPi powers board) 3V3_MAIN rail (via jumper)
2 5V Power input (if RPi powers board) 5V_MAIN rail (via jumper)
3 GPIO2 (SDA) I2C data to MFi chip 30-pin Pin 12 (Serial TX)
5 GPIO3 (SCL) I2C clock to MFi chip 30-pin Pin 13 (Serial RX)
6, 9, 14, 20 GND Ground Common ground plane
11 GPIO17 Accessory detect input 30-pin Pin 21
27 GPIO0 (ID_SD) INA219 #1 I2C SDA Current sensor comm
28 GPIO1 (ID_SC) INA219 #1 I2C SCL Current sensor comm

All other GPIO pins: Break out to labeled test points for future expansion


Accessory Mode Selection Circuit

DIP Switch Resistor Network (Pin 21 → Pin 11/GND)

4-position DIP switch configuration:

Switch Position Resistor Value Mode Description
SW1 ON 68kΩ to Pin 11 Line-out mode Analog audio bypass [2]
SW2 ON 500kΩ to Pin 11 Serial control mode UART commands [2]
SW3 ON 1MΩ to GND Dock mode Full accessory mode
SW4 ON Direct to GND Test mode Force detection

Circuit design:

Pin 21 ─┬─ SW1 ─ 68kΩ ─┬─ Pin 11
        ├─ SW2 ─ 500kΩ ─┤
        ├─ SW3 ─ 1MΩ ───┴─ GND
        └─ SW4 ──────────── GND

Only one switch should be ON at a time (silkscreen warning).


Indicator LEDs

LED Color Indicates Current Limit Resistor
LED1 Red 3.3V accessory power (Pin 18) 1kΩ
LED2 Green 5V accessory power (Pin 23) 1kΩ
LED3 Blue RPi 3.3V main power 1kΩ
LED4 Yellow Accessory detected (Pin 21 activity) 1kΩ

Package: 0805 SMD, placed near board edge for visibility


Test Points & Debug Headers

Scope Test Points (1.27mm Wire Loops)

Primary signals:

  • TP_TX (Pin 12 - Serial TX)
  • TP_RX (Pin 13 - Serial RX)
  • TP_DP (Pin 27 - USB D+)
  • TP_DM (Pin 25 - USB D-)
  • TP_3V3 (Pin 18 - 3.3V accessory)
  • TP_5V (Pin 23 - 5V accessory)
  • TP_DET (Pin 21 - Accessory detect)
  • TP_AUDIO_L (Pin 4 - Audio left)
  • TP_AUDIO_R (Pin 3 - Audio right)
  • TP_GND (Multiple ground points)

Logic Analyzer Header (2x5 Pin, 2.54mm)

Pin Signal Pin Signal
1 Serial TX (Pin 12) 2 GND
3 Serial RX (Pin 13) 4 GND
5 USB D+ (Pin 27) 6 GND
7 USB D- (Pin 25) 8 GND
9 Acc Detect (Pin 21) 10 GND

Connector: Shrouded 2x5 header, keyed, compatible with Saleae/logic analyzer


External Connectors (Through-Hole)

J1: USB-A Female Breakout (Digital Audio Monitor)

  • Part: Adafruit #1833 or equivalent
  • Pins: D+, D-, 5V, GND
  • Purpose: Monitor USB digital audio from 30-pin accessory
  • Placement: Board edge, labeled "USB AUDIO OUT"

J2: 3.5mm Stereo Audio Jack (Analog Audio Monitor)

  • Part: CUI SJ-3524-SMT-TR or through-hole equivalent
  • Pins: Tip (L), Ring (R), Sleeve (GND)
  • Purpose: Listen to analog audio from 30-pin accessory
  • AC coupling: 10µF electrolytic caps on L/R channels
  • Placement: Board edge, labeled "AUDIO OUT"

J3: USB-C Power Input (Optional Standalone Power)

  • Part: USB-C receptacle (power-only, no data)
  • Purpose: 5V 3A power input when not using RPi
  • Protection: Polyfuse 3A, reverse polarity diode
  • Placement: Board edge opposite GPIO header

Complete Bill of Materials (BOM)

Pre-Made Modules (User Purchases Separately)

Qty Part Description Supplier Part # Price
1 APPLE-30F-BO-V1A 30-pin female breakout with pin headers ElabBay APPLE-30F-BO-V1A $12.98
1 Raspberry Pi Zero 2 W Controller Adafruit/Amazon $15

PCB Fabrication & Assembly (JLCPCB)

Item Specification Qty Cost
PCB fabrication 100x80mm, 2-layer, ENIG, black mask 5 $5
SMT assembly service All SMD components pre-assembled 1 order $20-30
Total PCB order ~$50 for 5 boards

SMD Components (Pre-Assembled by JLCPCB)

ICs & Active Components

Qty Part Number Description Package JLCPCB Part # Purpose
2 INA219AIDCNR Current/voltage sensor IC SOT-23-8 C130406 Monitor 3.3V + 5V rails
1 TPS62172DSGR 3.3V buck converter (500mA) WSON-8 C87997 Generate 3.3V from 5V (if standalone)
4 PESD5V0S1UB ESD protection diode (5V) SOD-323 C78666 Protect USB D+/D-, Serial TX/RX

Resistors (0603 Package)

Qty Value Tolerance Power JLCPCB Part # Purpose
2 4.7kΩ 1% 1/10W C23162 I2C pull-ups (pins 12, 13)
4 10kΩ 1% 1/10W C25804 GPIO pull-ups, general purpose
1 68kΩ 1% 1/10W C23231 Accessory mode: line-out
1 500kΩ 1% 1/10W C23253 Accessory mode: serial control
1 1MΩ 1% 1/10W C26083 Accessory mode: dock
4 1kΩ 5% 1/10W C21190 LED current limiting
2 90Ω 1% 1/10W C23345 USB D+/D- series termination

Capacitors

Qty Value Voltage Package JLCPCB Part # Purpose
6 0.1µF 50V 0603 C14663 Decoupling caps (near each IC)
3 10µF 25V 0805 C15850 Bulk filtering (power rails)
2 10µF electrolytic 25V Through-hole C72042 AC coupling for audio jack

Polyfuses (1206 Package)

Qty Value Hold Current JLCPCB Part # Purpose
1 3A 3A C70116 5V main rail protection
2 500mA 500mA C70066 3.3V and 5V accessory rail protection
1 100mA 100mA C70064 3.3V accessory (Pin 18) protection

LEDs (0805 Package)

Qty Color Forward Voltage JLCPCB Part # Purpose
1 Red 2.0V C84256 3.3V accessory power indicator
1 Green 2.0V C72043 5V accessory power indicator
1 Blue 3.0V C72041 RPi 3.3V main power indicator
1 Yellow 2.1V C72038 Accessory detect activity

Through-Hole Components (User Solders - Easy!)

Connectors

Qty Part Description Package Supplier Part # Price
1 2x15 female socket header (30-pin) 2.54mm pitch Samtec SSQ-115-03-G-D $2.50
1 2x20 female socket header (RPi) 2.54mm pitch Adafruit #2822 $1.50
1 USB-A female breakout Through-hole PCB Adafruit #1833 $1.50
1 3.5mm stereo audio jack Through-hole Digi-Key CP-43514SJCT-ND $1.25
1 USB-C receptacle (power only) Through-hole Digi-Key WM12855-ND $1.50
1 2x5 shrouded header (logic analyzer) 2.54mm pitch Digi-Key SAM8796-ND $1.20

Switches & Jumpers

Qty Part Description Package Supplier Part # Price
1 DIP switch 4-position Through-hole Digi-Key CTS 219-4LPST $1.20
3 2-pin jumper headers 2.54mm pitch Amazon Generic $0.15 ea
3 Jumper caps (shunts) 2.54mm pitch Amazon Generic $0.10 ea

Test Points & Hardware

Qty Part Description Package Supplier Part # Price
10 Test point wire loops 1.27mm Keystone #5000 $0.15 ea
4 M3 standoffs (10mm F-F) Amazon Generic $0.30 ea
4 M3 screws (6mm) Amazon Generic $0.10 ea

PCB Design Requirements

Layer Stack-Up (2-Layer)

  • Top layer: Signal traces, SMD pads, test points
  • Bottom layer: Ground plane (80% copper pour) + power traces
  • Internal layers: None (2-layer board)

Trace Widths

  • Power traces (5V, 3.3V): 0.5mm (17 mils) minimum
  • Signal traces (I2C, UART): 0.25mm (10 mils)
  • USB differential pairs (D+/D-): 0.3mm (12 mils), 90Ω impedance
  • Audio traces: 0.25mm, keep away from digital signals

Design Rules

  • Minimum clearance: 0.15mm (6 mils)
  • Minimum drill: 0.3mm (12 mils)
  • Via size: 0.6mm drill, 1.0mm pad
  • Copper pour clearance: 0.3mm (12 mils)

Special Routing Requirements

USB differential pairs (D+/D-):

  • Match length ±5mm
  • Route as differential pair, 90Ω impedance
  • Keep away from high-speed digital signals (>5mm separation)
  • No vias if possible; if needed, matched via count on both traces

I2C signals (Serial TX/RX):

  • Pull-ups close to source (within 5mm of RPi GPIO header)
  • Route away from USB traces
  • Maximum trace length: 150mm

Audio signals:

  • AC-coupled via 10µF electrolytic caps near 3.5mm jack
  • Keep digital ground and audio ground separated, join at one point only
  • No switching power supply traces under audio paths

Power distribution:

  • Star topology from input to each rail
  • Decoupling caps within 5mm of IC power pins
  • Separate analog and digital ground planes, join under power input

Silkscreen Labels (Critical for User Assembly)

Top Side

  • All connector labels: "J1 USB AUDIO", "J2 AUDIO OUT", "J3 POWER IN"
  • DIP switch labels: "SW1 68kΩ LINE-OUT", "SW2 500kΩ SERIAL", "SW3 1MΩ DOCK", "SW4 GND TEST"
  • Test point labels: "TP_TX", "TP_RX", "TP_DP", "TP_DM", etc.
  • LED labels: "3V3 ACC", "5V ACC", "RPi PWR", "ACC DET"
  • Power jumper labels: "JP1 5V SRC: RPi / USB-C", "JP2 3V3 SRC: RPi / Buck"
  • Warning: "⚠ DIP SWITCH: ONLY ONE ON AT A TIME"

Bottom Side

  • Board name: "30-Pin MFi Test Board v1.0"
  • Designer credit space
  • Mounting hole labels: "M3"
  • Pin 1 indicators for all headers

Assembly Notes for PCB Designer

JLCPCB Assembly Constraints

  • All SMD components must be on one side only (top preferred for cost)
  • No components smaller than 0603 (JLCPCB basic assembly limit)
  • No BGAs (use SOT-23, SOIC, WSON packages only)
  • Keep SMD parts away from board edges (>5mm clearance for assembly)

Through-Hole Component Placement

  • Group by assembly difficulty (test points → switches → headers → jacks)
  • Leave clearance around connectors for cables (10mm minimum)
  • DIP switch accessible from board edge
  • LEDs visible from front panel position
  • Test points evenly distributed, not clustered

Mechanical Integration

  • APPLE-30F-BO-V1A board plugs into bottom of custom PCB
  • Female socket headers must extend 3mm above top surface for clearance
  • USB-A jack, audio jack, USB-C jack aligned on same board edge
  • RPi GPIO header aligned on opposite edge

Testing & Validation Checklist (For Designer Reference)

Power-On Tests

  1. Visual inspection: No solder bridges, correct component orientation
  2. Bare board continuity: 5V rail isolated from 3.3V rail, no shorts to GND
  3. Power-up with no accessories: Check 3.3V and 5V rails within ±5%
  4. LED functionality: All LEDs illuminate when powered
  5. Current draw: <50mA idle (no accessories connected)

Functional Tests

  1. I2C bus: i2cdetect on RPi detects INA219 sensors (0x40, 0x41)
  2. Accessory detect: DIP switch changes pin 21 voltage
  3. USB pass-through: D+/D- signals pass from 30-pin to USB-A jack
  4. Audio pass-through: Analog audio appears at 3.5mm jack
  5. Test point access: All test points accessible with scope probes

Cost Breakdown Summary

Category Cost Notes
APPLE-30F-BO-V1A breakout $13 User purchases from ElabBay
Custom PCB + SMT assembly $10 Per board (min order 5 from JLCPCB)
Through-hole components $12 User solders
Raspberry Pi Zero 2 W $15 User purchases
Total per working unit $50 Plus ~$100 in reusable tools if starting from scratch

Deliverables for PCB Designer

Please provide:

  1. Schematic (PDF + editable format)
  2. PCB layout (top/bottom renders)
  3. Gerber files (RS-274X format)
  4. Drill files (Excellon format)
  5. BOM (CSV with JLCPCB part numbers)
  6. CPL file (component placement for SMT assembly)
  7. 3D render (STEP file for mechanical verification)
  8. Assembly drawing (PDF showing component placement)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment