techmannih/usbc-charger
This code defines a detailed electronic hardware design for an 85-265VAC to USB-C PD 18W wall charger, including the schematic layout and physical component placements such as connectors, filtering inductors, capacitors, resistors, protection diodes, and an isolated power module, all integrated with 3D models and mechanical enclosures.
- Version
- 1.0.7
- License
- unset
- Stars
- 0
.claude/skills/tscircuit/elements/voltagesource.md
# `<voltagesource />`
Add a voltage source for SPICE simulations and schematic power inputs.
## Example
```tsx
export default () => (
<board routingDisabled>
<voltagesource
name="V1"
waveShape="square"
voltage="5V"
frequency="1kHz"
dutyCycle={0.5}
/>
<resistor name="R1" resistance="1k" />
<trace from=".V1 > .pin1" to=".R1 > .pin1" />
<trace from=".V1 > .pin2" to=".R1 > .pin2" />
<voltageprobe name="VP_OUT" connectsTo=".R1 > .pin1" />
<analogsimulation duration="5ms" timePerStep="0.05ms" spiceEngine="ngspice" />
</board>
)
```
## Props
Commonly used: `voltage`, `frequency`, `peakToPeakVoltage`, `waveShape`, `phase`, `dutyCycle`, `connections`, `name`
## References
- Props: [VoltageSourceProps](https://github.com/tscircuit/props#voltagesourceprops-voltagesource)
- Source: [lib/components/voltagesource.ts](https://github.com/tscircuit/props/blob/main/lib/components/voltagesource.ts)
- Local docs: [docs/docs/elements/voltagesource.mdx](../docs/docs/elements/voltagesource.mdx)