pixalynx/nrf9151-gps-tracker
A compact 44×32 mm, 4-layer nRF9151 LTE-M/NB-IoT/GNSS tracker PCB with nPM1300 LiPo/USB-C power, nano-SIM/eSIM switching, nRF7002 Wi‑Fi scanning, accelerometer, antennas, buzzer, LEDs, SOS button, and SWD/debug connectors.
- Version
- 0.1.4
- License
- unset
- Stars
- 0
lib/layout.ts
/** Board-level layout constants shared by the circuit and the check scripts.
* Coordinates are millimetres, board centre = (0, 0), top view (+x right, +y up). */
export const BOARD = { w: 44, h: 32 }
/** nRF9151 SiP centre. The SiP decoupling, LTE match and GNSS front end are placed as one block
* relative to this point; the offsets are the verified placement of the pixal-gps tracker, whose
* SiP sat at (-4.5, 1.0). `rel(x, y)` converts a pixal-gps board coordinate into this board. */
export const U1 = { x: -9.5, y: 1.5 }
const PIXAL_U1 = { x: -4.5, y: 1.0 }
export const rel = (x: number, y: number) => ({ x: +(x - PIXAL_U1.x + U1.x).toFixed(3), y: +(y - PIXAL_U1.y + U1.y).toFixed(3) })
/** nRF9151 perimeter land position in board coordinates (footprint constants, rotation 0). */
export const sipPin = (n: number): { x: number; y: number } => {
if (n === 1) return { x: U1.x - 5.5, y: U1.y + 5 }
if (n >= 2 && n <= 19) return { x: U1.x - 5.625, y: U1.y + 4.25 - (n - 2) * 0.5 }
if (n === 20) return { x: U1.x - 5.5, y: U1.y - 5 }
if (n >= 21 && n <= 40) return { x: U1.x - 4.75 + (n - 21) * 0.5, y: U1.y - 5.125 }
if (n === 41) return { x: U1.x + 5.5, y: U1.y - 5 }
if (n >= 42 && n <= 59) return { x: U1.x + 5.625, y: U1.y - 4.25 + (n - 42) * 0.5 }
if (n === 60) return { x: U1.x + 5.5, y: U1.y + 5 }
if (n >= 61 && n <= 80) return { x: U1.x + 4.75 - (n - 61) * 0.5, y: U1.y + 5.125 }
throw new Error(`no perimeter pin ${n}`)
}