๐Ÿงช

Hardware Bring-Up & Testing Workbench

Step-by-Step Bring-Up Guide • Auto-Saving Notes

First-Time Hardware Bring-Up Sequence

Welcome to your hardware bench! Because this is your first time bringing up this embedded system, we test isolated modular blocks in bottom-up order so you can easily verify each link before connecting them all together.

1. Pico 2WH + Mouse Sensor 1
2. Pi + Camera 3 WN (500mm Ribbon)
3. Pi + Pico USB Serial Bridge
4. Tactile Button (Final Assembly)
๐Ÿ“ฆ Step 0: Received Hardware Inventory Verification
Parts In Hand

Tick off the hardware components you have on your desk right now:

Raspberry Pi Host SBC Raspberry Pi 4 / 5 (Main Computer)
RASP PI PICO 2WH Pico 2 with Pre-Soldered Male Headers & WiFi
Optical Mouse Sensor 1 (BKL 10120183 / PMW3360) Breakout with lens clip for tracking (Testing 1st)
Optical Mouse Sensor 2 (Spare / Secondary) Second sensor for dual 90ยฐ tracking (Reserved)
RASP CAM 3 WN (Camera Module 3 Wide NoIR) 12MP Sony IMX708, 120ยฐ Wide FoV, Autofocus
RASP CAM FPC 50 (500mm Cable) Long flexible flat ribbon cable for cradle mount
DEBO KABELSET15 & KABELSET17 Dupont Jumper Sets: Female-Female, Female-Male, Male-Male
TASTER 3305D (Tactile Push Button) Flush trigger button (Reserved for final plunger)
๐Ÿ”ฌ Phase 1: Raspberry Pi Pico 2WH + Mouse Sensor 1 (SPI Bring-Up)
Phase 1 • Priority #1

Goal: Wire the optical mouse sensor to the Pico 2WH and verify that it communicates over SPI, reads its Product ID register, and streams real-time displacement counts (dx, dy).

๐Ÿ’ก
Which Jumper Wires to Use: Because your Pico 2WH has male pin headers and your sensor breakout board has male headers or solder holes, use Female-to-Female (F-F) Dupont jumper wires from your DEBO KABELSET15/17.

1.1 Hardware Wiring Pinout (Pico 2WH ↔ Sensor 1 Desk Layout)

Sensor Pin # & Label Pico Physical Location Pico Physical Pin # Wire Color Function & Notes
Pin 1: VCC LEFT Row (3V3_OUT) Pin 36 ๐Ÿ”ด Red (1st wire) 3.3V Power from Pico (Do NOT use Pin 37)
Pin 2: MIS RIGHT Row (GP4 RX) Pin 6 ๐Ÿ”ต Blue (5th wire) Master In Slave Out (Data from Sensor)
Pin 3: MOS RIGHT Row (GP3 TX) Pin 5 ๐ŸŸข Green (4th wire) Master Out Slave In (Data to Sensor)
Pin 4: SCL RIGHT Row (GP2 SCK) Pin 4 ๐ŸŸก Yellow (3rd wire) SPI Clock Line (2 MHz)
Pin 5: SS RIGHT Row (GP5 CSn) Pin 7 ๐ŸŸฃ Purple (6th wire) Chip Select (Active LOW)
Pin 6: MOT Not Connected — — Motion Interrupt Flag (Optional, polling used)
Pin 7: GND LEFT Row (GND) Pin 38 ๐ŸŸ  Orange (2nd wire) Common Ground Reference
Pin 8: RS Not Connected — — Hardware Reset (Leave Open)

1.2 Validated MicroPython Test Script for Pico 2WH

Open Thonny IDE, paste this script into a new file, and click Run (F5):

import time
from machine import Pin, SPI

# Exact pins matching the 1:1 desk wiring layout:
PIN_SCK  = 2  # GP2 (Pin 4) -> Yellow wire (Sensor Pin 4 SCL)
PIN_MOSI = 3  # GP3 (Pin 5) -> Green wire  (Sensor Pin 3 MOS)
PIN_MISO = 4  # GP4 (Pin 6) -> Blue wire   (Sensor Pin 2 MIS)
PIN_CS   = 5  # GP5 (Pin 7) -> Purple wire (Sensor Pin 5 SS)
# Power: Red wire (Sensor Pin 1 VCC) -> Left Row Pin 36 (3V3_OUT)
# Ground: Orange wire (Sensor Pin 7 GND) -> Left Row Pin 38 (GND)

