mohan-bee/home-v1
This hardware design incorporates a solar charge controller with fused input lines, Schottky and TVS protection diodes, MOSFET switches for energy routing, a temperature sensor, and status LEDs for PV, battery, and load indicators.
- Version
- 0.0.1
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone mohan-bee/home-v1 # download the package files into ./home-v1
tsci add mohan-bee/home-v1 # add it to your project as @tsci/mohan-bee.home-v1In 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.cjs
'use strict';
var jsxRuntime = require('react/jsx-runtime');
const controllerPinLabels = {
pin1: "VIN",
pin2: "LIGHT_IN",
pin3: "FAN_IN",
pin4: "GND",
pin5: "LIGHT_GATE",
pin6: "FAN_GATE",
pin7: "NC",
pin8: "ENABLE",
};
const InputChannel = ({ switchName, pullDownName, statusResistorName, statusLedName, controllerInputPort, controllerGatePort, switchX, switchY, ledX, ledY, }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("pushbutton", { name: switchName, footprint: "pushbutton_id1.3mm_od2mm", pcbRotation: "90deg", pcbX: switchX, pcbY: switchY, connections: {
pin1: `.U1 > .${controllerInputPort}`,
pin2: "net.VBUS",
pin3: `.U1 > .${controllerInputPort}`,
pin4: "net.VBUS",
} }), jsxRuntime.jsx("resistor", { name: pullDownName, resistance: "100k", footprint: "0402", pcbX: switchX, pcbY: 18, connections: { pin1: `.U1 > .${controllerInputPort}`, pin2: "net.GND" } }), jsxRuntime.jsx("resistor", { name: statusResistorName, resistance: "1k", footprint: "0402", pcbX: ledX - 4, pcbY: 0, connections: {
pin1: `.U1 > .${controllerGatePort}`,
pin2: `.${statusLedName} > .pos`,
} }), jsxRuntime.jsx("led", { name: statusLedName, color: "red", footprint: "0402", pcbX: ledX, pcbY: ledY, connections: { pos: `.${statusResistorName} > .pin2`, neg: "net.GND" } })] }));
const HomeController = ({ name }) => (jsxRuntime.jsx("chip", { name: name, footprint: "soic8", pinLabels: controllerPinLabels, pcbX: 0, pcbY: 0 }));
function LevelOneHomeAutomationBoard() {
return (jsxRuntime.jsxs("board", { width: "60mm", height: "60mm", schAutoLayoutEnabled: true, children: [jsxRuntime.jsx("voltagesource", { name: "VIN", voltage: "5V" }), jsxRuntime.jsx("capacitor", { name: "C1", capacitance: "10uF", footprint: "0402", pcbX: -14, pcbY: -22 }), jsxRuntime.jsx("capacitor", { name: "C2", capacitance: "100nF", footprint: "0402", pcbX: 14, pcbY: -22 }), jsxRuntime.jsx(HomeController, { name: "U1" }), jsxRuntime.jsx(InputChannel, { controllerInputPort: "LIGHT_IN", controllerGatePort: "LIGHT_GATE", switchName: "SW_LIGHT", pullDownName: "R_LIGHT_PULLDOWN", statusResistorName: "R_LIGHT_STATUS", statusLedName: "LED_LIGHT", switchX: -18, switchY: 14, ledX: -24, ledY: 2 }), jsxRuntime.jsx(InputChannel, { controllerInputPort: "FAN_IN", controllerGatePort: "FAN_GATE", switchName: "SW_FAN", pullDownName: "R_FAN_PULLDOWN", statusResistorName: "R_FAN_STATUS", statusLedName: "LED_FAN", switchX: 2, switchY: 14, ledX: 22, ledY: 2 }), jsxRuntime.jsx("trace", { from: ".U1 > .VIN", to: "net.VBUS" }), jsxRuntime.jsx("trace", { from: ".U1 > .GND", to: "net.GND" }), jsxRuntime.jsx("trace", { from: ".U1 > .ENABLE", to: "net.VBUS" }), jsxRuntime.jsx("trace", { from: ".C1 > .pin1", to: "net.VBUS" }), jsxRuntime.jsx("trace", { from: ".C1 > .pin2", to: "net.GND" }), jsxRuntime.jsx("trace", { from: ".C2 > .pin1", to: "net.VBUS" }), jsxRuntime.jsx("trace", { from: ".C2 > .pin2", to: "net.GND" })] }));
}
module.exports = LevelOneHomeAutomationBoard;