ShiboSoftwareDev/ne555-timer-presets

NE555DR astable timer with prebuilt timing and LED options.

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 ShiboSoftwareDev/ne555-timer-presets  # download the package files into ./ne555-timer-presets
tsci add ShiboSoftwareDev/ne555-timer-presets    # add it to your project as @tsci/ShiboSoftwareDev.ne555-timer-presets

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, Fragment } from 'react/jsx-runtime';
import { z } from 'zod';

const propsSchema = z.object({
    timingCapacitance: z.enum(["10uF", "100uF"]).default("10uF"),
    omitLed: z.boolean().default(false),
});
const presets = {
    full_board: {},
    slow: { timingCapacitance: "100uF" },
    without_led: { omitLed: true },
};
function Ne555Timer(input = {}) {
    const props = propsSchema.parse(input);
    return (jsxs("board", { width: "40mm", height: "26mm", children: [jsx("chip", { name: "U1", manufacturerPartNumber: "NE555DR", footprint: "soic8", pinLabels: {
                    pin1: "GND",
                    pin2: "TRIG",
                    pin3: "OUT",
                    pin4: "RESET",
                    pin5: "CTRL",
                    pin6: "THRESH",
                    pin7: "DISCH",
                    pin8: "VCC",
                }, schPinArrangement: {
                    leftSide: ["RESET", "TRIG", "THRESH"],
                    rightSide: ["OUT", "DISCH", "CTRL"],
                    topSide: ["VCC"],
                    bottomSide: ["GND"],
                }, pcbX: 0, pcbY: 0, schX: 0, schY: 0 }), jsx("pinheader", { name: "J1", pinCount: 2, pcbX: -15, pcbY: 0, schX: -8, schY: 3 }), jsx("resistor", { name: "R1", resistance: "10k", footprint: "0805", pcbX: -7, pcbY: 7, schX: 3, schY: 3 }), jsx("resistor", { name: "R2", resistance: "68k", footprint: "0805", pcbX: 0, pcbY: 7, schX: 3, schY: 0 }), jsx("capacitor", { name: "C1", capacitance: props.timingCapacitance, footprint: "0805", pcbX: 7, pcbY: 7, schX: 3, schY: -3 }), jsx("capacitor", { name: "C2", capacitance: "10nF", footprint: "0805", pcbX: 7, pcbY: 0, schX: 5, schY: -3 }), jsx("capacitor", { name: "C3", capacitance: "100nF", footprint: "0805", pcbX: 0, pcbY: -7, schX: -5, schY: 0 }), !props.omitLed && (jsxs(Fragment, { children: [jsx("resistor", { name: "R3", resistance: "1k", footprint: "0805", pcbX: 10, pcbY: -7, schX: 7, schY: 1 }), jsx("led", { name: "D1", color: "red", footprint: "0805", pinLabels: { pin1: "cathode", pin2: "anode" }, pcbX: 15, pcbY: -7, schX: 7, schY: -2 }), jsx("trace", { from: ".U1 > .OUT", to: ".R3 > .pin1" }), jsx("trace", { from: ".R3 > .pin2", to: ".D1 > .anode" }), jsx("trace", { from: ".D1 > .cathode", to: "net.GND" })] })), jsx("net", { name: "VCC" }), jsx("net", { name: "GND" }), jsx("trace", { from: ".J1 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".J1 > .pin2", to: "net.GND" }), jsx("trace", { from: ".U1 > .VCC", to: "net.VCC" }), jsx("trace", { from: ".U1 > .RESET", to: "net.VCC" }), jsx("trace", { from: ".U1 > .GND", to: "net.GND" }), jsx("trace", { from: ".R1 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".R1 > .pin2", to: ".U1 > .DISCH" }), jsx("trace", { from: ".R2 > .pin1", to: ".U1 > .DISCH" }), jsx("trace", { from: ".R2 > .pin2", to: ".U1 > .THRESH" }), jsx("trace", { from: ".U1 > .THRESH", to: ".U1 > .TRIG" }), jsx("trace", { from: ".C1 > .pin1", to: ".U1 > .THRESH" }), jsx("trace", { from: ".C1 > .pin2", to: "net.GND" }), jsx("trace", { from: ".C2 > .pin1", to: ".U1 > .CTRL" }), jsx("trace", { from: ".C2 > .pin2", to: "net.GND" }), jsx("trace", { from: ".C3 > .pin1", to: "net.VCC" }), jsx("trace", { from: ".C3 > .pin2", to: "net.GND" }), jsx("schematictext", { text: "NE555 astable timer, 5 V supply", schX: 0, schY: 5 })] }));
}

export { Ne555Timer as default, presets, propsSchema };