mohan-bee/temperature-meter
The code defines a compact PCB assembly featuring a USB-C power input, an AMS1117 voltage regulator, a LM335 temperature sensor, an ATtiny85 microcontroller with ICSP and I2C headers, a pushbutton, and associated passive components like resistors and capacitors, all interconnected with traces and mounted on labeled footprints.
- Version
- 1.0.3
- License
- unset
- Stars
- 1
board.circuit.tsx
PCB
Schematic
import { AMS1117_3_3 as VoltageRegulator } from "./imports/c6186"
import { TYPE_C_31_M_12 as UsbC } from "./imports/c165948"
import { LM335DT as TemperatureSensor } from "./imports/LM335DT"
import { ATTINY85_20SF as ATtiny85 } from "./imports/ATTINY85_20SF"
import { TS_1187A_B_A_B as PushButton } from "./imports/TS_1187A_B_A_B"
export default () => (
<board width="35mm" height="50mm" schAutoLayoutEnabled>
<schematicsection name="power" displayName="USB-C Power and 3.3V Regulation" />
<schematicsection name="headers" displayName="ICSP and I2C Headers" />
<schematicsection name="status" displayName="Status LED" />
<schematicsection name="controls" displayName="Pushbutton" />
<schematicsection name="temperature" displayName="Temperature Sensor" />
<schematicsection name="mcu" displayName="ATtiny85 and ICSP" />
<VoltageRegulator name="V1" schSectionName="power" />
<UsbC name="USBC" pcbY={-21} schSectionName="power" />
<TemperatureSensor name="U1" schSectionName="temperature" />
<ATtiny85 name="U2" schSectionName="mcu" />
<silkscreenrect width={30} height={30} pcbY={9} />
<PushButton name="SW1" pcbX={10} pcbY={-16} schSectionName="controls" />
<led name="LED1" footprint="0603" color="red" schSectionName="status" />
<resistor name="R1" footprint="0603" resistance="4.7kΩ" schSectionName="controls" />
<resistor name="R2" footprint="0603" resistance="220Ω" schSectionName="status" />
<resistor name="R3" footprint="0603" resistance="5.1kΩ" schSectionName="power" />
<resistor name="R4" footprint="0603" resistance="5.1kΩ" schSectionName="power" />
<capacitor name="C1" footprint="0603" capacitance="0.1µF" schSectionName="power" />
<capacitor name="C2" footprint="0805" capacitance="10µF" schSectionName="power" />
<capacitor name="C3" footprint="0603" capacitance="0.1µF" schSectionName="mcu" />
<resistor name="R5" footprint="0603" resistance="2kΩ" schSectionName="temperature" />
<resistor name="R6" footprint="0603" resistance="10kΩ" schSectionName="temperature" />
<resistor name="R7" footprint="0603" resistance="47kΩ" schSectionName="temperature" />
<pinheader name="J1" pinCount={6} gender="female" footprint="pinrow6_rows2_female"
doubleRow={true} pcbX={-12} pcbRotation={90} pcbY={-18} schSectionName="headers"
showSilkscreenPinLabels={true}
pinLabels={["VCC", "GND", "MOSI", "MISO", "SCK", "RESET"]} />
<pinheader name="J2" pinCount={4} pcbY={22} gender="female" footprint="pinrow4_female"
doubleRow={false} schSectionName="headers" showSilkscreenPinLabels={true}
pinLabels={["VCC", "GND", "SDA", "SCL"]} />
<trace name="vbus_vin" from=".USBC > .VBUS" to=".V1 > .VIN" />
<trace name="usb_gnd" from=".USBC > .GND" to=".V1 > .GND" />
<trace name="cc1_r3" from=".USBC > .CC1" to=".R3 > .pin1" />
<trace name="r3_gnd" from=".R3 > .pin2" to=".V1 > .GND" />
<trace name="cc2_r4" from=".USBC > .CC2" to=".R4 > .pin1" />
<trace name="r4_gnd" from=".R4 > .pin2" to=".V1 > .GND" />
<trace name="vin_c2" from=".V1 > .VIN" to=".C2 > .pin1" />
<trace name="c2_gnd" from=".C2 > .pin2" to=".V1 > .GND" />
<trace name="vout_c1" from=".V1 > .VOUT" to=".C1 > .pin1" />
<trace name="c1_gnd" from=".C1 > .pin2" to=".V1 > .GND" />
<trace name="vout_u2" from=".V1 > .VOUT" to=".U2 > .VCC" />
<trace name="gnd_u2" from=".V1 > .GND" to=".U2 > .GND" />
<trace name="u2_vcc_c3" from=".U2 > .VCC" to=".C3 > .pin1" />
<trace name="c3_gnd" from=".C3 > .pin2" to=".U2 > .GND" />
<trace name="j1_vcc_u2" from=".J1 > .VCC" to=".U2 > .VCC" />
<trace name="j1_gnd_u2" from=".J1 > .GND" to=".U2 > .GND" />
<trace name="icsp_mosi" from=".J1 > .MOSI" to=".U2 > .PB0" />
<trace name="icsp_miso" from=".J1 > .MISO" to=".U2 > .PB1" />
<trace name="icsp_sck" from=".J1 > .SCK" to=".U2 > .PB2" />
<trace name="icsp_reset" from=".J1 > .RESET" to=".U2 > .RESET" />
<trace name="vout_j2" from=".V1 > .VOUT" to=".J2 > .VCC" />
<trace name="gnd_j2" from=".V1 > .GND" to=".J2 > .GND" />
<trace name="i2c_sda" from=".U2 > .PB0" to=".J2 > .SDA" />
<trace name="i2c_scl" from=".U2 > .PB2" to=".J2 > .SCL" />
<trace name="pb1_r2" from=".U2 > .PB1" to=".R2 > .pin1" />
<trace name="r2_led" from=".R2 > .pin2" to=".LED1 > .anode" />
<trace name="led_gnd" from=".LED1 > .cathode" to=".V1 > .GND" />
<trace name="pb4_sw" from=".U2 > .PB4" to=".SW1 > .pin1" />
<trace name="pb4_sw_c" from=".U2 > .PB4" to=".SW1 > .pin3" />
<trace name="sw_gnd" from=".SW1 > .pin2" to=".V1 > .GND" />
<trace name="sw_d_gnd" from=".SW1 > .pin4" to=".V1 > .GND" />
<trace name="vcc_r1" from=".U2 > .VCC" to=".R1 > .pin1" />
<trace name="r1_pb4" from=".R1 > .pin2" to=".U2 > .PB4" />
<trace name="vbus_r5" from=".USBC > .VBUS" to=".R5 > .pin1" />
<trace name="r5_temp" from=".R5 > .pin2" to=".U1 > .V_POS" />
<trace name="temp_gnd" from=".U1 > .V_NEG" to=".V1 > .GND" />
<trace name="temp_r6" from=".U1 > .V_POS" to=".R6 > .pin1" />
<trace name="temp_pb3" from=".R6 > .pin2" to=".U2 > .PB3" />
<trace name="r7_gnd" from=".R7 > .pin1" to=".V1 > .GND" />
<trace name="adc_r7" from=".R6 > .pin2" to=".R7 > .pin2" />
</board>
)