snaphat-pcb

Public

@marchmare

Share snaphat-pcb

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading 3D model… large boards can take a moment.

README

🌻 SnapHAT - PCB design

SnapHAT is an addon for RaspberryPi Zero 2 W serving as a handheld photo camera device.

This repository contains KiCad 9 design files for the PCBs of the SnapHAT device (rev.1.1). The boards' layout is prepared to be compatible with JLCPCB standard 2-layer PCB quote.

[!WARNING] This repository is work in progress — core features are functional, but the PCB for this device is still evolving and some parts of the design are not yet behaving as I hoped. To avoid unnecessary hardware headaches, check Troubleshooting and required reworks section!

[!TIP] Python-based app for this camera can be found in this repository.

Table of contents:

Features

  • 40-pin Raspberry Pi GPIO header for integration with RaspberryPi Zero 2 W
  • 8-pin PH connector and mounting support for 320x240 Waveshare 18366 2.4" LCD TFT display
  • Usable with ZeroCam OV5647 5MPx wide-angled 120° camera modules or same form-factor alternatives
  • 1200mAh Li-Po battery support (30x40mm cell footprint, 2 pin PH connector), on-board battery charging (MCP73871) and power monitoring (INA219)
  • USB-C charging and OTG connector for RaspberryPi SD card access (USB 2.0)
  • USB OTG pogo-pin breakout board as Raspberry Pi HAT, accessing USB singals through pogo-pins, connected to main board via 4pin FFC cable
  • 8 tactile user interface buttons (navigation and shutter)
  • LIS2DW12 motion sensor for providing image orientation metadata
  • passive buzzer for audio feedback
  • exposed debug UART pins
  • flower testpads, because joy and whimsy is in demand

Repository structure

.
├─ main_board/
│   ├─ docs/
│   ├─ *.kicad_pro, *.kicad_sch, *.kicad_pcb
│   └─ README.md
├─ usb_hat/
│   ├─ docs/
│   ├─ *.kicad_pro, *.kicad_sch, *.kicad_pcb
│   └─ README.md
├─ img/
└─README.md

This repository contains two KiCad projects for each board:

  • main_board - SnapHAT main board with RaspberryPi socket connector and all camera device peripherals
  • USB HAT - USB OTG pogo-pin breakout board

Each board directory contains:

  • *.kicad_pro, *.kicad_sch, *.kicad_pcb - KiCad 9 design files
  • docs/ - documentation outputs generated from the KiCad files - you will find BOM in CSV format and schematic PDF in there

In the root directory:

  • img/ - rendered previews of the boards and other images used by READMEs

Bill of Materials

You can find BOMs for each board as CSV file in their respective docs/ directories. BOMs list PCB components, wire harness components, fasteners as well as OTS modules required to assemble the whole device.

While designing SnapHAT, Farnell and TME were mostly taken into consideration as part vendors, however some parts need to be sourced from elsewhere (this applies mostly to OTS modules).

Estimated component cost of the whole device is approximately 114 USD.

Wire harnesses

Display wire harness

To connect the Waveshare 18366 2.4" LCD TFT Display, use an 8-pin JST-PH (2.0 mm pitch) wire harness. This is not a straight-through cable — pin numbering is reversed between connectors.

Part numbers for building the harness are listed in the main board's BOM and appear in its KiCad schematics as well.

Pin mapping:

SnapHAT J1SignalLCD PH connector
13V3 (VCC)8
2GND7
3MOSI (DIN)6
4SCLK (CLK)5
5SPI_CS4
6DC3
7RST2
8BL1

USB HAT FFC cable

To connect SnapHAT's USB HAT, use 4 core (1.0 mm pitch) >50 mm FFC cable, with opposite sided contacts. Proposed part number for this cable is listed in the USB HAT's BOM and appear in its KiCad schematics as well.

SnapHAT and USB HAT both include FFC connectors with top-side contacts (SnapHAT: J6, USB HAT: J1). When plugged in, FFC stiffener should face the PCB on both ends.

Pin mapping:

SnapHAT J6SignalUSB HAT J1
1VBUS1
2USBC_DATA_N2
3USBC_DATA_P3
4GND4

RaspberryPi header connection map

Below table describes connected RaspberryPi GPIO pins and their intended function.

Pin functionSignal nameGPIO (BCM)PinPinGPIO (BCM)Signal namePin function
3.3V power rail+3V3-12-+5V05V power rail
I2C dataI2C_SDA234-+5V05V power rail
I2C clockI2C_SCL356-GNDGround
Not connected-47814RPI_UART_TXDebug UART Transmit
GroundGND-91015RPI_UART_RXDebug UART Receive
Menu buttonBTN_MENU17111218BUZZER_SIGNALBuzzer PWM
A buttonBTN_A271314-GNDGround
B buttonBTN_B22151623-Not connected
3.3V power rail+3V3-171824DISPLAY_RSTDisplay reset
Display SPI MOSIDISPLAY_MOSI101920-GNDGround
Not connected-9212225DISPLAY_DCDisplay Data/Command
Display SPI serial clockDISPLAY_SPI_SCLK1123248DISPLAY_SPI_CSDisplay SPI chip select
GroundGND-25267-Not connected
Down buttonBTN_D027281-Not connected
Left buttonBTN_L52930-GNDGround
Right buttonBTN_R6313212DISPLAY_BLDisplay backlight PWM
Up buttonBTN_U133334-GNDGround
Low battery indicator LEDLED_LBO19353616LED_SHUTTERShutter activity LED indicator
Shutter buttonBTN_SHUTTER26373820ACCEL_INT1Motion sensor interrupt 1
GroundGND-394021ACCEL_INT2Motion sensor interrupt 2

Troubleshooting and required reworks

This revision's battery circuit (protection, charger and 5V boost) is still botched. Aside from this, SnapHAT is operational if powered by an external stable 5V supply like PC USB port or powerbank.

To make SnapHAT work in this case, simply connect VBUS to 5V0 (you can solder a wire between corresponding testpads). Keep the SW9 switch off to disable the battery charger circuit and prevent charging indicators flickering.

If you wish to dwell deeper into what's currently wrong with this design, here are symptoms observed during bringup:

  • no power sourced from battery:
    • battery protection dual MOSFET have wrong topology, skip populating battery protection components entirely and populate R22 and R23 0R resistors instead to connect battery directly to the rest of the circuit. Make sure you use battery with a PCM in this case!
  • RaspberryPi stuck in boot loop when powering from battery or weaker USB port:
    • battery charging/boost regulator circuit is still wrong in this iteration, for the time being, connect VBUS testpad with the 5V0 one
  • SnapHAT gets powered from connected USB-C connector when USB HAT is installed, despite turning SW9 in off position:
    • cut the VBUS trace going to J6 pin 1
Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.