cs = Pin(PIN_CS, Pin.OUT, value=1)
spi = SPI(0, baudrate=2_000_000, polarity=1, phase=1,
          sck=Pin(PIN_SCK), mosi=Pin(PIN_MOSI), miso=Pin(PIN_MISO))

def write_reg(reg, val):
    cs.value(0)
    time.sleep_us(10)
    spi.write(bytes([reg | 0x80, val]))
    time.sleep_us(30)
    cs.value(1)
    time.sleep_us(35)

def read_reg(reg):
    cs.value(0)
    time.sleep_us(10)
    spi.write(bytes([reg & 0x7F]))
    time.sleep_us(160)  # t_SRAD turnaround delay
    val = spi.read(1)[0]
    time.sleep_us(5)
    cs.value(1)
    time.sleep_us(20)
    return val

# 1. Reset SPI port
cs.value(1); time.sleep_ms(10)
cs.value(0); time.sleep_ms(2); cs.value(1); time.sleep_ms(10)

# 2. Power-up Reset command (0x5A to register 0x3A)
write_reg(0x3A, 0x5A)
time.sleep_ms(60)

# 3. Flush motion registers pipeline
for r in [0x02, 0x03, 0x04, 0x05, 0x06]:
    read_reg(r)
time.sleep_ms(10)

# 4. Check IDs
prod_id = read_reg(0x00)
rev_id  = read_reg(0x01)
print(f"๐Ÿ“ฆ Product ID: 0x{prod_id:02X} | Revision ID: 0x{rev_id:02X}")
print("๐ŸŽฎ Live Tracking Active - Swipe surface over sensor:")

while True:
    motion = read_reg(0x02)
    squal  = read_reg(0x07) # Surface quality (0-255)
    if motion & 0x80:
        dx_l = read_reg(0x03)
        dx_h = read_reg(0x04)
        dy_l = read_reg(0x05)
        dy_h = read_reg(0x06)
        
        dx = (dx_h << 8) | dx_l
        if dx >= 32768: dx -= 65536
        dy = (dy_h << 8) | dy_l
        if dy >= 32768: dy -= 65536
        print(f"๐Ÿ“ dX: {dx:+6d} | dY: {dy:+6d} | SQUAL: {squal:3d}")
    time.sleep_ms(20)

Phase 1 Verification Checklist

๐Ÿ”’ Permanent Raspberry Pi SSH & Remote Access (One-Time Setup)
DESK VERIFIED CREDENTIALS

Connect to your standalone Raspberry Pi 4 host anytime over WiFi without needing a dedicated monitor or keyboard.

Host IP:
192.168.2.107
Username:
raspberryben
Default Password:
claude1234

Connect from Laptop (PowerShell / Terminal)

# Connect by IP from Windows PowerShell / macOS / Linux:
ssh raspberryben@192.168.2.107

# (Or connect by mDNS hostname):
ssh raspberryben@raspberrypi.local
๐Ÿ“ท Phase 2: Raspberry Pi + Camera Module 3 WN (Optics & Fit)
Phase 2 • Priority #2

Goal: Connect the RASP CAM 3 WN (Sony IMX708) to the Raspberry Pi 4 using the 500mm RASP CAM FPC 50 ribbon cable. Verify clean autofocus video capture and optical clearance in your 3D-printed slot.

โš ๏ธ
CSI Ribbon Pin Orientation & Handling Protocol:

• On Raspberry Pi 4 CAMERA Port: Silver metal pins face towards the Micro-HDMI ports; Blue plastic stiffener faces towards the 3.5mm Audio Jack / USB ports.
• On Camera Module 3: Silver metal pins face towards the lens (front); Blue plastic stiffener faces towards the rear of the PCB.
• No-Hotplug Rule: CSI cameras cannot be connected while powered. If re-seated or adjusted while on, run sudo reboot to re-enumerate the IMX708 sensor.

2.1 Raspberry Pi Terminal Test Commands

Open a terminal on your Raspberry Pi (or SSH) and run:

# 1. Test live fullscreen camera preview with continuous autofocus (5 seconds):
rpicam-hello -t 5000

# 2. Capture a high-res 12MP test snapshot:
rpicam-still -o test_cradle_fit.jpg --width 1920 --height 1080 --autofocus-mode auto

