aj0070/scope-frontend
A 4-layer dual-channel oscilloscope analog front end with BNC inputs, relay-selectable AC/DC coupling and attenuation, FET buffers, programmable VGAs, differential ADC drivers, dual 8-bit ADCs with 25 MHz clock, power conversion/LDOs, and control/data headers.
- 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 aj0070/scope-frontend # download the package files into ./scope-frontend
tsci add aj0070/scope-frontend # add it to your project as @tsci/aj0070.scope-frontendIn 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.
src/power.tsx
import React from "react"
import { AP2112K_3_3TRG1 } from "../imports/AP2112K_3_3TRG1"
import { MC34063ADR2G } from "../imports/MC34063ADR2G"
import { TPS7A3001DGNR } from "../imports/TPS7A3001DGNR"
import { TPS7A4901DGNR } from "../imports/TPS7A4901DGNR"
import { ULN2003ADR } from "../imports/ULN2003ADR"
export function powerParts() {
const sch = (x: number, y: number) => ({ schSheetName: "POWER", schX: x, schY: y })
return (
<>
{/* +5 V input and fuse */}
<pinheader
name="J5"
pinCount={2}
pitch="2.54mm"
footprint="pinrow2_p2.54mm"
pinLabels={["P5V", "GND"]}
schPinArrangement={{ topSide: ["P5V"], bottomSide: ["GND"] }}
schWidth={0.5}
pcbX={11}
pcbY={23.2}
{...sch(12.5, 8)}
/>
<trace from="J5.P5V" to="net.P5V_IN" />
<trace from="J5.GND" to="net.GND" />
<fuse name="F401" currentRating="0.5A" footprint="0805" pcbX={5} pcbY={23.2} {...sch(12.5, 9.4)} schRotation={270} />
<trace from="F401.pin1" to="net.P5V_IN" />
<trace from="F401.pin2" to="net.P5V" />
{/* inverting converter to about -6.5 V */}
<MC34063ADR2G name="U11" pcbX={25} pcbY={20} {...sch(-12, 6)} />
<inductor name="L401" inductance="47uH" footprint="0805" pcbX={10} pcbY={19.5} {...sch(-12, 8)} schRotation={270} />
<diode name="D401" manufacturerPartNumber="MBRS340T3G" footprint="sma" pcbX={18} pcbY={21} {...sch(-9, 8)} schRotation={90} />
<capacitor name="C401" capacitance="10uF" footprint="1206" pcbX={16} pcbY={15.5} {...sch(-14, 3)} schRotation={270} />
<capacitor name="C402" capacitance="10uF" footprint="1206" pcbX={16} pcbY={13.0} {...sch(-9, 3)} schRotation={270} />
<resistor name="R401" resistance="0.22" footprint="0402" pcbX={21} pcbY={24} {...sch(-6, 8)} schRotation={270} />
<resistor name="R402" resistance="1k" footprint="0402" pcbX={11.5} pcbY={16.8} {...sch(-3, 8)} schRotation={270} />
<capacitor name="C403" capacitance="1nF" footprint="0402" pcbX={21} pcbY={17} {...sch(-14.5, 6.5)} schRotation={270} />
<resistor name="R403" resistance="10k" footprint="0402" pcbX={11.5} pcbY={15.3} {...sch(-5.5, 3)} schRotation={270} />
<resistor name="R404" resistance="43k" footprint="0402" pcbX={11.5} pcbY={13.8} {...sch(-4, 3)} schRotation={270} />
<trace from="U11.VCC" to="net.P5V" />
<trace from="U11.DC" to="net.P5V" />
<trace from="U11.IPK" to="R401.pin1" />
<trace from="R401.pin2" to="net.P5V" />
<trace from="U11.SE" to="net.GND" />
<trace from="U11.GND" to="net.GND" />
<trace from="U11.TC" to="C403.pin1" />
<trace from="C403.pin2" to="net.GND" />
<trace from="R402.pin1" to="U11.TC" />
<trace from="R402.pin2" to="net.P5V" />
<trace from="U11.SC" to="net.NEG_SW" />
<trace from="L401.pin1" to="net.P5V" />
<trace from="L401.pin2" to="net.NEG_SW" />
<trace from="D401.pin1" to="net.NEG_PRE" />
<trace from="D401.pin2" to="net.NEG_SW" />
<trace from="C402.pin1" to="net.NEG_PRE" />
<trace from="C402.pin2" to="net.GND" />
<trace from="C401.pin1" to="net.P5V" />
<trace from="C401.pin2" to="net.GND" />
<trace from="U11.CII" to="net.NEG_FB" />
<trace from="R403.pin1" to="net.NEG_FB" />
<trace from="R403.pin2" to="net.GND" />
<trace from="R404.pin1" to="net.NEG_FB" />
<trace from="R404.pin2" to="net.NEG_PRE" />
{/* +5 V analog LDO */}
<TPS7A4901DGNR name="U13" pcbX={35} pcbY={20} {...sch(0, 6)} />
<capacitor name="C404" capacitance="1uF" footprint="0402" pcbX={31.5} pcbY={18.4} {...sch(-12.5, 3)} schRotation={270} />
<capacitor name="C405" capacitance="10uF" footprint="0805" layer="bottom" pcbX={35} pcbY={16.5} {...sch(3, 8)} schRotation={270} />
<resistor name="R405" resistance="100k" footprint="0402" pcbRotation={180} pcbX={31.5} pcbY={22.0} {...sch(-2, 3)} schRotation={270} />
<resistor name="R406" resistance="31.6k" footprint="0402" pcbX={31.5} pcbY={20.8} {...sch(-0.5, 3)} schRotation={270} />
<capacitor name="C406" capacitance="10nF" footprint="0402" pcbX={31.5} pcbY={19.6} {...sch(1, 3)} schRotation={270} />
<trace from="U13.IN" to="net.P5V" />
<trace from="U13.OUT" to="net.P5VA" />
<trace from="U13.GND" to="net.GND" />
<trace from="U13.PwPd" to="net.GND" />
<trace from="U13.EN" to="net.P5V" />
<trace from="U13.FB" to="net.P5VA_FB" />
<trace from="U13.NR" to="C406.pin1" />
<trace from="C406.pin2" to="net.GND" />
<trace from="R405.pin1" to="net.P5VA" />
<trace from="R405.pin2" to="net.P5VA_FB" />
<trace from="R406.pin1" to="net.P5VA_FB" />
<trace from="R406.pin2" to="net.GND" />
<trace from="C404.pin1" to="net.P5V" />
<trace from="C404.pin2" to="net.GND" />
<trace from="C405.pin1" to="net.P5VA" />
<trace from="C405.pin2" to="net.GND" />
{/* -5 V analog LDO */}
<TPS7A3001DGNR name="U14" pcbX={26.5} pcbY={12.5} {...sch(-6, 6)} />
<capacitor name="C407" capacitance="1uF" footprint="0402" pcbX={29} pcbY={22.0} {...sch(-7.5, 3)} schRotation={270} />
<capacitor name="C408" capacitance="10uF" footprint="0805" layer="bottom" pcbX={26} pcbY={9.0} {...sch(5, 8)} schRotation={270} />
<resistor name="R407" resistance="100k" footprint="0402" pcbX={29} pcbY={20.8} {...sch(-9, 5.0)} schRotation={270} />
<resistor name="R408" resistance="30.1k" footprint="0402" pcbX={29} pcbY={19.6} {...sch(-9, 6.5)} schRotation={270} />
<capacitor name="C409" capacitance="10nF" footprint="0402" pcbX={29} pcbY={18.4} {...sch(1, 8)} schRotation={270} />
<trace from="U14.IN" to="net.NEG_PRE" />
<trace from="U14.OUT" to="net.N5VA" />
<trace from="U14.GND" to="net.GND" />
<trace from="U14.EP" to="net.GND" />
<trace from="U14.EN" to="net.P5V" />
<trace from="U14.FB" to="net.N5VA_FB" />
<trace from="U14.NRSS" to="C409.pin1" />
<trace from="C409.pin2" to="net.GND" />
<trace from="R407.pin1" to="net.N5VA_FB" />
<trace from="R407.pin2" to="net.GND" />
<trace from="R408.pin1" to="net.N5VA_FB" />
<trace from="R408.pin2" to="net.N5VA" />
<trace from="C407.pin1" to="net.NEG_PRE" />
<trace from="C407.pin2" to="net.GND" />
<trace from="C408.pin1" to="net.N5VA" />
<trace from="C408.pin2" to="net.GND" />
{/* 3.3 V digital rail for the ADC, oscillator and VGA control */}
<AP2112K_3_3TRG1 name="U12" pcbX={30.75} pcbY={12.5} {...sch(6, 6)} />
<capacitor name="C410" capacitance="1uF" footprint="0402" pcbX={31} pcbY={17.4} {...sch(-11, 3)} schRotation={270} />
<capacitor name="C411" capacitance="1uF" footprint="0402" pcbX={31} pcbY={16.0} {...sch(7, 8)} schRotation={270} />
<trace from="U12.VIN" to="net.P5V" />
<trace from="U12.GND" to="net.GND" />
<trace from="U12.EN" to="net.P5V" />
<trace from="U12.VOUT" to="net.P3V3" />
<trace from="C410.pin1" to="net.P5V" />
<trace from="C410.pin2" to="net.GND" />
<trace from="C411.pin1" to="net.P3V3" />
<trace from="C411.pin2" to="net.GND" />
{/* relay coil driver */}
<ULN2003ADR name="U8" pcbX={-14} pcbY={0} {...sch(-12, -3)} />
<trace from="U8.E" to="net.GND" />
<trace from="U8.COM" to="net.P5V" />
<trace from="U8.1B" to="net.AC_A" />
<trace from="U8.2B" to="net.ATT_A" />
<trace from="U8.3B" to="net.AC_B" />
<trace from="U8.4B" to="net.ATT_B" />
<trace from="U8.5B" to="net.GND" />
<trace from="U8.6B" to="net.GND" />
<trace from="U8.7B" to="net.GND" />
<trace from="U8.1C" to="net.KK1_DRV" />
<trace from="U8.2C" to="net.KK2_DRV" />
<trace from="U8.3C" to="net.KK3_DRV" />
<trace from="U8.4C" to="net.KK4_DRV" />
{/* control header: coupling and attenuator relay select */}
<pinheader
name="J4"
pinCount={5}
pitch="2.54mm"
footprint="pinrow5_p2.54mm"
pinLabels={["GND", "AC_A", "ATT_A", "AC_B", "ATT_B"]}
schWidth={0.675}
pcbX={-17}
pcbY={-22}
{...sch(-14, -8)}
schRotation={90}
/>
<trace from="J4.GND" to="net.GND" />
<trace from="J4.AC_A" to="net.AC_A" />
<trace from="J4.ATT_A" to="net.ATT_A" />
<trace from="J4.AC_B" to="net.AC_B" />
<trace from="J4.ATT_B" to="net.ATT_B" />
{/* VGA SPI header */}
<pinheader
name="J6"
pinCount={6}
doubleRow
pitch="2.54mm"
footprint="pinrow6_p2.54mm_rows2"
pinLabels={["GND", "VGA_A_CS", "VGA_B_CS", "VGA_SDIO", "VGA_SCLK", "P3V3"]}
schWidth={0.96}
pcbX={-2}
pcbY={-20}
{...sch(10, 2)}
schRotation={90}
/>
<trace from="J6.GND" to="net.GND" />
<trace from="J6.VGA_A_CS" to="net.VGA_A_CS" />
<trace from="J6.VGA_B_CS" to="net.VGA_B_CS" />
<trace from="J6.VGA_SDIO" to="net.VGA_SDIO" />
<trace from="J6.VGA_SCLK" to="net.VGA_SCLK" />
<trace from="J6.P3V3" to="net.P3V3" />
</>
)
}