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

parts/Power.tsx

import type { ChipProps } from "tscircuit"
import { pad, outline, courtyard } from "../lib/footprints"

/** USB-C 6-pin power-only receptacle "TYPE-C 6P" (JLC C456012, 527k in stock): GND, VBUS, CC1,
 * CC2, VBUS, GND plus four plated shell legs. Charging only: the nRF9151 has no USB peripheral,
 * so there are no D+/D- contacts. The nPM1300 CC1/CC2 pins carry the 5.1 kOhm Rd pull-downs
 * internally (nPM1300 PS SYSREG), so the CC lines go straight to the PMIC.
 * Geometry: the EasyEDA footprint of C456012 (tsci import), contact row at +y, the plug enters
 * from -y. Core centres the footprint on its pad bounds, so relative to pcbX/pcbY the contacts sit
 * at y = +2.15, the shell legs at +/-1.9 and the receptacle mouth (body front) at y = -3.5. */
export const usbC6pPins = {
  pin1: ["GND1"], pin2: ["VBUS1"], pin3: ["CC1"], pin4: ["CC2"], pin5: ["VBUS2"], pin6: ["GND2"],
  pin7: ["SHELL1"], pin8: ["SHELL2"], pin9: ["SHELL3"], pin10: ["SHELL4"],
} as const
export const UsbC6p = (props: ChipProps<typeof usbC6pPins>) => (
  <chip
    {...props}
    manufacturerPartNumber="TYPE-C 6P"
    supplierPartNumbers={{ jlcpcb: ["C456012"] }}
    pinLabels={usbC6pPins}
    internallyConnectedPins={[["GND1", "GND2", "SHELL1", "SHELL2", "SHELL3", "SHELL4"], ["VBUS1", "VBUS2"]]}
    footprint={
      <footprint insertionDirection="from_y_neg">
        {pad(1, -2.7, 1.75, 0.8, 1.2)}
        {pad(2, -1.5, 1.75, 0.7, 1.2)}
        {pad(3, -0.5, 1.75, 0.7, 1.2)}
        {pad(4, 0.5, 1.75, 0.7, 1.2)}
        {pad(5, 1.5, 1.75, 0.7, 1.2)}
        {pad(6, 2.7, 1.75, 0.8, 1.2)}
        {[[-4.32, 1.5], [4.32, 1.5], [-4.32, -2.3], [4.32, -2.3]].map(([x, y], i) => (
          <platedhole key={`sh${i}`} portHints={[`pin${7 + i}`]} pcbX={x} pcbY={y} shape="pill" holeWidth={0.6} holeHeight={1.4} outerWidth={1.1} outerHeight={1.9} />
        ))}
        <silkscreenpath route={[{ x: -4.47, y: -3.9 }, { x: 4.47, y: -3.9 }]} strokeWidth={0.12} />
        <courtyardoutline outline={[{ x: -5.1, y: 2.7 }, { x: 5.1, y: 2.7 }, { x: 5.1, y: -4.0 }, { x: -5.1, y: -4.0 }, { x: -5.1, y: 2.7 }]} />
      </footprint>
    }
    cadModel={{
      objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C456012.obj?uuid=a8c86ef7d632469a8c796c24a9574b1e",
      stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C456012.step?uuid=a8c86ef7d632469a8c796c24a9574b1e",
      pcbRotationOffset: 180,
      modelOriginPosition: { x: 0, y: -2.2999, z: 0.06 },
    }}
    schPinArrangement={{ rightSide: { direction: "top-to-bottom", pins: ["VBUS1", "VBUS2", "CC1", "CC2", "GND1", "GND2", "SHELL1", "SHELL2", "SHELL3", "SHELL4"] } }}
    pinAttributes={{ GND1: { requiresGround: true }, GND2: { requiresGround: true }, SHELL1: { requiresGround: true }, VBUS1: { providesPower: true } }}
  />
)

/** JST PH 2.0 mm 2-pin SMD right-angle header S2B-PH-SM4-TB(LF)(SN) (JLC C295747, 113k in stock).
 * Footprint from the tsci import of C295747 (100 % copper match to footprinter "fpc2"). Relative to the
 * component centre (pad-bounds centre): contacts 1.0 x 3.8 mm at (-1, +2.82) pin 1 and (+1, +2.82) pin 2,
 * retention lands 1.5 x 3.4 mm at (+/-3.35, -3.02). Wire entry is on the retention-land side (-y
 * unrotated; JST ePH drawing), so rotate 180 degrees for a +y opening.
 * Pin 1 = BAT+ (red) and pin 2 = BAT- (black) is SparkFun's documented JST-PH LiPo convention
 * (learn.sparkfun.com "Single Cell LiPo Battery Care", JST-PH connectors). About half of the cell
 * vendors wire it the other way: check every purchased cell with a meter before plugging it in. */
export const jstPh2Pins = { pin1: ["BAT_P"], pin2: ["BAT_N"], pin3: ["MNT1"], pin4: ["MNT2"] } as const
export const JstPh2 = (props: ChipProps<typeof jstPh2Pins>) => (
  <chip
    {...props}
    manufacturerPartNumber="S2B-PH-SM4-TB(LF)(SN)"
    supplierPartNumbers={{ jlcpcb: ["C295747"] }}
    pinLabels={jstPh2Pins}
    footprint={
      <footprint insertionDirection="from_y_neg">
        {/* the footprinter "fpc2_p2mm_pw1mm_pl3.8mm_mpx6.7mm_mpy5.85mm_mpw1.5mm_mpl3.4mm" pattern (100 % copper match to
            the EasyEDA land of C295747), written out so the wire-entry direction can be declared */}
        <smtpad portHints={["pin1"]} pcbX={-1} pcbY={0} width={1} height={3.8} shape="rect" />
        <smtpad portHints={["pin2"]} pcbX={1} pcbY={0} width={1} height={3.8} shape="rect" />
        <smtpad portHints={["pin3"]} pcbX={3.35} pcbY={-5.85} width={1.5} height={3.4} shape="rect" />
        <smtpad portHints={["pin4"]} pcbX={-3.35} pcbY={-5.85} width={1.5} height={3.4} shape="rect" />
        <silkscreenpath route={[{ x: -3.9, y: 1.1 }, { x: -3.9, y: -3.6 }]} strokeWidth={0.12} />
        <silkscreenpath route={[{ x: 3.9, y: 1.1 }, { x: 3.9, y: -3.6 }]} strokeWidth={0.12} />
        <silkscreentext text="+" pcbX={-1} pcbY={2.5} fontSize={0.8} anchorAlignment="center" />
        <courtyardoutline outline={[{ x: -4.35, y: 2.2 }, { x: 4.35, y: 2.2 }, { x: 4.35, y: -7.8 }, { x: -4.35, y: -7.8 }, { x: -4.35, y: 2.2 }]} />
      </footprint>
    }
    cadModel={{
      objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C295747.obj?uuid=e009435048914ef2b30a218c3065ed28",
      stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C295747.step?uuid=e009435048914ef2b30a218c3065ed28",
      pcbRotationOffset: 0,
      modelOriginPosition: { x: -1.0, y: 2.85, z: 0 },
    }}
    schPinArrangement={{ rightSide: { direction: "top-to-bottom", pins: ["BAT_P", "BAT_N", "MNT1", "MNT2"] } }}
    pinAttributes={{ BAT_N: { requiresGround: true }, BAT_P: { providesPower: true } }}
  />
)

export { outline, courtyard }