afazero/tscircuit-starter

Two boards are defined: a 5V red LED indicator with a 220Ω resistor and 100nF decoupling capacitor, plus a 5V RC low-pass filter using a 187Ω resistor and 10µF capacitor for transient SPICE simulation.

Version
1.0.0
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone afazero/tscircuit-starter  # download the package files into ./tscircuit-starter
tsci add afazero/tscircuit-starter    # add it to your project as @tsci/afazero.tscircuit-starter

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.

sim.tsx

// Board 2: RC low-pass filter + simulasi transien SPICE.
// Buka di dev server dengan: http://localhost:3020/#file=sim.tsx
// (board ini fokus ke schematic + simulation, bukan fabrikasi)
export default () => (
  <board width={16} height={16} schMaxTraceDistance={5}>
    <voltagesource name="V1" voltage="5V" schX={-4} schY={1} schRotation={270} />
    <resistor name="R1" resistance="187ohm" footprint="0402" schX={-1} schY={0} />
    <capacitor
      name="C1"
      capacitance="10uF"
      footprint="0402"
      schX={2}
      schY={1}
      schRotation={270}
    />

    <trace name="VIN" from=".V1 > .pin1" to=".R1 > .pin1" />
    <trace name="RC" from=".R1 > .pin2" to=".C1 > .pin1" />
    <trace name="CGND" from=".C1 > .pin2" to="net.GND" />
    <trace name="VGND" from=".V1 > .pin2" to="net.GND" />

    <voltageprobe connectsTo=".V1 > .pin1" />
    <voltageprobe connectsTo=".C1 > .pin1" />

    <analogsimulation duration="15ms" timePerStep="0.1ms" spiceEngine="ngspice" />
  </board>
)