mohan-bee/infrared-battle-tag
A compact board featuring an ATtiny1616 microcontroller, tactile switch, and MMBT2222A transistor, with VCC/GND power and the switch connected to the MCU’s PA4 input.
- Version
- 1.0.2
- License
- unset
- Stars
- 0
dist/index.js
import { jsx, jsxs } from 'react/jsx-runtime';
import { Fragment } from 'react';
const pinLabels$4 = {
pin1: ["VDD"],
pin2: ["PA4"],
pin3: ["PA5"],
pin4: ["PA6"],
pin5: ["PA7"],
pin6: ["PB5"],
pin7: ["PB4"],
pin8: ["PB3", "TOSC1"],
pin9: ["PB2", "TOSC2"],
pin10: ["PB1"],
pin11: ["PB0"],
pin12: ["PC0"],
pin13: ["PC1"],
pin14: ["PC2"],
pin15: ["PC3"],
pin16: ["PA0", "UPDI", "RESET"],
pin17: ["PA1"],
pin18: ["PA2"],
pin19: ["PA3", "EXTCLK"],
pin20: ["GND"]
};
const pinAttributes$1 = {
pin1: { requiresPower: true },
pin20: { requiresGround: true }
};
const ATTINY1616_SN = (props) => {
return (jsx("chip", { pinLabels: pinLabels$4, pinAttributes: pinAttributes$1, supplierPartNumbers: {
"jlcpcb": [
"C614136"
]
}, manufacturerPartNumber: "ATTINY1616-SN", footprint: "soic20_pillpads_w11.82mm_pw0.59mm_pl2.36mm_pin1location(leftside,bottom)", cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C614136.obj?uuid=d767b157409641d0a32b7431c9b1a541",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C614136.step?uuid=d767b157409641d0a32b7431c9b1a541",
pcbRotationOffset: 0,
modelOriginPosition: { x: 0, y: 0, z: -0.049425 },
}, ...props }));
};
const pinLabels$3 = {
pin1: ["OUT"],
pin2: ["GND"],
pin3: ["VS"]
};
const pinAttributes = {
pin2: { requiresGround: true },
pin3: { requiresPower: true }
};
const TSOP38238 = (props) => {
return (jsx("chip", { pinLabels: pinLabels$3, pinAttributes: pinAttributes, supplierPartNumbers: {
"jlcpcb": [
"C141632"
]
}, manufacturerPartNumber: "TSOP38238", footprint: "pinrow3_nosquareplating_od1.6mm", cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C141632.obj?uuid=6d8e55dc3298485d9d93c8fdc0568da8",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C141632.step?uuid=6d8e55dc3298485d9d93c8fdc0568da8",
pcbRotationOffset: 0,
modelOriginPosition: { x: -23850000000003035e-20, y: 0.20646470000002726, z: -4.975007 },
}, ...props }));
};
const pinLabels$2 = {
pin1: ["anode", "pos"],
pin2: ["cathode", "neg"]
};
const TSAL6200 = (props) => {
const { name = "LED1", ...restProps } = props;
return (jsx("led", { name: name, pinLabels: pinLabels$2, supplierPartNumbers: {
"jlcpcb": [
"C55528"
]
}, manufacturerPartNumber: "TSAL6200", footprint: "pinrow2_nosquareplating_od1.6mm_nosilkscreen", cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C55528.obj?uuid=b322f11ad7274358b77d0ea2f14da52e",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C55528.step?uuid=b322f11ad7274358b77d0ea2f14da52e",
pcbRotationOffset: 0,
modelOriginPosition: { x: 0.2299932, y: 0.000012699999984988608, z: -10000000000509601e-21 },
}, ...restProps }));
};
const MMBT2222ALT1G = (props) => {
return (jsx("transistor", { type: "npn", symbol: jsxs("symbol", { children: [jsx("schematictext", { text: props.name ?? "Q1", schX: 0.7, schY: 0.45, fontSize: 0.18 }), jsx("schematicpath", { points: [{ "x": 0.2, "y": -0.2 }, { "x": 0.14, "y": -0.1 }, { "x": 0.08, "y": -0.18 }, { "x": 0.2, "y": -0.2 }], strokeColor: "#880000", isFilled: true, fillColor: "#880000" }), jsx("schematicpath", { points: [{ "x": 0.2, "y": 0.2 }, { "x": 0, "y": 0.06 }], strokeColor: "#880000" }), jsx("schematicpath", { points: [{ "x": 0, "y": -0.06 }, { "x": 0.2, "y": -0.2 }], strokeColor: "#880000" }), jsx("schematicpath", { points: [{ "x": 0, "y": 0.18 }, { "x": 0, "y": -0.18 }], strokeColor: "#880000" }), jsx("port", { schPinLabelFontSize: 0.08, name: "pin3", pinNumber: 3, direction: "up", schX: 0.2, schY: 0.6, schStemLength: 0.4 }), jsx("port", { schPinLabelFontSize: 0.08, name: "pin1", pinNumber: 1, direction: "left", schX: -0.4, schY: 0, schStemLength: 0.4 }), jsx("port", { schPinLabelFontSize: 0.08, name: "pin2", pinNumber: 2, direction: "down", schX: 0.2, schY: -0.6, schStemLength: 0.4 })] }), supplierPartNumbers: {
"jlcpcb": [
"C82460"
]
}, manufacturerPartNumber: "MMBT2222ALT1G", footprint: "sot23w_p1mm_pw0.65mm_pin1location(rightside,bottom)_nosilkscreen", cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C82460.obj?uuid=d777607a152f4f3aac9bb0d0c14ed6fd",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C82460.step?uuid=d777607a152f4f3aac9bb0d0c14ed6fd",
pcbRotationOffset: 180,
modelOriginPosition: { x: 0.000012700000070253736, y: -12699999956566899e-21, z: 0.050795 },
}, ...props }));
};
const pinLabels$1 = {
pin1: ["cathode", "neg"],
pin2: ["anode", "pos"]
};
const A_1N5819WS = (props) => {
const { name = "D1", ...restProps } = props;
return (jsx("diode", { name: name, pinLabels: pinLabels$1, supplierPartNumbers: {
"jlcpcb": [
"C191023"
]
}, manufacturerPartNumber: "1N5819WS", footprint: "smdpads2_p2.3449mm_pw1mm_ph0.7mm_cyw3.8528mm_cyh2.1002mm", cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C191023.obj?uuid=7459fe65e23146c0a8d836e46a0add72",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C191023.step?uuid=7459fe65e23146c0a8d836e46a0add72",
pcbRotationOffset: 0,
modelOriginPosition: { x: 0, y: 0.00011430000006384944, z: 0 },
}, ...restProps }));
};
const pinLabels = {
pin1: ["pin1"],
pin2: ["pin2"],
pin3: ["pin3"],
pin4: ["pin4"]
};
const TS_1102S_C_C_B = (props) => {
const { name = "SW1", ...restProps } = props;
return (jsx("pushbutton", { name: name, pinLabels: pinLabels, internallyConnectedPins: [["pin1", "pin2"], ["pin3", "pin4"]], supplierPartNumbers: {
"jlcpcb": [
"C381039"
]
}, manufacturerPartNumber: "TS-1102S-C-C-B", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin1"], pcbX: "-4.299966mm", pcbY: "2.250059mm", width: "2.1999956mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin2"], pcbX: "4.299966mm", pcbY: "2.250059mm", width: "2.1999956mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin3"], pcbX: "-4.299966mm", pcbY: "-2.250059mm", width: "2.1999956mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "4.299966mm", pcbY: "-2.250059mm", width: "2.1999956mm", height: "1.499997mm", shape: "rect" }), jsx("silkscreenpath", { route: [{ "x": -2.999994000000129, "y": 3.000044799999955 }, { "x": 2.999994000000015, "y": 3.000044799999955 }] }), jsx("silkscreenpath", { route: [{ "x": -2.999994000000129, "y": -2.9999431999999615 }, { "x": 2.999994000000015, "y": -2.9999431999999615 }] }), jsx("silkscreenpath", { route: [{ "x": -2.999994000000129, "y": 3.000044799999955 }, { "x": -2.999994000000129, "y": -2.9999431999999615 }] }), jsx("silkscreenpath", { route: [{ "x": 2.999994000000015, "y": 3.000044799999955 }, { "x": 2.999994000000015, "y": -2.9999431999999615 }] }), jsx("silkscreencircle", { pcbX: "0mm", pcbY: "0.000127mm", radius: "1.727454mm" }), jsx("silkscreencircle", { pcbX: "0mm", pcbY: "0.000127mm", radius: "1.3601192mm" }), jsx("silkscreencircle", { pcbX: "-2.149983mm", pcbY: "2.1500084mm", radius: "0.350012mm" }), jsx("silkscreencircle", { pcbX: "-2.1498814mm", pcbY: "-2.1498814mm", radius: "0.350012mm" }), jsx("silkscreencircle", { pcbX: "2.1500084mm", pcbY: "-2.1497544mm", radius: "0.350012mm" }), jsx("silkscreencircle", { pcbX: "2.1498814mm", pcbY: "2.15011mm", radius: "0.350012mm" }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.0127mm", pcbY: "4.037459mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [{ "x": -5.660200000000032, "y": 3.2874590000000126 }, { "x": 5.634799999999814, "y": 3.2874590000000126 }, { "x": 5.634799999999814, "y": -3.2323409999999058 }, { "x": -5.660200000000032, "y": -3.2323409999999058 }, { "x": -5.660200000000032, "y": 3.2874590000000126 }] })] }), cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C381039.obj?uuid=0c5cbc362e9d41ae95f9f77f620e8890",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C381039.step?uuid=0c5cbc362e9d41ae95f9f77f620e8890",
pcbRotationOffset: 0,
modelOriginPosition: { x: 0, y: -5080000005364127e-20, z: 0 },
}, ...restProps }));
};
// Two identical boards. External switched 3xAAA holder, 3.3–4.8 V input.
// PA4 generates the 38 kHz carrier. RESET_GAME is a GPIO, not UPDI/reset.
function BattleTag() {
return (jsxs("board", { width: "60mm", height: "45mm", layers: 2, autorouter: "auto-local", minTraceWidth: "0.25mm", pcbStyle: { silkscreenFontSize: 0.8 }, children: [jsx("schematicsheet", { name: "Main", displayName: "IR battle tag / Rev A", sheetSize: "A4" }), jsxs("group", { name: "circuit", schSheetName: "Main", children: [jsx("net", { name: "GND", isGroundNet: true }), jsx("net", { name: "VCC", isPowerNet: true, nominalTraceWidth: "0.5mm" }), jsx("net", { name: "VBAT", isPowerNet: true, nominalTraceWidth: "0.5mm" }), jsx("net", { name: "RX_VCC", isPowerNet: true }), ['IR_TX', 'IR_RX', 'FIRE', 'RESET_GAME', 'LIFE1', 'LIFE2', 'LIFE3', 'UPDI'].map(name => jsx(Fragment, { children: jsx("net", { name: name }) }, name)), jsx("schematicsection", { name: "Power", displayName: "01 / 3xAAA POWER" }), jsx("pinheader", { name: "J1", pinCount: 2, schX: (-14) * 0.6, schY: (8) * 0.6, pcbX: -24, pcbY: -14, schSectionName: "Power" }), jsx(A_1N5819WS, { pcbRotation: 180, name: "D1", schRotation: -90, schX: (-10) * 0.6, schY: (8) * 0.6, pcbX: -18, pcbY: -14, schSectionName: "Power" }), jsx("capacitor", { name: "C1", capacitance: "47uF", footprint: "1210", schX: (-6) * 0.6, schY: (7) * 0.6, schRotation: -90, pcbX: -13, pcbY: -12, schSectionName: "Power" }), jsx("capacitor", { name: "C2", pcbRotation: 180, capacitance: "100nF", footprint: "0603", schX: (-3) * 0.6, schY: (7) * 0.6, schRotation: -90, pcbX: -6.5, pcbY: -8, schSectionName: "Power" }), jsx("trace", { from: ".J1 > .pin1", to: "net.VBAT" }), jsx("trace", { from: ".J1 > .pin2", to: "net.GND" }), jsx("trace", { from: "net.VBAT", to: ".D1 > .anode" }), jsx("trace", { from: ".D1 > .cathode", to: "net.VCC" }), jsx("trace", { from: ".C1 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".C1 > .pin2", to: "net.GND" }), jsx("trace", { from: ".C2 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".C2 > .pin2", to: "net.GND" }), jsx("schematicsection", { name: "MCU", displayName: "02 / CONTROLLER + UPDI" }), jsx(ATTINY1616_SN, { name: "U1", schX: (5) * 0.6, schY: (6) * 0.6, schWidth: 1.7, schHeight: 2.2, pcbX: 0, pcbY: 0, schSectionName: "MCU", schPinArrangement: { leftSide: [1, 16, 17, 18, 19, 6, 7, 8, 9, 20], rightSide: [2, 3, 4, 5, 10, 11, 12, 13, 14, 15] }, noConnect: ['pin6', 'pin7', 'pin8', 'pin9', 'pin12', 'pin13', 'pin14', 'pin15', 'pin18', 'pin19'] }), jsx("pinheader", { name: "J2", pinCount: 3, schX: (3) * 0.6, schY: (2) * 0.6, pcbX: 19, pcbY: -15, schSectionName: "MCU" }), jsx("trace", { from: ".U1 > .VDD", to: "net.VCC" }), jsx("trace", { from: ".U1 > .GND", to: "net.GND" }), jsx("trace", { from: ".U1 > .UPDI", to: "net.UPDI" }), jsx("trace", { from: ".J2 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".J2 > .pin2", to: "net.UPDI" }), jsx("trace", { from: ".J2 > .pin3", to: "net.GND" }), jsx("trace", { from: ".U1 > .PA4", to: "net.IR_TX" }), jsx("trace", { from: ".U1 > .PA1", to: "net.IR_RX" }), jsx("trace", { from: ".U1 > .PA5", to: "net.LIFE1" }), jsx("trace", { from: ".U1 > .PA6", to: "net.LIFE2" }), jsx("trace", { from: ".U1 > .PA7", to: "net.LIFE3" }), jsx("trace", { from: ".U1 > .PB1", to: "net.FIRE" }), jsx("trace", { from: ".U1 > .PB0", to: "net.RESET_GAME" }), jsx("schematicsection", { name: "TX", displayName: "03 / 940nm TRANSMITTER" }), jsx("resistor", { name: "R1", resistance: "68", footprint: "1206", schX: (21) * 0.6, schY: (10) * 0.6, schRotation: -90, pcbX: -16, pcbY: 12, schSectionName: "TX" }), jsx(TSAL6200, { name: "LED1", schDisplayValue: "TSAL6200", schX: (21) * 0.6, schY: (7.5) * 0.6, schRotation: -90, pcbX: -20, pcbY: 18, schSectionName: "TX" }), jsx(MMBT2222ALT1G, { name: "Q1", schX: (20.8) * 0.6, schY: (5) * 0.6, pcbX: -15, pcbY: 7, schSectionName: "TX" }), jsx("resistor", { name: "R2", pcbRotation: 180, resistance: "680", footprint: "0603", schX: (17) * 0.6, schY: (5) * 0.6, pcbX: -10, pcbY: 7, schSectionName: "TX" }), jsx("resistor", { name: "R3", resistance: "100k", footprint: "0603", schX: (19) * 0.6, schY: (2.5) * 0.6, schRotation: -90, pcbX: -15, pcbY: 3, schSectionName: "TX" }), jsx("trace", { from: "net.VCC", to: ".R1 > .pin1" }), jsx("trace", { from: ".R1 > .pin2", to: ".LED1 > .anode" }), jsx("trace", { from: ".LED1 > .cathode", to: ".Q1 > .pin3" }), jsx("trace", { from: ".Q1 > .pin2", to: "net.GND" }), jsx("trace", { from: "net.IR_TX", to: ".R2 > .pin1" }), jsx("trace", { from: ".R2 > .pin2", to: ".Q1 > .pin1" }), jsx("trace", { from: ".R3 > .pin1", to: ".Q1 > .pin1" }), jsx("trace", { from: ".R3 > .pin2", to: "net.GND" }), jsx("schematicsection", { name: "RX", displayName: "04 / 38kHz RECEIVER" }), jsx("resistor", { name: "R4", schRotation: -90, resistance: "100", footprint: "0603", schX: (19) * 0.6, schY: (-2) * 0.6, pcbX: 17, pcbY: 11, schSectionName: "RX" }), jsx("capacitor", { name: "C3", capacitance: "4.7uF", footprint: "0805", schX: (22) * 0.6, schY: (-4) * 0.6, schRotation: -90, pcbX: 22, pcbY: 11, schSectionName: "RX" }), jsx(TSOP38238, { name: "U2", schX: (18) * 0.6, schY: (-6) * 0.6, schWidth: 1, schHeight: 0.4, pcbX: 20, pcbY: 18, schSectionName: "RX", schPinArrangement: { leftSide: [3, 2], rightSide: [1] } }), jsx("trace", { from: "net.VCC", to: ".R4 > .pin1" }), jsx("trace", { from: ".R4 > .pin2", to: "net.RX_VCC" }), jsx("trace", { from: ".C3 > .pin1", to: "net.RX_VCC" }), jsx("trace", { from: ".C3 > .pin2", to: "net.GND" }), jsx("trace", { from: ".U2 > .VS", to: "net.RX_VCC" }), jsx("trace", { from: ".U2 > .GND", to: "net.GND" }), jsx("trace", { from: ".U2 > .OUT", to: "net.IR_RX" }), jsx("schematicsection", { name: "UI", displayName: "05 / LIVES" }), [0, 1, 2].map(i => jsxs(Fragment, { children: [jsx("resistor", { name: `R${5 + i}`, pcbRotation: i === 0 ? 180 : 0, resistance: "1k", footprint: "0603", schX: (-12 + i * 5) * 0.6, schY: (-2) * 0.6, schRotation: -90, pcbX: -7 + i * 7, pcbY: 11, schSectionName: "UI" }), jsx("led", { name: `LED${2 + i}`, color: "red", schDisplayValue: "RED", footprint: "0805", schX: (-12 + i * 5) * 0.6, schY: (-4.5) * 0.6, schRotation: -90, pcbX: -7 + i * 7, pcbY: 16, schSectionName: "UI" }), jsx("trace", { from: `net.LIFE${i + 1}`, to: `.R${5 + i} > .pin1` }), jsx("trace", { from: `.R${5 + i} > .pin2`, to: `.LED${2 + i} > .anode` }), jsx("trace", { from: `.LED${2 + i} > .cathode`, to: "net.GND" })] }, i)), jsx(TS_1102S_C_C_B, { name: "SW1", schX: -7.87, schY: (-10) * 0.6, pcbX: -14, pcbY: -5, schSectionName: "UI" }), jsx(TS_1102S_C_C_B, { name: "SW2", schX: (-3) * 0.6, schY: (-10) * 0.6, pcbX: 14, pcbY: -5, schSectionName: "UI" }), jsx("resistor", { name: "R8", resistance: "10k", footprint: "0603", schX: (-14) * 0.6, schY: (-8) * 0.6, schRotation: -90, pcbX: -21, pcbY: 0, schSectionName: "UI" }), jsx("resistor", { name: "R9", resistance: "10k", footprint: "0603", schX: (-6) * 0.6, schY: (-8) * 0.6, schRotation: -90, pcbX: 21, pcbY: 0, schSectionName: "UI" }), jsx("trace", { from: ".R8 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".R8 > .pin2", to: "net.FIRE" }), jsx("trace", { from: ".R9 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".R9 > .pin2", to: "net.RESET_GAME" }), jsx("trace", { from: ".SW1 > .pin1", to: "net.FIRE" }), jsx("trace", { from: ".SW1 > .pin3", to: "net.GND" }), jsx("trace", { from: ".SW2 > .pin1", to: "net.RESET_GAME" }), jsx("trace", { from: ".SW2 > .pin3", to: "net.GND" })] }), [[-26, -18.5], [26, -18.5], [-26, 18.5], [26, 18.5]].map(([x, y], i) => jsx(Fragment, { children: jsx("hole", { name: `H${i + 1}`, diameter: "2.5mm", pcbX: x, pcbY: y }) }, i)), jsx("silkscreentext", { text: "Q1", pcbX: -12.5, pcbY: 5.5, fontSize: 0.8 }), jsx("silkscreencircle", { pcbX: -20, pcbY: 18, radius: 2.5 }), jsx("silkscreentext", { text: "IR TX", pcbX: -20, pcbY: 21.3, fontSize: 0.8 }), jsx("silkscreentext", { text: "A", pcbX: -21.27, pcbY: 16.3, fontSize: 0.8 }), jsx("silkscreentext", { text: "K", pcbX: -18.73, pcbY: 16.3, fontSize: 0.8 }), jsx("silkscreentext", { text: "IR BATTLE TAG / REV A", pcbX: 0, pcbY: -20, fontSize: 1.1 }), jsx("silkscreentext", { text: "FIRE", pcbX: -17, pcbY: -10, fontSize: 1 }), jsx("silkscreentext", { text: "NEW GAME", pcbX: 14, pcbY: -10, fontSize: 1 }), jsx("silkscreentext", { text: "3xAAA + / -", pcbX: -21, pcbY: -17, fontSize: 0.8 }), jsx("silkscreentext", { text: "V / UPDI / G", pcbX: 19, pcbY: -18, fontSize: 0.8 })] }));
}
export { BattleTag as default };