mohan-bee/keychain

This design features a battery-powered electronic circuit with surface-mount LEDs, resistors, a squeeze switch, and custom silkscreen artwork on a PCB with specific component footprints and routing.

Version
1.0.1
License
unset
Stars
2

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone mohan-bee/keychain  # download the package files into ./keychain
tsci add mohan-bee/keychain    # add it to your project as @tsci/mohan-bee.keychain

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

dist/index.js

PCBPCB preview for dist/index.js
import { jsxs, jsx } from 'react/jsx-runtime';

const SqueezeSwitch = (props) => (jsx("chip", { name: props.name, pcbX: props.pcbX, pcbY: props.pcbY, pinLabels: { pin1: ["1"], pin2: ["2"] }, footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["1"], shape: "rect", width: "8mm", height: "12mm", pcbX: "-4.5mm", pcbY: "0mm", layer: "top" }), jsx("smtpad", { portHints: ["2"], shape: "rect", width: "8mm", height: "12mm", pcbX: "4.5mm", pcbY: "0mm", layer: "top" })] }) }));
var index_circuit = () => (jsxs("board", { minViaHoleDiameter: "0.3mm", minViaPadDiameter: "0.45mm", width: "34mm", height: "36mm", pcbX: "0", pcbY: "0", borderRadius: "4mm", children: [jsx("pinheader", { name: "B1", gender: "female", pinCount: 2, pitch: "2.54mm", pcbX: -12, pcbY: -15 }), jsx("hole", { pcbX: "-13mm", pcbY: "14mm", diameter: "3mm", name: "H1" }), jsx("led", { name: "LED1", footprint: "1206", color: "red", pcbX: "0mm", pcbY: "8.5mm", layer: "top" }), jsx("resistor", { name: "R1", resistance: "220", footprint: "0603", pcbX: "0mm", pcbY: "10.5mm", layer: "top" }), jsx("led", { name: "LED2", footprint: "1206", color: "red", pcbX: "-4.5mm", pcbY: "12.5mm", layer: "top" }), jsx("resistor", { name: "R2", resistance: "220", footprint: "0603", pcbX: "-4.5mm", pcbY: "15mm", layer: "top" }), jsx("led", { name: "LED3", footprint: "1206", color: "red", pcbX: "4.5mm", pcbY: "12.5mm", layer: "top" }), jsx("resistor", { name: "R3", resistance: "220", footprint: "0603", pcbX: "4.5mm", pcbY: "15mm", layer: "top" }), jsx("silkscreenpath", { layer: "top", strokeWidth: "0.5mm", route: [
                { x: 0.0, y: 13.0 },
                { x: 0.01, y: 13.11 },
                { x: 0.07, y: 13.43 },
                { x: 0.24, y: 13.92 },
                { x: 0.54, y: 14.51 },
                { x: 1.0, y: 15.13 },
                { x: 1.62, y: 15.7 },
                { x: 2.4, y: 16.15 },
                { x: 3.28, y: 16.41 },
                { x: 4.24, y: 16.45 },
                { x: 5.2, y: 16.25 },
                { x: 6.1, y: 15.82 },
                { x: 6.88, y: 15.19 },
                { x: 7.49, y: 14.39 },
                { x: 7.87, y: 13.48 },
                { x: 8.0, y: 12.5 },
                { x: 7.87, y: 11.5 },
                { x: 7.49, y: 10.51 },
                { x: 6.88, y: 9.55 },
                { x: 6.1, y: 8.63 },
                { x: 5.2, y: 7.75 },
                { x: 4.24, y: 6.91 },
                { x: 3.28, y: 6.09 },
                { x: 2.4, y: 5.31 },
                { x: 1.62, y: 4.56 },
                { x: 1.0, y: 3.87 },
                { x: 0.54, y: 3.25 },
                { x: 0.24, y: 2.73 },
                { x: 0.07, y: 2.33 },
                { x: 0.01, y: 2.08 },
                { x: 0.0, y: 2.0 },
                { x: -0.01, y: 2.08 },
                { x: -0.07, y: 2.33 },
                { x: -0.24, y: 2.73 },
                { x: -0.54, y: 3.25 },
                { x: -1, y: 3.87 },
                { x: -1.62, y: 4.56 },
                { x: -2.4, y: 5.31 },
                { x: -3.28, y: 6.09 },
                { x: -4.24, y: 6.91 },
                { x: -5.2, y: 7.75 },
                { x: -6.1, y: 8.63 },
                { x: -6.88, y: 9.55 },
                { x: -7.49, y: 10.51 },
                { x: -7.87, y: 11.5 },
                { x: -8, y: 12.5 },
                { x: -7.87, y: 13.48 },
                { x: -7.49, y: 14.39 },
                { x: -6.88, y: 15.19 },
                { x: -6.1, y: 15.82 },
                { x: -5.2, y: 16.25 },
                { x: -4.24, y: 16.45 },
                { x: -3.28, y: 16.41 },
                { x: -2.4, y: 16.15 },
                { x: -1.62, y: 15.7 },
                { x: -1, y: 15.13 },
                { x: -0.54, y: 14.51 },
                { x: -0.24, y: 13.92 },
                { x: -0.07, y: 13.43 },
                { x: -0.01, y: 13.11 },
                { x: -0, y: 13.0 },
            ] }), jsx(SqueezeSwitch, { name: "SW1", pcbX: "0mm", pcbY: "-9.5mm" }), jsx("silkscreentext", { text: "Stay wild. friend.", pcbX: "0mm", pcbY: "0mm", fontSize: "2mm", anchorAlignment: "center", layer: "top" }), jsx("silkscreentext", { text: "tscircuit", pcbX: "9mm", pcbY: "-16.5mm", fontSize: "1.5mm", anchorAlignment: "center", layer: "top" }), jsx("silkscreenrect", { pcbX: 12, layer: "top", pcbY: -13, width: 4, height: 4, cornerRadius: 1 }), jsx("silkscreentext", { text: "ts", layer: "top", pcbX: 12, pcbY: -13, fontSize: "1.5mm" }), jsx("silkscreencircle", { layer: "top", pcbX: 11, pcbY: -12, radius: 0.1 }), jsx("trace", { from: ".B1 > .pin1", to: ".R1 > .pin1" }), jsx("trace", { from: ".B1 > .pin1", to: ".R2 > .pin1" }), jsx("trace", { from: ".B1 > .pin1", to: ".R3 > .pin1" }), jsx("trace", { from: ".R1 > .pin2", to: ".LED1 > .pin1" }), jsx("trace", { from: ".R2 > .pin2", to: ".LED2 > .pin1" }), jsx("trace", { from: ".R3 > .pin2", to: ".LED3 > .pin1" }), jsx("trace", { from: ".LED1 > .pin2", to: ".SW1 > .pin1" }), jsx("trace", { from: ".LED2 > .pin2", to: ".SW1 > .pin1" }), jsx("trace", { from: ".LED3 > .pin2", to: ".SW1 > .pin1" }), jsx("trace", { from: ".SW1 > .pin2", to: ".B1 > .pin2" })] }));

export { index_circuit as default };