# 3. If mounted upside-down inside the vault, flip it in preview:
rpicam-hello -t 5000 --rotation 180

Phase 2 Verification Checklist

โšก Phase 3: Raspberry Pi + Pico 2WH (USB Serial Bridge Loop)
Phase 3 • Priority #3

Goal: Connect the Pico 2WH to the Raspberry Pi via USB cable. Verify that the Pi detects the Pico as a serial CDC device (/dev/ttyACM0) and streams live tracking packets directly into the Pi's Python engine.

3.1 Test Device Node on Raspberry Pi

# Check if Pico 2WH USB serial is detected:
ls -l /dev/ttyACM*

# (You should see /dev/ttyACM0 appear when Pico is plugged in)

3.2 Master Space-Time Orchestrator (cradle_brain.py)

This master script runs on the Raspberry Pi 4, connects to the Pico over USB, streams live $(\text{Lat}, \text{Lon})$ coordinates, and captures 1-shot camera ring snapshots when [ENTER] or the Plunger Button is pressed.

# 1. From your Laptop, transfer cradle_brain.py to the Pi:
scp cradle_brain.py raspberryben@192.168.2.107:/home/raspberryben/

# 2. SSH into your Raspberry Pi:
ssh raspberryben@192.168.2.107

# 3. Run the Master Space-Time Brain Engine:
python3 cradle_brain.py

Phase 3 Verification Checklist

๐Ÿ”˜ Phase 4: Tactile Button (TASTER 3305D) • Reserved for Final Plunger
Late Phase

The TASTER 3305D tactile microswitch will be wired under the flush center plunger of the Ziggurat Dial to trigger instantaneous optical ring capture and print dispensing.

๐Ÿ“Œ
Reserved Wiring Pinout (When ready):
• Button Pin 1 → Pico GP15 (Pin 20) (Configured with internal software pull-up Pin.PULL_UP)
• Button Pin 2 → Pico GND (Pin 18 / 23)
When pressed, GP15 pulls to GND, triggering an interrupt to snapshot the camera and dispense the receipt.
โšก Phase 5: Appliance-Grade Autostart Service (Zero-Touch Linux Daemon)
STANDALONE MODE

Transform your Raspberry Pi into a plug-and-play appliance. When powered on at a museum, gallery, or exhibition, the system automatically launches the space-time tracking engine in ~20 seconds without needing any keyboard, monitor, or SSH login.

5.1 One-Click Autostart Installation on Raspberry Pi

# 1. From Laptop PowerShell, copy service files to the Pi:
scp globe-tracker.service setup_autostart.sh raspberryben@192.168.2.107:/home/raspberryben/

# 2. SSH into your Raspberry Pi:
ssh raspberryben@192.168.2.107

# 3. Run the 1-Click Installer (enables automatic boot startup):
sudo bash setup_autostart.sh

# 4. Verify the background daemon is active:
sudo systemctl status globe-tracker.service
๐Ÿ”„ Auto-Recovery:

If the power cord is abruptly unplugged and plugged back in, systemd restarts the engine with zero file corruption.

๐Ÿ“œ Live Headless Logs:

Tail live coordinate logs anytime from laptop:
tail -f /home/raspberryben/cradle.log

๐Ÿ›๏ธ Phase 6: Exhibition Transport & Curator Quick-Start Protocol
CURATOR GUIDE

Print or tape this 3-step card under the Mother Base console for anyone unboxing and exhibiting the piece at a gallery or venue.

๐Ÿ“œ Curator 3-Step Quick Start Protocol 100% Offline Standalone
  1. Position: Place the Mother Base console on a flat, level exhibition table.
  2. Seat Globe: Gently place the 100mm Compass Globe into the 3-point ball-bearing cradle.
  3. Power: Plug the included power supply into the rear barrel jack and a wall outlet.
    โณ Wait 20โ€“25 seconds. The system boots automatically.
  4. Interact: Rotate the globe to explore coordinates. Spin the 5-tier date rings. Push the flush central brass plunger to capture the optical snapshot!
๐Ÿ“ฆ
Transport Protection Tips:
• Globe Travel Puck: Remove the brass globe and place the 3D-printed soft foam ring into the cradle during transit.
• DuPont Cable Stability: Internal zip-tie clips prevent any wire jumpers from loosening during car/flight vibration.
• Offline Autonomy: No WiFi or internet required at the venue โ€” all math, ephemeris, camera OCR, and stories generate completely offline.