From 99d55d9b5e704e08c959f7711b2177fd66edb5bd Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Wed, 22 Mar 2017 12:13:11 +0100 Subject: [PATCH] First working version --- .gitignore | 4 + KiCad/OmronG5V.pretty/OMRON-G5V-1.kicad_mod | 26 + KiCad/PiPower.kicad_pcb | 1095 +++++++++++++++++++ KiCad/PiPower.net | 361 ++++++ KiCad/PiPower.pro | 72 ++ KiCad/PiPower.sch | 583 ++++++++++ KiCad/V_Relay.lib | 289 +++++ KiCad/fp-lib-table | 3 + Pi/PiPower.py | 39 + Pi/notes.txt | 36 + Pi/pipower.service | 17 + PiPower.ino | 442 ++++++++ 12 files changed, 2967 insertions(+) create mode 100644 .gitignore create mode 100644 KiCad/OmronG5V.pretty/OMRON-G5V-1.kicad_mod create mode 100644 KiCad/PiPower.kicad_pcb create mode 100644 KiCad/PiPower.net create mode 100644 KiCad/PiPower.pro create mode 100644 KiCad/PiPower.sch create mode 100644 KiCad/V_Relay.lib create mode 100644 KiCad/fp-lib-table create mode 100644 Pi/PiPower.py create mode 100644 Pi/notes.txt create mode 100644 Pi/pipower.service create mode 100644 PiPower.ino diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eacd1b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.bak +*.kicad_pcb-bak +*-cache.lib +KiCad/output/ diff --git a/KiCad/OmronG5V.pretty/OMRON-G5V-1.kicad_mod b/KiCad/OmronG5V.pretty/OMRON-G5V-1.kicad_mod new file mode 100644 index 0000000..17adb73 --- /dev/null +++ b/KiCad/OmronG5V.pretty/OMRON-G5V-1.kicad_mod @@ -0,0 +1,26 @@ +(module OMRON-G5V-1 (layer F.Cu) (tedit 54CEF90B) + (fp_text reference REF** (at 0 0) (layer F.SilkS) + (effects (font (size 0.8 0.8) (thickness 0.15))) + ) + (fp_text value OMRON-G5V-1 (at 0 0) (layer F.Fab) + (effects (font (size 0.8 0.8) (thickness 0.15))) + ) + (fp_line (start -6.5 -4) (end 6.5 -4) (layer F.Fab) (width 0.15)) + (fp_line (start 6.5 -4) (end 6.5 4) (layer F.Fab) (width 0.15)) + (fp_line (start 6.5 4) (end -6.5 4) (layer F.Fab) (width 0.15)) + (fp_line (start -6.5 4) (end -6.5 -4) (layer F.Fab) (width 0.15)) + (fp_line (start -7 -4.5) (end 7 -4.5) (layer F.CrtYd) (width 0.15)) + (fp_line (start 7 -4.5) (end 7 4.5) (layer F.CrtYd) (width 0.15)) + (fp_line (start 7 4.5) (end -7 4.5) (layer F.CrtYd) (width 0.15)) + (fp_line (start -7 4.5) (end -7 -4.5) (layer F.CrtYd) (width 0.15)) + (fp_line (start 6.5 -4) (end -6.5 -4) (layer F.SilkS) (width 0.35)) + (fp_line (start -6.5 -4) (end -6.5 4) (layer F.SilkS) (width 0.35)) + (fp_line (start -6.5 4) (end 6.5 4) (layer F.SilkS) (width 0.35)) + (fp_line (start 6.5 4) (end 6.5 -4) (layer F.SilkS) (width 0.35)) + (pad 4 thru_hole circle (at -2.159 -2.54) (size 1.7 1.7) (drill 1.016) (layers *.Cu *.Mask F.SilkS)) + (pad 5 thru_hole circle (at -2.159 2.54) (size 1.7 1.7) (drill 1.016) (layers *.Cu *.Mask F.SilkS)) + (pad 2 thru_hole circle (at 5.461 -2.54) (size 1.7 1.7) (drill 1.016) (layers *.Cu *.Mask F.SilkS)) + (pad 2 thru_hole circle (at 5.461 2.54) (size 1.7 1.7) (drill 1.016) (layers *.Cu *.Mask F.SilkS)) + (pad 3 thru_hole circle (at -5.334 -2.54) (size 1.7 1.7) (drill 1.016) (layers *.Cu *.Mask F.SilkS)) + (pad 1 thru_hole circle (at -5.334 2.54) (size 1.7 1.7) (drill 1.016) (layers *.Cu *.Mask F.SilkS)) +) diff --git a/KiCad/PiPower.kicad_pcb b/KiCad/PiPower.kicad_pcb new file mode 100644 index 0000000..0c09689 --- /dev/null +++ b/KiCad/PiPower.kicad_pcb @@ -0,0 +1,1095 @@ +(kicad_pcb (version 4) (host pcbnew 4.0.5) + + (general + (links 35) + (no_connects 0) + (area 121.844999 102.032999 163.651001 133.933001) + (thickness 1.6) + (drawings 12) + (tracks 126) + (zones 0) + (modules 21) + (nets 18) + ) + + (page A4) + (title_block + (title PiPower) + (date 2017-03-05) + (rev 1) + (company "Mark van Renswoude") + ) + + (layers + (0 F.Cu signal) + (31 B.Cu signal) + (32 B.Adhes user hide) + (33 F.Adhes user hide) + (34 B.Paste user hide) + (35 F.Paste user hide) + (36 B.SilkS user hide) + (37 F.SilkS user hide) + (38 B.Mask user hide) + (39 F.Mask user hide) + (40 Dwgs.User user hide) + (41 Cmts.User user hide) + (42 Eco1.User user) + (43 Eco2.User user) + (44 Edge.Cuts user) + (45 Margin user hide) + (46 B.CrtYd user hide) + (47 F.CrtYd user hide) + (48 B.Fab user hide) + (49 F.Fab user hide) + ) + + (setup + (last_trace_width 0.6) + (user_trace_width 1.5) + (trace_clearance 0.2) + (zone_clearance 0.508) + (zone_45_only yes) + (trace_min 0.2) + (segment_width 0.2) + (edge_width 0.15) + (via_size 0.6) + (via_drill 0.4) + (via_min_size 0.4) + (via_min_drill 0.3) + (uvia_size 0.3) + (uvia_drill 0.1) + (uvias_allowed no) + (uvia_min_size 0.2) + (uvia_min_drill 0.1) + (pcb_text_width 0.3) + (pcb_text_size 1.5 1.5) + (mod_edge_width 0.15) + (mod_text_size 1 1) + (mod_text_width 0.15) + (pad_size 1.524 1.524) + (pad_drill 0.762) + (pad_to_mask_clearance 0.2) + (aux_axis_origin 0 0) + (grid_origin 163.576 106.172) + (visible_elements 7FFFFFFF) + (pcbplotparams + (layerselection 0x01400_80000001) + (usegerberextensions false) + (excludeedgelayer true) + (linewidth 0.100000) + (plotframeref false) + (viasonmask false) + (mode 1) + (useauxorigin false) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15) + (hpglpenoverlay 2) + (psnegative false) + (psa4output false) + (plotreference true) + (plotvalue true) + (plotinvisibletext false) + (padsonsilk false) + (subtractmaskfromsilk false) + (outputformat 4) + (mirror false) + (drillshape 1) + (scaleselection 1) + (outputdirectory output)) + ) + + (net 0 "") + (net 1 "Net-(D1-Pad1)") + (net 2 GND) + (net 3 "Net-(D2-Pad1)") + (net 4 "Net-(D2-Pad2)") + (net 5 "Net-(D3-Pad1)") + (net 6 "Net-(D3-Pad2)") + (net 7 "Net-(IC1-Pad5)") + (net 8 "Net-(IC1-Pad2)") + (net 9 "Net-(IC1-Pad6)") + (net 10 "Net-(IC1-Pad3)") + (net 11 "Net-(IC1-Pad7)") + (net 12 +5V) + (net 13 "Net-(P1-Pad1)") + (net 14 "Net-(K1-Pad10)") + (net 15 "Net-(P6-Pad1)") + (net 16 "Net-(Q1-Pad2)") + (net 17 "Net-(Q2-Pad2)") + + (net_class Default "This is the default net class." + (clearance 0.2) + (trace_width 0.6) + (via_dia 0.6) + (via_drill 0.4) + (uvia_dia 0.3) + (uvia_drill 0.1) + (add_net +5V) + (add_net GND) + (add_net "Net-(D1-Pad1)") + (add_net "Net-(D2-Pad1)") + (add_net "Net-(D2-Pad2)") + (add_net "Net-(D3-Pad1)") + (add_net "Net-(D3-Pad2)") + (add_net "Net-(IC1-Pad2)") + (add_net "Net-(IC1-Pad3)") + (add_net "Net-(IC1-Pad5)") + (add_net "Net-(IC1-Pad6)") + (add_net "Net-(IC1-Pad7)") + (add_net "Net-(K1-Pad10)") + (add_net "Net-(P1-Pad1)") + (add_net "Net-(P6-Pad1)") + (add_net "Net-(Q1-Pad2)") + (add_net "Net-(Q2-Pad2)") + ) + + (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 58C8610B) (tstamp 58C85C70) + (at 149.352 106.172) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /58BC419B) + (fp_text reference D1 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value LED (at 0 -2.54) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 3.93) (end 1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 3.93) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 4.1) (end 1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 4.1) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 1 "Net-(D1-Pad1)")) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 GND)) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl + (at (xyz 0 -0.05 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module Diodes_ThroughHole:D_T-1_P5.08mm_Horizontal (layer F.Cu) (tedit 5877C982) (tstamp 58C85C88) + (at 143.764 125.222 270) + (descr "D, T-1 series, Axial, Horizontal, pin pitch=5.08mm, , length*diameter=3.2*2.6mm^2, , http://www.diodes.com/_files/packages/T-1.pdf") + (tags "D T-1 series Axial Horizontal pin pitch 5.08mm length 3.2mm diameter 2.6mm") + (path /58C1C921) + (fp_text reference D2 (at 2.54 -2.36 270) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value D (at 2.54 2.36 270) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.94 -1.3) (end 0.94 1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 0.94 1.3) (end 4.14 1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 4.14 1.3) (end 4.14 -1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 4.14 -1.3) (end 0.94 -1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 0 0) (end 0.94 0) (layer F.Fab) (width 0.1)) + (fp_line (start 5.08 0) (end 4.14 0) (layer F.Fab) (width 0.1)) + (fp_line (start 1.42 -1.3) (end 1.42 1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 0.88 -1.18) (end 0.88 -1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 0.88 -1.36) (end 4.2 -1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 4.2 -1.36) (end 4.2 -1.18) (layer F.SilkS) (width 0.12)) + (fp_line (start 0.88 1.18) (end 0.88 1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 0.88 1.36) (end 4.2 1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 4.2 1.36) (end 4.2 1.18) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.42 -1.36) (end 1.42 1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.25 -1.65) (end -1.25 1.65) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.25 1.65) (end 6.35 1.65) (layer F.CrtYd) (width 0.05)) + (fp_line (start 6.35 1.65) (end 6.35 -1.65) (layer F.CrtYd) (width 0.05)) + (fp_line (start 6.35 -1.65) (end -1.25 -1.65) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0 270) (size 2 2) (drill 1) (layers *.Cu *.Mask) + (net 3 "Net-(D2-Pad1)")) + (pad 2 thru_hole oval (at 5.08 0 270) (size 2 2) (drill 1) (layers *.Cu *.Mask) + (net 4 "Net-(D2-Pad2)")) + (model Diodes_THT.3dshapes/D_T-1_P5.08mm_Horizontal.wrl + (at (xyz 0 0 0)) + (scale (xyz 0.393701 0.393701 0.393701)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Diodes_ThroughHole:D_T-1_P5.08mm_Horizontal (layer F.Cu) (tedit 5877C982) (tstamp 58C85CA0) + (at 159.766 125.476 270) + (descr "D, T-1 series, Axial, Horizontal, pin pitch=5.08mm, , length*diameter=3.2*2.6mm^2, , http://www.diodes.com/_files/packages/T-1.pdf") + (tags "D T-1 series Axial Horizontal pin pitch 5.08mm length 3.2mm diameter 2.6mm") + (path /58C5CB60) + (fp_text reference D3 (at 2.54 -2.36 270) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value D (at 2.54 2.36 270) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.94 -1.3) (end 0.94 1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 0.94 1.3) (end 4.14 1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 4.14 1.3) (end 4.14 -1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 4.14 -1.3) (end 0.94 -1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 0 0) (end 0.94 0) (layer F.Fab) (width 0.1)) + (fp_line (start 5.08 0) (end 4.14 0) (layer F.Fab) (width 0.1)) + (fp_line (start 1.42 -1.3) (end 1.42 1.3) (layer F.Fab) (width 0.1)) + (fp_line (start 0.88 -1.18) (end 0.88 -1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 0.88 -1.36) (end 4.2 -1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 4.2 -1.36) (end 4.2 -1.18) (layer F.SilkS) (width 0.12)) + (fp_line (start 0.88 1.18) (end 0.88 1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 0.88 1.36) (end 4.2 1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start 4.2 1.36) (end 4.2 1.18) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.42 -1.36) (end 1.42 1.36) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.25 -1.65) (end -1.25 1.65) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.25 1.65) (end 6.35 1.65) (layer F.CrtYd) (width 0.05)) + (fp_line (start 6.35 1.65) (end 6.35 -1.65) (layer F.CrtYd) (width 0.05)) + (fp_line (start 6.35 -1.65) (end -1.25 -1.65) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0 270) (size 2 2) (drill 1) (layers *.Cu *.Mask) + (net 5 "Net-(D3-Pad1)")) + (pad 2 thru_hole oval (at 5.08 0 270) (size 2 2) (drill 1) (layers *.Cu *.Mask) + (net 6 "Net-(D3-Pad2)")) + (model Diodes_THT.3dshapes/D_T-1_P5.08mm_Horizontal.wrl + (at (xyz 0 0 0)) + (scale (xyz 0.393701 0.393701 0.393701)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Housings_DIP:DIP-8_W7.62mm_Socket (layer F.Cu) (tedit 58C860DC) (tstamp 58C85CC3) + (at 143.764 120.65 90) + (descr "8-lead dip package, row spacing 7.62 mm (300 mils), Socket") + (tags "DIL DIP PDIP 2.54mm 7.62mm 300mil Socket") + (path /58BC3ABE) + (fp_text reference IC1 (at 3.81 -2.39 90) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value ATTiny85 (at 4.318 4.318 180) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_arc (start 3.81 -1.39) (end 2.81 -1.39) (angle -180) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.635 -1.27) (end 6.985 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 6.985 -1.27) (end 6.985 8.89) (layer F.Fab) (width 0.1)) + (fp_line (start 6.985 8.89) (end 0.635 8.89) (layer F.Fab) (width 0.1)) + (fp_line (start 0.635 8.89) (end 0.635 -0.27) (layer F.Fab) (width 0.1)) + (fp_line (start 0.635 -0.27) (end 1.635 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 -1.27) (end -1.27 8.89) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 8.89) (end 8.89 8.89) (layer F.Fab) (width 0.1)) + (fp_line (start 8.89 8.89) (end 8.89 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 8.89 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 2.81 -1.39) (end 1.04 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.04 -1.39) (end 1.04 9.01) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.04 9.01) (end 6.58 9.01) (layer F.SilkS) (width 0.12)) + (fp_line (start 6.58 9.01) (end 6.58 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start 6.58 -1.39) (end 4.81 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end -1.39 9.01) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 9.01) (end 9.01 9.01) (layer F.SilkS) (width 0.12)) + (fp_line (start 9.01 9.01) (end 9.01 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start 9.01 -1.39) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.7 -1.7) (end -1.7 9.3) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.7 9.3) (end 9.3 9.3) (layer F.CrtYd) (width 0.05)) + (fp_line (start 9.3 9.3) (end 9.3 -1.7) (layer F.CrtYd) (width 0.05)) + (fp_line (start 9.3 -1.7) (end -1.7 -1.7) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)) + (pad 5 thru_hole oval (at 7.62 7.62 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 7 "Net-(IC1-Pad5)")) + (pad 2 thru_hole oval (at 0 2.54 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 8 "Net-(IC1-Pad2)")) + (pad 6 thru_hole oval (at 7.62 5.08 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 9 "Net-(IC1-Pad6)")) + (pad 3 thru_hole oval (at 0 5.08 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 10 "Net-(IC1-Pad3)")) + (pad 7 thru_hole oval (at 7.62 2.54 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 11 "Net-(IC1-Pad7)")) + (pad 4 thru_hole oval (at 0 7.62 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 2 GND)) + (pad 8 thru_hole oval (at 7.62 0 90) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask) + (net 12 +5V)) + (model Housings_DIP.3dshapes/DIP-8_W7.62mm_Socket.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module OmronG5V:OMRON-G5V-1 (layer F.Cu) (tedit 58C855A1) (tstamp 58C85CCD) + (at 157.766 117.936 270) + (path /58C5C232) + (fp_text reference K1 (at 0 0 270) (layer F.SilkS) + (effects (font (size 0 0) (thickness 0.15))) + ) + (fp_text value G5V-1 (at 0 0 270) (layer F.Fab) + (effects (font (size 0 0) (thickness 0.15))) + ) + (fp_line (start -6 -4) (end 6 -4) (layer F.Fab) (width 0)) + (fp_line (start 6 -4) (end 6 4) (layer F.Fab) (width 0)) + (fp_line (start 6 4) (end -6 4) (layer F.Fab) (width 0)) + (fp_line (start -6 4) (end -6 -4) (layer F.Fab) (width 0)) + (fp_line (start -7 -4) (end 7 -4) (layer F.CrtYd) (width 0)) + (fp_line (start 7 -4) (end 7 4) (layer F.CrtYd) (width 0)) + (fp_line (start 7 4) (end -7 4) (layer F.CrtYd) (width 0)) + (fp_line (start -7 4) (end -7 -4) (layer F.CrtYd) (width 0)) + (fp_line (start 6 -4) (end -6 -4) (layer F.SilkS) (width 0)) + (fp_line (start -6 -4) (end -6 4) (layer F.SilkS) (width 0)) + (fp_line (start -6 4) (end 6 4) (layer F.SilkS) (width 0)) + (fp_line (start 6 4) (end 6 -4) (layer F.SilkS) (width 0)) + (pad 2 thru_hole circle (at -2 -2 270) (size 1 1) (drill 1) (layers *.Cu *.Mask F.SilkS) + (net 5 "Net-(D3-Pad1)")) + (pad 9 thru_hole circle (at -2 2 270) (size 1 1) (drill 1) (layers *.Cu *.Mask F.SilkS) + (net 6 "Net-(D3-Pad2)")) + (pad 5 thru_hole circle (at 5 -2 270) (size 1 1) (drill 1) (layers *.Cu *.Mask F.SilkS) + (net 12 +5V)) + (pad 6 thru_hole circle (at 5 2 270) (size 1 1) (drill 1) (layers *.Cu *.Mask F.SilkS)) + (pad 1 thru_hole circle (at -5 -2 270) (size 1 1) (drill 1) (layers *.Cu *.Mask F.SilkS)) + (pad 10 thru_hole circle (at -5 2 270) (size 1 1) (drill 1) (layers *.Cu *.Mask F.SilkS) + (net 14 "Net-(K1-Pad10)")) + ) + + (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 58C86110) (tstamp 58C85CE1) + (at 146.812 106.172) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /58BCAB40) + (fp_text reference P1 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Out (at -0.254 -2.54) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 3.93) (end 1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 3.93) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 4.1) (end 1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 4.1) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 13 "Net-(P1-Pad1)")) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 GND)) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl + (at (xyz 0 -0.05 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 58C86107) (tstamp 58C85CF5) + (at 156.972 106.172) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /58BC9E67) + (fp_text reference P2 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value GPIO (at -0.508 -2.54) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 3.93) (end 1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 3.93) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 4.1) (end 1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 4.1) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 10 "Net-(IC1-Pad3)")) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 8 "Net-(IC1-Pad2)")) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl + (at (xyz 0 -0.05 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 58C86116) (tstamp 58C85D09) + (at 144.272 106.172) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /58BCB107) + (fp_text reference P3 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value In (at 0 -2.54) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 3.93) (end 1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 3.93) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 4.1) (end 1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 4.1) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 12 +5V)) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 GND)) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl + (at (xyz 0 -0.05 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 58C8611B) (tstamp 58C85D1D) + (at 141.732 106.172) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /58BCBF9C) + (fp_text reference P4 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value SW (at 0 -2.54) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 3.93) (end 1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 3.93) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 4.1) (end 1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 4.1) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 12 +5V)) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 7 "Net-(IC1-Pad5)")) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl + (at (xyz 0 -0.05 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 58C86103) (tstamp 58C85D31) + (at 151.892 106.172) + (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x02 2.54mm single row") + (path /58C5F893) + (fp_text reference P5 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value Fan (at 1.016 -2.54) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 3.81) (end 1.27 3.81) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 3.81) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 3.93) (end 1.39 3.93) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 3.93) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 4.1) (end 1.6 4.1) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 4.1) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 14 "Net-(K1-Pad10)")) + (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 2 GND)) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl + (at (xyz 0 -0.05 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module Pin_Headers:Pin_Header_Straight_1x01_Pitch2.54mm (layer F.Cu) (tedit 58C85C6C) (tstamp 58C85D44) + (at 154.432 106.172) + (descr "Through hole straight pin header, 1x01, 2.54mm pitch, single row") + (tags "Through hole pin header THT 1x01 2.54mm single row") + (path /58C5AEE2) + (fp_text reference P6 (at 0 -2.39) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value FanCtrl (at 0 2.39) (layer F.Fab) hide + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -1.27 -1.27) (end -1.27 1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.27 1.27) (end 1.27 1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) + (fp_line (start -1.39 1.27) (end -1.39 1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 1.39) (end 1.39 1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.39) (end 1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.39 1.27) (end -1.39 1.27) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 0) (end -1.39 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.39 -1.39) (end 0 -1.39) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.6 -1.6) (end -1.6 1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.6 1.6) (end 1.6 1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 1.6) (end 1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.6 -1.6) (end -1.6 -1.6) (layer F.CrtYd) (width 0.05)) + (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (net 15 "Net-(P6-Pad1)")) + (model Pin_Headers.3dshapes/Pin_Header_Straight_1x01_Pitch2.54mm.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 90)) + ) + ) + + (module TO_SOT_Packages_THT:TO-92_Inline_Narrow_Oval (layer F.Cu) (tedit 58C860C3) (tstamp 58C85D56) + (at 147.574 128.016) + (descr "TO-92 leads in-line, narrow, oval pads, drill 0.6mm (see NXP sot054_po.pdf)") + (tags "to-92 sc-43 sc-43a sot54 PA33 transistor") + (path /58C05D7C) + (fp_text reference Q1 (at 1.27 -3.56) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value BC547 (at 1.27 2.79) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 1.27 -3.56) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -0.53 1.85) (end 3.07 1.85) (layer F.SilkS) (width 0.12)) + (fp_line (start -0.5 1.75) (end 3 1.75) (layer F.Fab) (width 0.1)) + (fp_line (start -1.46 -2.73) (end 4 -2.73) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.46 -2.73) (end -1.46 2.01) (layer F.CrtYd) (width 0.05)) + (fp_line (start 4 2.01) (end 4 -2.73) (layer F.CrtYd) (width 0.05)) + (fp_line (start 4 2.01) (end -1.46 2.01) (layer F.CrtYd) (width 0.05)) + (fp_arc (start 1.27 0) (end 1.27 -2.48) (angle 135) (layer F.Fab) (width 0.1)) + (fp_arc (start 1.27 0) (end 1.27 -2.6) (angle -135) (layer F.SilkS) (width 0.12)) + (fp_arc (start 1.27 0) (end 1.27 -2.48) (angle -135) (layer F.Fab) (width 0.1)) + (fp_arc (start 1.27 0) (end 1.27 -2.6) (angle 135) (layer F.SilkS) (width 0.12)) + (pad 2 thru_hole oval (at 1.27 0 180) (size 0.9 1.5) (drill 0.6) (layers *.Cu *.Mask) + (net 16 "Net-(Q1-Pad2)")) + (pad 3 thru_hole oval (at 2.54 0 180) (size 0.9 1.5) (drill 0.6) (layers *.Cu *.Mask) + (net 2 GND)) + (pad 1 thru_hole rect (at 0 0 180) (size 0.9 1.5) (drill 0.6) (layers *.Cu *.Mask) + (net 4 "Net-(D2-Pad2)")) + (model TO_SOT_Packages_THT.3dshapes/TO-92_Inline_Narrow_Oval.wrl + (at (xyz 0.05 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 -90)) + ) + ) + + (module TO_SOT_Packages_THT:TO-92_Inline_Narrow_Oval (layer F.Cu) (tedit 58C860C9) (tstamp 58C85D68) + (at 156.21 128.016 180) + (descr "TO-92 leads in-line, narrow, oval pads, drill 0.6mm (see NXP sot054_po.pdf)") + (tags "to-92 sc-43 sc-43a sot54 PA33 transistor") + (path /58C5B17E) + (fp_text reference Q2 (at 1.27 -3.56 180) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value BC547 (at 1.27 -2.794 180) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 1.27 -3.56 180) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start -0.53 1.85) (end 3.07 1.85) (layer F.SilkS) (width 0.12)) + (fp_line (start -0.5 1.75) (end 3 1.75) (layer F.Fab) (width 0.1)) + (fp_line (start -1.46 -2.73) (end 4 -2.73) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.46 -2.73) (end -1.46 2.01) (layer F.CrtYd) (width 0.05)) + (fp_line (start 4 2.01) (end 4 -2.73) (layer F.CrtYd) (width 0.05)) + (fp_line (start 4 2.01) (end -1.46 2.01) (layer F.CrtYd) (width 0.05)) + (fp_arc (start 1.27 0) (end 1.27 -2.48) (angle 135) (layer F.Fab) (width 0.1)) + (fp_arc (start 1.27 0) (end 1.27 -2.6) (angle -135) (layer F.SilkS) (width 0.12)) + (fp_arc (start 1.27 0) (end 1.27 -2.48) (angle -135) (layer F.Fab) (width 0.1)) + (fp_arc (start 1.27 0) (end 1.27 -2.6) (angle 135) (layer F.SilkS) (width 0.12)) + (pad 2 thru_hole oval (at 1.27 0) (size 0.9 1.5) (drill 0.6) (layers *.Cu *.Mask) + (net 17 "Net-(Q2-Pad2)")) + (pad 3 thru_hole oval (at 2.54 0) (size 0.9 1.5) (drill 0.6) (layers *.Cu *.Mask) + (net 2 GND)) + (pad 1 thru_hole rect (at 0 0) (size 0.9 1.5) (drill 0.6) (layers *.Cu *.Mask) + (net 6 "Net-(D3-Pad2)")) + (model TO_SOT_Packages_THT.3dshapes/TO-92_Inline_Narrow_Oval.wrl + (at (xyz 0.05 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 -90)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58C85D79) + (at 147.658 117.094 180) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58BC46F5) + (attr smd) + (fp_text reference R1 (at 0 1.45 180) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 150 (at 0 -1.55 180) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 180) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 180) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 9 "Net-(IC1-Pad6)")) + (pad 2 smd rect (at 1.1 0 180) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 1 "Net-(D1-Pad1)")) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58C85D8A) + (at 145.118 115.57 180) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58C07326) + (attr smd) + (fp_text reference R2 (at 0 1.45 180) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 1K (at 0 -1.55 180) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 180) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 180) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 11 "Net-(IC1-Pad7)")) + (pad 2 smd rect (at 1.1 0 180) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 16 "Net-(Q1-Pad2)")) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58C85D9B) + (at 150.284 122.936 180) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58C0F69C) + (attr smd) + (fp_text reference R3 (at 0 1.45 180) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 10K (at 0 -1.55 180) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 180) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 180) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 2 GND)) + (pad 2 smd rect (at 1.1 0 180) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 10 "Net-(IC1-Pad3)")) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58C85DAC) + (at 154.432 111.844 270) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58C0E76C) + (attr smd) + (fp_text reference R4 (at 0 1.45 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 10K (at 0 -1.55 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 2 GND)) + (pad 2 smd rect (at 1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 7 "Net-(IC1-Pad5)")) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58C85DBD) + (at 133.35 125.9 270) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58C1D8B7) + (attr smd) + (fp_text reference R5 (at 0 1.45 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 33 (at 0 -1.55 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 3 "Net-(D2-Pad1)")) + (pad 2 smd rect (at 1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 12 +5V)) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58C85DCE) + (at 159.766 119.464 270) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58C5CFB1) + (attr smd) + (fp_text reference R6 (at 0 1.45 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 33 (at 0 -1.55 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 5 "Net-(D3-Pad1)")) + (pad 2 smd rect (at 1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 12 +5V)) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Relays_ThroughHole:Relay_SANYOU_SRD_Series_Form_C (layer F.Cu) (tedit 58C860BE) (tstamp 58C85DF4) + (at 133.396 129.974 90) + (descr "relay Sanyou SRD series Form C") + (path /58C04AF6) + (fp_text reference RL1 (at 8.1 9.2 90) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value "Songle SRD-05VDC" (at 8 -9.6 90) (layer Eco1.User) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 18.55 -7.95) (end -1.55 -7.95) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.55 7.95) (end -1.55 -7.95) (layer F.CrtYd) (width 0.05)) + (fp_line (start 18.55 -7.95) (end 18.55 7.95) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.55 7.95) (end 18.55 7.95) (layer F.CrtYd) (width 0.05)) + (fp_line (start 15 7.7) (end 18.3 7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start 18.3 7.7) (end 18.3 -7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start 18.3 -7.7) (end 14.95 -7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.3 1.35) (end -1.3 7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.3 7.7) (end 13.25 7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.3 -1.4) (end -1.3 -7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.3 -7.7) (end 13.45 -7.7) (layer F.SilkS) (width 0.12)) + (fp_line (start -1.3 -7.65) (end -1.3 -1.4) (layer F.SilkS) (width 0.12)) + (fp_line (start 14.15 4.2) (end 14.15 1.75) (layer F.SilkS) (width 0.12)) + (fp_line (start 14.15 -4.2) (end 14.15 -1.7) (layer F.SilkS) (width 0.12)) + (fp_line (start 3.55 6.05) (end 6.05 6.05) (layer F.SilkS) (width 0.12)) + (fp_line (start 2.65 0.05) (end 1.85 0.05) (layer F.SilkS) (width 0.12)) + (fp_line (start 6.05 -5.95) (end 3.55 -5.95) (layer F.SilkS) (width 0.12)) + (fp_line (start 9.45 0.05) (end 10.95 0.05) (layer F.SilkS) (width 0.12)) + (fp_line (start 10.95 0.05) (end 15.55 -2.45) (layer F.SilkS) (width 0.12)) + (fp_line (start 9.45 3.65) (end 2.65 3.65) (layer F.SilkS) (width 0.12)) + (fp_line (start 9.45 0.05) (end 9.45 3.65) (layer F.SilkS) (width 0.12)) + (fp_line (start 2.65 0.05) (end 2.65 3.65) (layer F.SilkS) (width 0.12)) + (fp_line (start 6.05 -5.95) (end 6.05 -1.75) (layer F.SilkS) (width 0.12)) + (fp_line (start 6.05 1.85) (end 6.05 6.05) (layer F.SilkS) (width 0.12)) + (fp_line (start 8.05 1.85) (end 4.05 -1.75) (layer F.SilkS) (width 0.12)) + (fp_line (start 4.05 1.85) (end 4.05 -1.75) (layer F.SilkS) (width 0.12)) + (fp_line (start 4.05 -1.75) (end 8.05 -1.75) (layer F.SilkS) (width 0.12)) + (fp_line (start 8.05 -1.75) (end 8.05 1.85) (layer F.SilkS) (width 0.12)) + (fp_line (start 8.05 1.85) (end 4.05 1.85) (layer F.SilkS) (width 0.12)) + (pad 2 thru_hole circle (at 1.95 6.05 180) (size 2.5 2.5) (drill 1) (layers *.Cu *.Mask) + (net 4 "Net-(D2-Pad2)")) + (pad 3 thru_hole circle (at 14.15 6.05 180) (size 3 3) (drill 1.3) (layers *.Cu *.Mask) + (net 13 "Net-(P1-Pad1)")) + (pad 4 thru_hole circle (at 14.2 -6 180) (size 3 3) (drill 1.3) (layers *.Cu *.Mask)) + (pad 5 thru_hole circle (at 1.95 -5.95 180) (size 2.5 2.5) (drill 1) (layers *.Cu *.Mask) + (net 3 "Net-(D2-Pad1)")) + (pad 1 thru_hole circle (at 0 0 180) (size 3 3) (drill 1.3) (layers *.Cu *.Mask) + (net 12 +5V)) + (model Relays_THT.3dshapes/Relay_SANYOU_SRD_Series_Form_C.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module Resistors_SMD:R_0603_HandSoldering (layer B.Cu) (tedit 58AAD9E8) (tstamp 58CD2535) + (at 154.686 124.122 270) + (descr "Resistor SMD 0603, hand soldering") + (tags "resistor 0603") + (path /58CD4537) + (attr smd) + (fp_text reference R7 (at 0 1.45 270) (layer B.SilkS) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text value 1K (at 0 -1.55 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_text user %R (at 0 1.45 270) (layer B.Fab) + (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) + ) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer B.Fab) (width 0.1)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer B.Fab) (width 0.1)) + (fp_line (start 0.5 -0.68) (end -0.5 -0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -0.5 0.68) (end 0.5 0.68) (layer B.SilkS) (width 0.12)) + (fp_line (start -1.96 0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start -1.96 0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end 1.95 0.7) (layer B.CrtYd) (width 0.05)) + (fp_line (start 1.95 -0.7) (end -1.96 -0.7) (layer B.CrtYd) (width 0.05)) + (pad 1 smd rect (at -1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 15 "Net-(P6-Pad1)")) + (pad 2 smd rect (at 1.1 0 270) (size 1.2 0.9) (layers B.Cu B.Paste B.Mask) + (net 17 "Net-(Q2-Pad2)")) + (model Resistors_SMD.3dshapes/R_0603.wrl + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_line (start 121.92 133.858) (end 121.92 102.108) (layer Edge.Cuts) (width 0.15)) + (gr_line (start 163.576 133.858) (end 121.92 133.858) (layer Edge.Cuts) (width 0.15)) + (gr_line (start 163.576 102.108) (end 163.576 133.858) (layer Edge.Cuts) (width 0.15)) + (gr_line (start 121.92 102.108) (end 163.576 102.108) (layer Edge.Cuts) (width 0.15)) + (gr_text + (at 159.766 108.458) (layer Eco1.User) + (effects (font (size 1.5 1.5) (thickness 0.3))) + ) + (gr_text - (at 159.766 106.172) (layer Eco1.User) + (effects (font (size 1.5 1.5) (thickness 0.3))) + ) + (gr_text "happy birthday\nHoot!" (at 129.794 108.712) (layer Eco1.User) + (effects (font (size 1.5 1.3) (thickness 0.25) italic)) + ) + (gr_text PiPower (at 130.048 104.14) (layer Eco1.User) + (effects (font (size 1.5 1.5) (thickness 0.3))) + ) + (gr_circle (center 162.052 132.334) (end 163.068 132.334) (layer Edge.Cuts) (width 0.15) (tstamp 58BC5F99)) + (gr_circle (center 123.444 132.334) (end 124.46 132.334) (layer Edge.Cuts) (width 0.15) (tstamp 58BC5F8E)) + (gr_circle (center 123.444 103.632) (end 124.46 103.632) (layer Edge.Cuts) (width 0.15) (tstamp 58BC5F77)) + (gr_circle (center 162.052 103.632) (end 163.068 103.632) (layer Edge.Cuts) (width 0.15)) + + (segment (start 136.906 117.602) (end 136.906 105.41) (width 0.6) (layer B.Cu) (net 1)) + (segment (start 147.5 102.87) (end 149.352 104.722) (width 0.6) (layer B.Cu) (net 1)) + (segment (start 136.906 105.41) (end 139.446 102.87) (width 0.6) (layer B.Cu) (net 1)) + (segment (start 139.446 102.87) (end 147.5 102.87) (width 0.6) (layer B.Cu) (net 1)) + (segment (start 149.352 104.722) (end 149.352 106.172) (width 0.6) (layer B.Cu) (net 1)) + (segment (start 142.069736 118.364) (end 137.668 118.364) (width 0.6) (layer F.Cu) (net 1)) + (segment (start 137.668 118.364) (end 136.906 117.602) (width 0.6) (layer F.Cu) (net 1)) + (via (at 136.906 117.602) (size 0.6) (drill 0.4) (layers F.Cu B.Cu) (net 1)) + (segment (start 143.764 117.094) (end 143.339736 117.094) (width 0.6) (layer F.Cu) (net 1)) + (segment (start 143.339736 117.094) (end 142.069736 118.364) (width 0.6) (layer F.Cu) (net 1)) + (segment (start 146.558 117.094) (end 143.764 117.094) (width 0.6) (layer B.Cu) (net 1)) + (via (at 143.764 117.094) (size 0.6) (drill 0.4) (layers F.Cu B.Cu) (net 1)) + (segment (start 153.67 128.016) (end 151.604 128.016) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 151.604 128.016) (end 151.384 127.796) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 151.892 108.712) (end 151.892 109.914081) (width 0.6) (layer F.Cu) (net 2)) + (segment (start 152.183999 119.850001) (end 151.384 120.65) (width 0.6) (layer F.Cu) (net 2)) + (segment (start 151.892 109.914081) (end 152.684001 110.706082) (width 0.6) (layer F.Cu) (net 2)) + (segment (start 152.684001 110.706082) (end 152.684001 119.349999) (width 0.6) (layer F.Cu) (net 2)) + (segment (start 152.684001 119.349999) (end 152.183999 119.850001) (width 0.6) (layer F.Cu) (net 2)) + (segment (start 149.352 108.712) (end 151.892 108.712) (width 1.5) (layer B.Cu) (net 2)) + (segment (start 146.812 108.712) (end 149.352 108.712) (width 1.5) (layer B.Cu) (net 2)) + (segment (start 144.272 108.712) (end 146.812 108.712) (width 1.5) (layer B.Cu) (net 2)) + (segment (start 151.384 122.936) (end 151.384 127.796) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 151.384 127.796) (end 151.164 128.016) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 151.164 128.016) (end 150.114 128.016) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 151.384 122.936) (end 151.384 120.65) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 154.432 109.982) (end 153.162 108.712) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 153.162 108.712) (end 151.892 108.712) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 154.432 110.744) (end 154.432 109.982) (width 0.6) (layer B.Cu) (net 2)) + (segment (start 133.35 124.8) (end 130.67 124.8) (width 0.6) (layer B.Cu) (net 3)) + (segment (start 130.67 124.8) (end 127.446 128.024) (width 0.6) (layer B.Cu) (net 3)) + (segment (start 143.002 125.222) (end 142.58 124.8) (width 0.6) (layer B.Cu) (net 3)) + (segment (start 142.58 124.8) (end 133.35 124.8) (width 0.6) (layer B.Cu) (net 3)) + (segment (start 143.764 125.222) (end 143.002 125.222) (width 0.6) (layer B.Cu) (net 3)) + (segment (start 143.764 130.302) (end 145.288 130.302) (width 0.6) (layer B.Cu) (net 4)) + (segment (start 145.288 130.302) (end 147.574 128.016) (width 0.6) (layer B.Cu) (net 4)) + (segment (start 141.724 130.302) (end 143.764 130.302) (width 0.6) (layer B.Cu) (net 4)) + (segment (start 139.446 128.024) (end 141.724 130.302) (width 0.6) (layer B.Cu) (net 4)) + (segment (start 139.454 128.016) (end 139.446 128.024) (width 0.6) (layer B.Cu) (net 4)) + (segment (start 159.766 125.476) (end 161.29 123.952) (width 0.6) (layer B.Cu) (net 5)) + (segment (start 161.29 123.952) (end 161.29 118.838) (width 0.6) (layer B.Cu) (net 5)) + (segment (start 161.29 118.838) (end 160.816 118.364) (width 0.6) (layer B.Cu) (net 5)) + (segment (start 160.816 118.364) (end 159.766 118.364) (width 0.6) (layer B.Cu) (net 5)) + (segment (start 159.766 115.936) (end 159.766 118.364) (width 0.6) (layer B.Cu) (net 5)) + (segment (start 156.21 128.016) (end 156.21 127.716) (width 0.6) (layer F.Cu) (net 6)) + (segment (start 156.21 127.716) (end 156.766001 127.159999) (width 0.6) (layer F.Cu) (net 6)) + (segment (start 156.766001 127.159999) (end 156.766001 116.936001) (width 0.6) (layer F.Cu) (net 6)) + (segment (start 156.766001 116.936001) (end 156.265999 116.435999) (width 0.6) (layer F.Cu) (net 6)) + (segment (start 156.265999 116.435999) (end 155.766 115.936) (width 0.6) (layer F.Cu) (net 6)) + (segment (start 156.972 130.556) (end 156.21 129.794) (width 0.6) (layer B.Cu) (net 6)) + (segment (start 156.21 129.794) (end 156.21 128.016) (width 0.6) (layer B.Cu) (net 6)) + (segment (start 159.766 130.556) (end 156.972 130.556) (width 0.6) (layer B.Cu) (net 6)) + (segment (start 141.732 108.712) (end 144.749999 111.729999) (width 0.6) (layer F.Cu) (net 7)) + (segment (start 144.749999 111.729999) (end 150.083999 111.729999) (width 0.6) (layer F.Cu) (net 7)) + (segment (start 150.083999 111.729999) (end 150.584001 112.230001) (width 0.6) (layer F.Cu) (net 7)) + (segment (start 150.584001 112.230001) (end 151.384 113.03) (width 0.6) (layer F.Cu) (net 7)) + (segment (start 151.384 113.03) (end 154.346 113.03) (width 0.6) (layer B.Cu) (net 7)) + (segment (start 154.346 113.03) (end 154.432 112.944) (width 0.6) (layer B.Cu) (net 7)) + (segment (start 146.304 120.65) (end 148.59 118.364) (width 0.6) (layer B.Cu) (net 8)) + (segment (start 148.59 118.364) (end 155.702 118.364) (width 0.6) (layer B.Cu) (net 8)) + (segment (start 155.702 118.364) (end 156.972 117.094) (width 0.6) (layer B.Cu) (net 8)) + (segment (start 156.972 117.094) (end 156.972 108.712) (width 0.6) (layer B.Cu) (net 8)) + (segment (start 148.844 113.03) (end 148.844 117.008) (width 0.6) (layer B.Cu) (net 9)) + (segment (start 148.844 117.008) (end 148.758 117.094) (width 0.6) (layer B.Cu) (net 9)) + (segment (start 148.93 113.116) (end 148.844 113.03) (width 0.6) (layer B.Cu) (net 9)) + (segment (start 158.322001 117.267999) (end 156.42599 119.16401) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 156.42599 119.16401) (end 150.32999 119.16401) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 150.32999 119.16401) (end 150.144001 119.349999) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 156.972 106.172) (end 158.322001 107.522001) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 158.322001 107.522001) (end 158.322001 117.267999) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 148.844 120.65) (end 150.144001 119.349999) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 148.844 120.65) (end 148.844 122.596) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 148.844 122.596) (end 149.184 122.936) (width 0.6) (layer B.Cu) (net 10)) + (segment (start 146.304 113.03) (end 146.304 115.484) (width 0.6) (layer B.Cu) (net 11)) + (segment (start 146.304 115.484) (end 146.218 115.57) (width 0.6) (layer B.Cu) (net 11)) + (segment (start 136.652 113.03) (end 133.396 116.286) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 133.396 116.286) (end 133.396 118.247998) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 138.613998 113.03) (end 136.652 113.03) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 133.396 129.974) (end 133.396 122.936) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 133.396 122.936) (end 133.396 118.247998) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 144.378002 122.936) (end 143.549998 122.936) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 143.549998 122.936) (end 133.396 122.936) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 145.796 128.338002) (end 145.796 124.353998) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 145.796 124.353998) (end 144.378002 122.936) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 156.786002 129.54) (end 146.997998 129.54) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 146.997998 129.54) (end 145.796 128.338002) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 157.734 124.260894) (end 157.734 128.592002) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 157.734 128.592002) (end 156.786002 129.54) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 159.766 122.936) (end 159.058894 122.936) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 159.058894 122.936) (end 157.734 124.260894) (width 0.6) (layer F.Cu) (net 12)) + (segment (start 159.766 120.564) (end 159.766 122.936) (width 0.6) (layer B.Cu) (net 12)) + (segment (start 139.382 106.172) (end 138.613998 106.940002) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 141.732 106.172) (end 139.382 106.172) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 138.613998 106.940002) (end 138.613998 113.03) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 144.272 106.172) (end 141.732 106.172) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 138.613998 113.03) (end 142.63263 113.03) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 142.63263 113.03) (end 143.764 113.03) (width 1.5) (layer F.Cu) (net 12)) + (segment (start 133.35 127) (end 133.35 129.928) (width 0.6) (layer B.Cu) (net 12)) + (segment (start 133.35 129.928) (end 133.396 129.974) (width 0.6) (layer B.Cu) (net 12)) + (segment (start 139.446 115.824) (end 139.446 105.047998) (width 1.5) (layer B.Cu) (net 13)) + (segment (start 139.446 105.047998) (end 140.121999 104.371999) (width 1.5) (layer B.Cu) (net 13)) + (segment (start 140.121999 104.371999) (end 145.882001 104.371999) (width 1.5) (layer B.Cu) (net 13)) + (segment (start 145.882001 104.371999) (end 146.812 105.301998) (width 1.5) (layer B.Cu) (net 13)) + (segment (start 146.812 105.301998) (end 146.812 106.172) (width 1.5) (layer B.Cu) (net 13)) + (segment (start 155.766 112.936) (end 155.766 110.046) (width 0.6) (layer F.Cu) (net 14)) + (segment (start 155.766 110.046) (end 151.892 106.172) (width 0.6) (layer F.Cu) (net 14)) + (segment (start 154.686 120.396) (end 154.686 115.062) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 155.782001 104.821999) (end 154.432 106.172) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 154.686 115.062) (end 155.194 114.554) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 155.194 114.554) (end 156.972 114.554) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 156.972 114.554) (end 158.322001 113.203999) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 158.322001 113.203999) (end 158.322001 104.921999) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 158.322001 104.921999) (end 158.222001 104.821999) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 158.222001 104.821999) (end 155.782001 104.821999) (width 0.6) (layer F.Cu) (net 15)) + (segment (start 154.686 120.396) (end 154.686 123.022) (width 0.6) (layer B.Cu) (net 15)) + (via (at 154.686 120.396) (size 0.6) (drill 0.4) (layers F.Cu B.Cu) (net 15)) + (segment (start 142.748 122.936) (end 147.233998 122.936) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 147.233998 122.936) (end 148.844 124.546002) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 148.844 124.546002) (end 148.844 126.666) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 148.844 126.666) (end 148.844 128.016) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 141.986 122.174) (end 142.748 122.936) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 141.986 116.402) (end 141.986 122.174) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 144.018 115.57) (end 142.818 115.57) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 142.818 115.57) (end 141.986 116.402) (width 0.6) (layer B.Cu) (net 16)) + (segment (start 154.686 125.222) (end 154.686 127.762) (width 0.6) (layer B.Cu) (net 17)) + (segment (start 154.686 127.762) (end 154.94 128.016) (width 0.6) (layer B.Cu) (net 17)) + +) diff --git a/KiCad/PiPower.net b/KiCad/PiPower.net new file mode 100644 index 0000000..cf85690 --- /dev/null +++ b/KiCad/PiPower.net @@ -0,0 +1,361 @@ +(export (version D) + (design + (source P:/Arduino/PiPower/KiCad/PiPower.sch) + (date "18-3-2017 13:11:47") + (tool "Eeschema 4.0.5") + (sheet (number 1) (name /) (tstamps /) + (title_block + (title PiPower) + (company "Mark van Renswoude") + (rev 1) + (date 2017-03-05) + (source PiPower.sch) + (comment (number 1) (value "")) + (comment (number 2) (value "")) + (comment (number 3) (value "")) + (comment (number 4) (value ""))))) + (components + (comp (ref IC1) + (value ATTiny85) + (footprint Housings_DIP:DIP-8_W7.62mm_Socket) + (libsource (lib atmel) (part ATTINY45-P)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BC3ABE)) + (comp (ref R1) + (value 150) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BC46F5)) + (comp (ref P2) + (value GPIO) + (footprint Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm) + (libsource (lib conn) (part CONN_01X02)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BC9E67)) + (comp (ref D1) + (value LED) + (footprint Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm) + (libsource (lib device) (part LED)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BC419B)) + (comp (ref P1) + (value Out) + (footprint Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm) + (libsource (lib conn) (part CONN_01X02)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BCAB40)) + (comp (ref P3) + (value In) + (footprint Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm) + (libsource (lib conn) (part CONN_01X02)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BCB107)) + (comp (ref P4) + (value SW) + (footprint Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm) + (libsource (lib conn) (part CONN_01X02)) + (sheetpath (names /) (tstamps /)) + (tstamp 58BCBF9C)) + (comp (ref Q1) + (value BC547) + (footprint TO_SOT_Packages_THT:TO-92_Inline_Narrow_Oval) + (libsource (lib transistors) (part BC547)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C05D7C)) + (comp (ref R2) + (value 1K) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C07326)) + (comp (ref RL1) + (value "Songle SRD-05VDC") + (footprint Relays_ThroughHole:Relay_SANYOU_SRD_Series_Form_C) + (libsource (lib PiPower-cache) (part FINDER-40.51)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C04AF6)) + (comp (ref R4) + (value 10K) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C0E76C)) + (comp (ref R3) + (value 10K) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C0F69C)) + (comp (ref D2) + (value D) + (footprint Diodes_ThroughHole:D_T-1_P5.08mm_Horizontal) + (libsource (lib device) (part D)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C1C921)) + (comp (ref R5) + (value 33) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C1D8B7)) + (comp (ref P6) + (value FanCtrl) + (footprint Pin_Headers:Pin_Header_Straight_1x01_Pitch2.54mm) + (libsource (lib conn) (part CONN_01X01)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C5AEE2)) + (comp (ref Q2) + (value BC547) + (footprint TO_SOT_Packages_THT:TO-92_Inline_Narrow_Oval) + (libsource (lib transistors) (part BC547)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C5B17E)) + (comp (ref K1) + (value G5V-1) + (footprint OmronG5V:OMRON-G5V-1) + (libsource (lib OmronG5V) (part G5V-1)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C5C232)) + (comp (ref D3) + (value D) + (footprint Diodes_ThroughHole:D_T-1_P5.08mm_Horizontal) + (libsource (lib device) (part D)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C5CB60)) + (comp (ref R6) + (value 33) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C5CFB1)) + (comp (ref P5) + (value Fan) + (footprint Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm) + (libsource (lib conn) (part CONN_01X02)) + (sheetpath (names /) (tstamps /)) + (tstamp 58C5F893)) + (comp (ref R7) + (value 1K) + (footprint Resistors_SMD:R_0603_HandSoldering) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 58CD4537))) + (libparts + (libpart (lib atmel) (part ATTINY25-P) + (aliases + (alias ATTINY45-P) + (alias ATTINY85-P)) + (description "PDIP8, 2k Flash, 128B SRAM, 128B EEPROM, Debug Wire") + (docs http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf) + (fields + (field (name Reference) IC) + (field (name Value) ATTINY25-P) + (field (name Footprint) DIP8)) + (pins + (pin (num 1) (name "PB5(~RESET~/dW/ADC0/PCINT5)") (type BiDi)) + (pin (num 2) (name "PB3(XTAL1/CLKI/OC1B/ADC3/PCINT3)") (type BiDi)) + (pin (num 3) (name "PB4(XTAL2/CLKO/OC1B/ADC2/PCINT4)") (type BiDi)) + (pin (num 4) (name GND) (type power_in)) + (pin (num 5) (name "PB0(MOSI/DI/SDA/AIN0/OC0A/OC1A/AREF/PCINT0)") (type BiDi)) + (pin (num 6) (name "PB1(MISO/DO/AIN1/OC0B/OC1A/PCINT1)") (type BiDi)) + (pin (num 7) (name "PB2(SCK/USCK/SCL/T0/INT0/ADC1/PCINT2)") (type BiDi)) + (pin (num 8) (name VCC) (type power_in)))) + (libpart (lib transistors) (part BC547) + (aliases + (alias BC546) + (alias BC548) + (alias BC549) + (alias BC550)) + (description "45V Vce, 0.1A Ic, NPN, Small Signal Transistor, TO-92") + (docs http://www.fairchildsemi.com/ds/BC/BC547.pdf) + (footprints + (fp TO-92*)) + (fields + (field (name Reference) Q) + (field (name Value) BC547) + (field (name Footprint) TO-92)) + (pins + (pin (num 1) (name C) (type passive)) + (pin (num 2) (name B) (type input)) + (pin (num 3) (name E) (type passive)))) + (libpart (lib conn) (part CONN_01X01) + (description "Connector, single row, 01x01") + (footprints + (fp Pin_Header_Straight_1X01) + (fp Pin_Header_Angled_1X01) + (fp Socket_Strip_Straight_1X01) + (fp Socket_Strip_Angled_1X01)) + (fields + (field (name Reference) P) + (field (name Value) CONN_01X01)) + (pins + (pin (num 1) (name P1) (type passive)))) + (libpart (lib conn) (part CONN_01X02) + (description "Connector, single row, 01x02") + (footprints + (fp Pin_Header_Straight_1X02) + (fp Pin_Header_Angled_1X02) + (fp Socket_Strip_Straight_1X02) + (fp Socket_Strip_Angled_1X02)) + (fields + (field (name Reference) P) + (field (name Value) CONN_01X02)) + (pins + (pin (num 1) (name P1) (type passive)) + (pin (num 2) (name P2) (type passive)))) + (libpart (lib device) (part D) + (description Diode) + (footprints + (fp Diode_*) + (fp D-*) + (fp *SingleDiode) + (fp *_Diode_*) + (fp *SingleDiode*) + (fp D_*)) + (fields + (field (name Reference) D) + (field (name Value) D)) + (pins + (pin (num 1) (name K) (type passive)) + (pin (num 2) (name A) (type passive)))) + (libpart (lib PiPower-cache) (part FINDER-40.51) + (aliases + (alias FINDER-36.11.4001) + (alias FINDER-40.31) + (alias RM50-xx11)) + (fields + (field (name Reference) RL) + (field (name Value) FINDER-40.51)) + (pins + (pin (num 1) (name ~) (type passive)) + (pin (num 2) (name ~) (type passive)) + (pin (num 3) (name ~) (type passive)) + (pin (num 4) (name ~) (type passive)) + (pin (num 5) (name ~) (type passive)))) + (libpart (lib OmronG5V) (part G5V-1) + (footprints + (fp G5V-1)) + (fields + (field (name Reference) K) + (field (name Value) G5V-1) + (field (name Footprint) G5V-1)) + (pins + (pin (num 1) (name ~) (type unspc)) + (pin (num 2) (name ~) (type unspc)) + (pin (num 5) (name ~) (type unspc)) + (pin (num 6) (name ~) (type unspc)) + (pin (num 9) (name ~) (type unspc)) + (pin (num 10) (name ~) (type unspc)))) + (libpart (lib device) (part LED) + (description "LED generic") + (footprints + (fp LED*)) + (fields + (field (name Reference) D) + (field (name Value) LED)) + (pins + (pin (num 1) (name K) (type passive)) + (pin (num 2) (name A) (type passive)))) + (libpart (lib device) (part R) + (description Resistor) + (footprints + (fp R_*) + (fp Resistor_*)) + (fields + (field (name Reference) R) + (field (name Value) R)) + (pins + (pin (num 1) (name ~) (type passive)) + (pin (num 2) (name ~) (type passive))))) + (libraries + (library (logical device) + (uri "C:\\Program Files\\KiCad\\share\\kicad\\library\\device.lib")) + (library (logical transistors) + (uri "C:\\Program Files\\KiCad\\share\\kicad\\library\\transistors.lib")) + (library (logical conn) + (uri "C:\\Program Files\\KiCad\\share\\kicad\\library\\conn.lib")) + (library (logical atmel) + (uri "C:\\Program Files\\KiCad\\share\\kicad\\library\\atmel.lib")) + (library (logical OmronG5V) + (uri P:\KiCad\Libraries\OmronG5V.lib)) + (library (logical PiPower-cache) + (uri P:\Arduino\PiPower\KiCad\PiPower-cache.lib))) + (nets + (net (code 1) (name "Net-(IC1-Pad3)") + (node (ref R3) (pin 2)) + (node (ref IC1) (pin 3)) + (node (ref P2) (pin 1))) + (net (code 2) (name "Net-(P6-Pad1)") + (node (ref R7) (pin 1)) + (node (ref P6) (pin 1))) + (net (code 3) (name "Net-(Q2-Pad2)") + (node (ref R7) (pin 2)) + (node (ref Q2) (pin 2))) + (net (code 4) (name +5V) + (node (ref RL1) (pin 1)) + (node (ref R6) (pin 2)) + (node (ref IC1) (pin 8)) + (node (ref K1) (pin 5)) + (node (ref R5) (pin 2)) + (node (ref P3) (pin 1)) + (node (ref P4) (pin 1))) + (net (code 5) (name GND) + (node (ref Q1) (pin 3)) + (node (ref P3) (pin 2)) + (node (ref D1) (pin 2)) + (node (ref IC1) (pin 4)) + (node (ref P1) (pin 2)) + (node (ref R3) (pin 1)) + (node (ref P5) (pin 2)) + (node (ref R4) (pin 1)) + (node (ref Q2) (pin 3))) + (net (code 6) (name "Net-(IC1-Pad5)") + (node (ref P4) (pin 2)) + (node (ref R4) (pin 2)) + (node (ref IC1) (pin 5))) + (net (code 7) (name "Net-(K1-Pad10)") + (node (ref P5) (pin 1)) + (node (ref K1) (pin 10))) + (net (code 8) (name "Net-(K1-Pad6)") + (node (ref K1) (pin 6))) + (net (code 9) (name "Net-(K1-Pad1)") + (node (ref K1) (pin 1))) + (net (code 10) (name "Net-(D3-Pad2)") + (node (ref D3) (pin 2)) + (node (ref Q2) (pin 1)) + (node (ref K1) (pin 9))) + (net (code 11) (name "Net-(D3-Pad1)") + (node (ref D3) (pin 1)) + (node (ref R6) (pin 1)) + (node (ref K1) (pin 2))) + (net (code 12) (name "Net-(IC1-Pad2)") + (node (ref IC1) (pin 2)) + (node (ref P2) (pin 2))) + (net (code 13) (name "Net-(IC1-Pad6)") + (node (ref IC1) (pin 6)) + (node (ref R1) (pin 1))) + (net (code 14) (name "Net-(D1-Pad1)") + (node (ref D1) (pin 1)) + (node (ref R1) (pin 2))) + (net (code 15) (name "Net-(P1-Pad1)") + (node (ref P1) (pin 1)) + (node (ref RL1) (pin 3))) + (net (code 16) (name "Net-(D2-Pad2)") + (node (ref RL1) (pin 2)) + (node (ref Q1) (pin 1)) + (node (ref D2) (pin 2))) + (net (code 17) (name "Net-(RL1-Pad4)") + (node (ref RL1) (pin 4))) + (net (code 18) (name "Net-(D2-Pad1)") + (node (ref R5) (pin 1)) + (node (ref D2) (pin 1)) + (node (ref RL1) (pin 5))) + (net (code 19) (name "Net-(IC1-Pad1)") + (node (ref IC1) (pin 1))) + (net (code 20) (name "Net-(IC1-Pad7)") + (node (ref IC1) (pin 7)) + (node (ref R2) (pin 1))) + (net (code 21) (name "Net-(Q1-Pad2)") + (node (ref Q1) (pin 2)) + (node (ref R2) (pin 2))))) \ No newline at end of file diff --git a/KiCad/PiPower.pro b/KiCad/PiPower.pro new file mode 100644 index 0000000..996b5e9 --- /dev/null +++ b/KiCad/PiPower.pro @@ -0,0 +1,72 @@ +update=14-3-2017 21:48:10 +version=1 +last_client=kicad +[pcbnew] +version=1 +LastNetListRead= +UseCmpFile=1 +PadDrill=0.600000000000 +PadDrillOvalY=0.600000000000 +PadSizeH=1.500000000000 +PadSizeV=1.500000000000 +PcbTextSizeV=1.500000000000 +PcbTextSizeH=1.500000000000 +PcbTextThickness=0.300000000000 +ModuleTextSizeV=1.000000000000 +ModuleTextSizeH=1.000000000000 +ModuleTextSizeThickness=0.150000000000 +SolderMaskClearance=0.000000000000 +SolderMaskMinWidth=0.000000000000 +DrawSegmentWidth=0.200000000000 +BoardOutlineThickness=0.100000000000 +ModuleOutlineThickness=0.150000000000 +[cvpcb] +version=1 +NetIExt=net +[general] +version=1 +[schematic_editor] +version=1 +PageLayoutDescrFile= +PlotDirectoryName= +SubpartIdSeparator=0 +SubpartFirstId=65 +NetFmtName= +SpiceForceRefPrefix=0 +SpiceUseNetNumbers=0 +LabSize=60 +[eeschema] +version=1 +LibDir= +[eeschema/libraries] +LibName1=power +LibName2=device +LibName3=transistors +LibName4=conn +LibName5=linear +LibName6=regul +LibName7=74xx +LibName8=cmos4000 +LibName9=adc-dac +LibName10=memory +LibName11=xilinx +LibName12=microcontrollers +LibName13=dsp +LibName14=microchip +LibName15=analog_switches +LibName16=motorola +LibName17=texas +LibName18=intel +LibName19=audio +LibName20=interface +LibName21=digital-audio +LibName22=philips +LibName23=display +LibName24=cypress +LibName25=siliconi +LibName26=opto +LibName27=atmel +LibName28=contrib +LibName29=valves +LibName30=C:/Program Files/KiCad/share/kicad/library/switches +LibName31=P:/KiCad/Libraries/OmronG5V diff --git a/KiCad/PiPower.sch b/KiCad/PiPower.sch new file mode 100644 index 0000000..6eb2d18 --- /dev/null +++ b/KiCad/PiPower.sch @@ -0,0 +1,583 @@ +EESchema Schematic File Version 2 +LIBS:power +LIBS:device +LIBS:transistors +LIBS:conn +LIBS:linear +LIBS:regul +LIBS:74xx +LIBS:cmos4000 +LIBS:adc-dac +LIBS:memory +LIBS:xilinx +LIBS:microcontrollers +LIBS:dsp +LIBS:microchip +LIBS:analog_switches +LIBS:motorola +LIBS:texas +LIBS:intel +LIBS:audio +LIBS:interface +LIBS:digital-audio +LIBS:philips +LIBS:display +LIBS:cypress +LIBS:siliconi +LIBS:opto +LIBS:atmel +LIBS:contrib +LIBS:valves +LIBS:switches +LIBS:OmronG5V +LIBS:PiPower-cache +EELAYER 25 0 +EELAYER END +$Descr A4 11693 8268 +encoding utf-8 +Sheet 1 1 +Title "PiPower" +Date "2017-03-05" +Rev "1" +Comp "Mark van Renswoude" +Comment1 "" +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +$Comp +L ATTINY45-P IC1 +U 1 1 58BC3ABE +P 6350 3700 +F 0 "IC1" H 5200 4100 50 0000 C CNN +F 1 "ATTiny85" H 7350 3300 50 0000 C CNN +F 2 "Housings_DIP:DIP-8_W7.62mm_Socket" H 6350 3300 50 0001 C CIN +F 3 "" H 6350 3700 50 0000 C CNN + 1 6350 3700 + 1 0 0 -1 +$EndComp +$Comp +L +5V #PWR01 +U 1 1 58BC3C63 +P 7950 3000 +F 0 "#PWR01" H 7950 2850 50 0001 C CNN +F 1 "+5V" H 7950 3140 50 0000 C CNN +F 2 "" H 7950 3000 50 0000 C CNN +F 3 "" H 7950 3000 50 0000 C CNN + 1 7950 3000 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR02 +U 1 1 58BC3C79 +P 7950 4150 +F 0 "#PWR02" H 7950 3900 50 0001 C CNN +F 1 "GND" H 7950 4000 50 0000 C CNN +F 2 "" H 7950 4150 50 0000 C CNN +F 3 "" H 7950 4150 50 0000 C CNN + 1 7950 4150 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7700 3950 7950 3950 +Wire Wire Line + 7950 3950 7950 4150 +Wire Wire Line + 7950 3450 7700 3450 +Wire Wire Line + 7950 3000 7950 3450 +$Comp +L R R1 +U 1 1 58BC46F5 +P 4650 3550 +F 0 "R1" V 4550 3550 50 0000 C CNN +F 1 "150" V 4650 3550 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 4580 3550 50 0001 C CNN +F 3 "" H 4650 3550 50 0000 C CNN + 1 4650 3550 + 0 1 1 0 +$EndComp +Wire Wire Line + 3350 3950 3350 4400 +Wire Wire Line + 2950 4400 3250 4400 +$Comp +L GND #PWR03 +U 1 1 58BC5554 +P 3750 3100 +F 0 "#PWR03" H 3750 2850 50 0001 C CNN +F 1 "GND" H 3750 2950 50 0000 C CNN +F 2 "" H 3750 3100 50 0000 C CNN +F 3 "" H 3750 3100 50 0000 C CNN + 1 3750 3100 + 1 0 0 -1 +$EndComp +Wire Wire Line + 5000 3750 4850 3750 +Wire Wire Line + 4850 3750 4850 4300 +Wire Wire Line + 5000 3850 4950 3850 +Wire Wire Line + 5000 3550 4800 3550 +Wire Wire Line + 4500 3550 4500 3000 +Wire Wire Line + 4500 3000 4200 3000 +Wire Wire Line + 3900 3000 3750 3000 +Wire Wire Line + 3750 3000 3750 3100 +Wire Wire Line + 6300 3000 7950 3000 +Wire Wire Line + 5000 3000 6200 3000 +Wire Wire Line + 5000 3000 5000 3450 +$Comp +L CONN_01X02 P2 +U 1 1 58BC9E67 +P 4900 4500 +F 0 "P2" H 4900 4650 50 0000 C CNN +F 1 "GPIO" V 5000 4500 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm" H 4900 4500 50 0001 C CNN +F 3 "" H 4900 4500 50 0000 C CNN + 1 4900 4500 + 0 1 1 0 +$EndComp +$Comp +L LED D1 +U 1 1 58BC419B +P 4050 3000 +F 0 "D1" H 4050 3100 50 0000 C CNN +F 1 "LED" H 4050 2850 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm" H 4050 3000 50 0001 C CNN +F 3 "" H 4050 3000 50 0000 C CNN + 1 4050 3000 + -1 0 0 -1 +$EndComp +$Comp +L CONN_01X02 P1 +U 1 1 58BCAB40 +P 3300 4600 +F 0 "P1" H 3300 4750 50 0000 C CNN +F 1 "Out" V 3400 4600 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm" H 3300 4600 50 0001 C CNN +F 3 "" H 3300 4600 50 0000 C CNN + 1 3300 4600 + 0 1 1 0 +$EndComp +$Comp +L CONN_01X02 P3 +U 1 1 58BCB107 +P 6150 4800 +F 0 "P3" H 6150 4950 50 0000 C CNN +F 1 "In" V 6250 4800 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm" H 6150 4800 50 0001 C CNN +F 3 "" H 6150 4800 50 0000 C CNN + 1 6150 4800 + 0 1 1 0 +$EndComp +Wire Wire Line + 6250 4500 6250 4600 +Wire Wire Line + 6250 4600 6200 4600 +Wire Wire Line + 6050 4500 6050 4600 +Wire Wire Line + 6050 4600 6100 4600 +$Comp +L CONN_01X02 P4 +U 1 1 58BCBF9C +P 6250 3200 +F 0 "P4" H 6250 3350 50 0000 C CNN +F 1 "SW" V 6350 3200 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm" H 6250 3200 50 0001 C CNN +F 3 "" H 6250 3200 50 0000 C CNN + 1 6250 3200 + 0 1 1 0 +$EndComp +$Comp +L BC547 Q1 +U 1 1 58C05D7C +P 4150 3650 +F 0 "Q1" H 4350 3725 50 0000 L CNN +F 1 "BC547" H 4350 3650 50 0000 L CNN +F 2 "TO_SOT_Packages_THT:TO-92_Inline_Narrow_Oval" H 4350 3575 50 0001 L CIN +F 3 "" H 4150 3650 50 0000 L CNN + 1 4150 3650 + -1 0 0 -1 +$EndComp +$Comp +L R R2 +U 1 1 58C07326 +P 4650 3650 +F 0 "R2" V 4730 3650 50 0000 C CNN +F 1 "1K" V 4650 3650 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 4580 3650 50 0001 C CNN +F 3 "" H 4650 3650 50 0000 C CNN + 1 4650 3650 + 0 1 1 0 +$EndComp +Wire Wire Line + 5000 3650 4800 3650 +Wire Wire Line + 4500 3650 4350 3650 +$Comp +L GND #PWR04 +U 1 1 58C075E3 +P 4050 3850 +F 0 "#PWR04" H 4050 3600 50 0001 C CNN +F 1 "GND" H 4050 3700 50 0000 C CNN +F 2 "" H 4050 3850 50 0000 C CNN +F 3 "" H 4050 3850 50 0000 C CNN + 1 4050 3850 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3350 3450 4050 3450 +$Comp +L FINDER-40.51 RL1 +U 1 1 58C04AF6 +P 3050 3650 +F 0 "RL1" V 3500 3600 50 0000 L CNN +F 1 "Songle SRD-05VDC" V 2550 3300 50 0000 L CNN +F 2 "Relays_ThroughHole:Relay_SANYOU_SRD_Series_Form_C" H 3050 3650 50 0001 C CNN +F 3 "" H 3050 3650 50 0000 C CNN + 1 3050 3650 + 0 1 1 0 +$EndComp +Wire Wire Line + 2550 3450 2750 3450 +NoConn ~ 5000 3950 +NoConn ~ 3350 3750 +$Comp +L +5V #PWR05 +U 1 1 58C0C2EB +P 2250 3450 +F 0 "#PWR05" H 2250 3300 50 0001 C CNN +F 1 "+5V" H 2250 3590 50 0000 C CNN +F 2 "" H 2250 3450 50 0000 C CNN +F 3 "" H 2250 3450 50 0000 C CNN + 1 2250 3450 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR06 +U 1 1 58C0C314 +P 2950 4400 +F 0 "#PWR06" H 2950 4150 50 0001 C CNN +F 1 "GND" H 2950 4250 50 0000 C CNN +F 2 "" H 2950 4400 50 0000 C CNN +F 3 "" H 2950 4400 50 0000 C CNN + 1 2950 4400 + 1 0 0 -1 +$EndComp +$Comp +L +5V #PWR07 +U 1 1 58C0C6A9 +P 6250 4500 +F 0 "#PWR07" H 6250 4350 50 0001 C CNN +F 1 "+5V" H 6250 4640 50 0000 C CNN +F 2 "" H 6250 4500 50 0000 C CNN +F 3 "" H 6250 4500 50 0000 C CNN + 1 6250 4500 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR08 +U 1 1 58C0C6D2 +P 6050 4500 +F 0 "#PWR08" H 6050 4250 50 0001 C CNN +F 1 "GND" H 6050 4350 50 0000 C CNN +F 2 "" H 6050 4500 50 0000 C CNN +F 3 "" H 6050 4500 50 0000 C CNN + 1 6050 4500 + -1 0 0 1 +$EndComp +$Comp +L PWR_FLAG #FLG09 +U 1 1 58C0D1D1 +P 7100 4700 +F 0 "#FLG09" H 7100 4795 50 0001 C CNN +F 1 "PWR_FLAG" H 7100 4880 50 0000 C CNN +F 2 "" H 7100 4700 50 0000 C CNN +F 3 "" H 7100 4700 50 0000 C CNN + 1 7100 4700 + -1 0 0 1 +$EndComp +$Comp +L PWR_FLAG #FLG010 +U 1 1 58C0D61C +P 7400 4600 +F 0 "#FLG010" H 7400 4695 50 0001 C CNN +F 1 "PWR_FLAG" H 7400 4780 50 0000 C CNN +F 2 "" H 7400 4600 50 0000 C CNN +F 3 "" H 7400 4600 50 0000 C CNN + 1 7400 4600 + 1 0 0 -1 +$EndComp +$Comp +L +5V #PWR011 +U 1 1 58C0D645 +P 7100 4600 +F 0 "#PWR011" H 7100 4450 50 0001 C CNN +F 1 "+5V" H 7100 4740 50 0000 C CNN +F 2 "" H 7100 4600 50 0000 C CNN +F 3 "" H 7100 4600 50 0000 C CNN + 1 7100 4600 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR012 +U 1 1 58C0D7B8 +P 7400 4700 +F 0 "#PWR012" H 7400 4450 50 0001 C CNN +F 1 "GND" H 7400 4550 50 0000 C CNN +F 2 "" H 7400 4700 50 0000 C CNN +F 3 "" H 7400 4700 50 0000 C CNN + 1 7400 4700 + 1 0 0 -1 +$EndComp +Wire Wire Line + 7400 4600 7400 4700 +Wire Wire Line + 7100 4600 7100 4700 +$Comp +L GND #PWR013 +U 1 1 58C0E291 +P 5850 3100 +F 0 "#PWR013" H 5850 2850 50 0001 C CNN +F 1 "GND" H 5850 2950 50 0000 C CNN +F 2 "" H 5850 3100 50 0000 C CNN +F 3 "" H 5850 3100 50 0000 C CNN + 1 5850 3100 + 1 0 0 -1 +$EndComp +$Comp +L R R4 +U 1 1 58C0E76C +P 5600 3100 +F 0 "R4" V 5680 3100 50 0000 C CNN +F 1 "10K" V 5600 3100 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 5530 3100 50 0001 C CNN +F 3 "" H 5600 3100 50 0000 C CNN + 1 5600 3100 + 0 1 1 0 +$EndComp +Wire Wire Line + 5850 3100 5750 3100 +Wire Wire Line + 5450 3100 5350 3100 +Wire Wire Line + 5350 3100 5350 3000 +Connection ~ 5350 3000 +$Comp +L GND #PWR014 +U 1 1 58C0F5DA +P 5350 4350 +F 0 "#PWR014" H 5350 4100 50 0001 C CNN +F 1 "GND" H 5350 4200 50 0000 C CNN +F 2 "" H 5350 4350 50 0000 C CNN +F 3 "" H 5350 4350 50 0000 C CNN + 1 5350 4350 + 1 0 0 -1 +$EndComp +$Comp +L R R3 +U 1 1 58C0F69C +P 5200 4200 +F 0 "R3" V 5280 4200 50 0000 C CNN +F 1 "10K" V 5200 4200 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 5130 4200 50 0001 C CNN +F 3 "" H 5200 4200 50 0000 C CNN + 1 5200 4200 + 0 1 1 0 +$EndComp +Wire Wire Line + 5350 4350 5350 4200 +Wire Wire Line + 5050 4200 4950 4200 +Connection ~ 4950 4200 +$Comp +L D D2 +U 1 1 58C1C921 +P 3050 3000 +F 0 "D2" H 3050 3100 50 0000 C CNN +F 1 "D" H 3050 2900 50 0000 C CNN +F 2 "Diodes_ThroughHole:D_T-1_P5.08mm_Horizontal" H 3050 3000 50 0001 C CNN +F 3 "" H 3050 3000 50 0000 C CNN + 1 3050 3000 + 1 0 0 -1 +$EndComp +Wire Wire Line + 2900 3000 2650 3000 +Wire Wire Line + 2650 3000 2650 3450 +Connection ~ 2650 3450 +Wire Wire Line + 3200 3000 3450 3000 +Wire Wire Line + 3450 3000 3450 3450 +Connection ~ 3450 3450 +$Comp +L R R5 +U 1 1 58C1D8B7 +P 2400 3450 +F 0 "R5" V 2480 3450 50 0000 C CNN +F 1 "33" V 2400 3450 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 2330 3450 50 0001 C CNN +F 3 "" H 2400 3450 50 0000 C CNN + 1 2400 3450 + 0 1 1 0 +$EndComp +Wire Wire Line + 2250 3450 2250 3850 +Wire Wire Line + 2250 3850 2750 3850 +Text Notes 6900 4350 0 20 ~ 0 +These are here just to satisfy KiCad's ERC +Wire Notes Line + 6850 4250 6850 4950 +Wire Notes Line + 6850 4950 7650 4950 +Wire Notes Line + 7650 4950 7650 4250 +Wire Notes Line + 7650 4250 6850 4250 +Text Notes 3700 2800 0 20 ~ 0 +Note: I know this is not the correct way around, \nbut since the footprint is a pin header this'll match \nup pin 2 to ground like the other pin headers +Wire Wire Line + 4950 3850 4950 4300 +$Comp +L CONN_01X01 P6 +U 1 1 58C5AEE2 +P 5400 5850 +F 0 "P6" H 5400 5950 50 0000 C CNN +F 1 "FanCtrl" V 5500 5850 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x01_Pitch2.54mm" H 5400 5850 50 0001 C CNN +F 3 "" H 5400 5850 50 0000 C CNN + 1 5400 5850 + 0 1 1 0 +$EndComp +$Comp +L BC547 Q2 +U 1 1 58C5B17E +P 4900 5650 +F 0 "Q2" H 5100 5725 50 0000 L CNN +F 1 "BC547" H 5100 5650 50 0000 L CNN +F 2 "TO_SOT_Packages_THT:TO-92_Inline_Narrow_Oval" H 5100 5575 50 0001 L CIN +F 3 "" H 4900 5650 50 0000 L CNN + 1 4900 5650 + -1 0 0 -1 +$EndComp +$Comp +L GND #PWR015 +U 1 1 58C5B84A +P 4800 6200 +F 0 "#PWR015" H 4800 5950 50 0001 C CNN +F 1 "GND" H 4800 6050 50 0000 C CNN +F 2 "" H 4800 6200 50 0000 C CNN +F 3 "" H 4800 6200 50 0000 C CNN + 1 4800 6200 + 1 0 0 -1 +$EndComp +$Comp +L G5V-1 K1 +U 1 1 58C5C232 +P 4000 5650 +F 0 "K1" V 4400 5600 50 0000 L CNN +F 1 "G5V-1" V 4000 5550 50 0000 L CNN +F 2 "OmronG5V:OMRON-G5V-1" H 4000 5650 50 0001 C CNN +F 3 "" H 4000 5650 60 0001 C CNN + 1 4000 5650 + 0 1 1 0 +$EndComp +$Comp +L D D3 +U 1 1 58C5CB60 +P 4000 5100 +F 0 "D3" H 4000 5200 50 0000 C CNN +F 1 "D" H 4000 5000 50 0000 C CNN +F 2 "Diodes_ThroughHole:D_T-1_P5.08mm_Horizontal" H 4000 5100 50 0001 C CNN +F 3 "" H 4000 5100 50 0000 C CNN + 1 4000 5100 + 1 0 0 -1 +$EndComp +$Comp +L R R6 +U 1 1 58C5CFB1 +P 3450 5450 +F 0 "R6" V 3530 5450 50 0000 C CNN +F 1 "33" V 3450 5450 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 3380 5450 50 0001 C CNN +F 3 "" H 3450 5450 50 0000 C CNN + 1 3450 5450 + 0 1 1 0 +$EndComp +Wire Wire Line + 3700 5450 3600 5450 +Wire Wire Line + 3850 5100 3650 5100 +Wire Wire Line + 3650 5100 3650 5450 +Connection ~ 3650 5450 +Wire Wire Line + 4150 5100 4400 5100 +Wire Wire Line + 4400 5100 4400 5450 +Wire Wire Line + 4300 5450 4800 5450 +Connection ~ 4400 5450 +Wire Wire Line + 3200 5400 3200 5750 +Wire Wire Line + 3200 5450 3300 5450 +Wire Wire Line + 3200 5750 3700 5750 +Connection ~ 3200 5450 +Wire Wire Line + 4800 5850 4800 6200 +$Comp +L CONN_01X02 P5 +U 1 1 58C5F893 +P 4550 5900 +F 0 "P5" H 4550 6050 50 0000 C CNN +F 1 "Fan" V 4650 5900 50 0000 C CNN +F 2 "Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm" H 4550 5900 50 0001 C CNN +F 3 "" H 4550 5900 50 0000 C CNN + 1 4550 5900 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 4600 6100 4800 6100 +Connection ~ 4800 6100 +Wire Wire Line + 4500 6100 4300 6100 +Wire Wire Line + 4300 6100 4300 5950 +$Comp +L +5V #PWR016 +U 1 1 58C61908 +P 3200 5400 +F 0 "#PWR016" H 3200 5250 50 0001 C CNN +F 1 "+5V" H 3200 5540 50 0000 C CNN +F 2 "" H 3200 5400 50 0000 C CNN +F 3 "" H 3200 5400 50 0000 C CNN + 1 3200 5400 + 1 0 0 -1 +$EndComp +NoConn ~ 3700 5950 +NoConn ~ 4300 5750 +$Comp +L R R7 +U 1 1 58CD4537 +P 5250 5650 +F 0 "R7" V 5330 5650 50 0000 C CNN +F 1 "1K" V 5250 5650 50 0000 C CNN +F 2 "Resistors_SMD:R_0603_HandSoldering" V 5180 5650 50 0001 C CNN +F 3 "" H 5250 5650 50 0000 C CNN + 1 5250 5650 + 0 1 1 0 +$EndComp +$EndSCHEMATC diff --git a/KiCad/V_Relay.lib b/KiCad/V_Relay.lib new file mode 100644 index 0000000..3555072 --- /dev/null +++ b/KiCad/V_Relay.lib @@ -0,0 +1,289 @@ +EESchema-LIBRARY Version 2.3 Date: 28/02/2012-23:01:42 +# +# DIL_REED +# +DEF DIL_REED K 0 20 Y Y 1 L N +F0 "K" -325 500 50 H V L C +F1 "DIL_REED" -325 400 50 H V L C +F2 "DIL_REED14" 0 0 50 H I C C +$FPLIST + DIL_REED14 +$ENDFPLIST +DRAW +X ~ 7 100 -300 200 U 50 50 1 0 U +X ~ 14 300 300 200 D 50 50 1 0 U +X ~ 1 100 300 200 D 50 50 1 0 U +X ~ 2 -200 -300 200 U 50 50 1 0 U +X ~ 6 -200 300 250 D 50 50 1 0 U +X ~ 8 300 -300 200 U 50 50 1 0 U +P 2 0 0 8 130 50 200 -100 N +P 2 0 0 8 200 100 200 50 N +P 2 0 0 8 100 100 300 100 N +P 2 0 0 8 100 -100 300 -100 N +S -350 48 -50 -102 0 0 8 N +C 205 25 25 0 0 8 N +ENDDRAW +ENDDEF +# +# DIL_REED_DIODE +# +DEF DIL_REED_DIODE K 0 20 Y Y 1 L N +F0 "K" -400 500 50 H V L C +F1 "DIL_REED_DIODE" -400 400 50 H V L C +F2 "DIL_REED14" 0 0 50 H I C C +$FPLIST + DIL_REED14 +$ENDFPLIST +DRAW +X ~ 7 200 -300 200 U 50 50 1 0 U +X ~ 14 400 300 200 D 50 50 1 0 U +X ~ 1 200 300 200 D 50 50 1 0 U +X ~ 2 -100 -300 200 U 50 50 1 0 U +X ~ 6 -100 300 250 D 50 50 1 0 U +X ~ 8 400 -300 200 U 50 50 1 0 U +P 2 0 0 8 230 50 300 -100 N +P 2 0 0 8 300 100 300 50 N +P 2 0 0 8 -350 100 -350 0 N +P 2 0 0 8 -350 -50 -350 -150 N +P 4 0 0 8 -400 0 -300 0 -350 -50 -400 0 N +P 2 0 0 8 -400 -50 -300 -50 N +P 2 0 0 8 -350 100 -100 100 N +P 2 0 0 8 -350 -150 -100 -150 N +P 2 0 0 8 200 100 400 100 N +P 2 0 0 8 200 -100 400 -100 N +S -250 48 50 -102 0 0 8 N +C 305 25 25 0 0 8 N +ENDDRAW +ENDDEF +# +# DPDT +# +DEF DPDT K 0 20 Y Y 1 L N +F0 "K" -500 475 50 H V L C +F1 "DPDT" -500 375 50 H V L C +F2 "??" 0 0 50 H I C C +$FPLIST + ?? +$ENDFPLIST +DRAW +X ~ 4 0 -250 200 U 50 50 1 0 U +X ~ 3 -100 300 200 D 50 50 1 0 U +X ~ 5 50 300 200 D 50 50 1 0 U +X ~ 1 -350 -250 200 U 50 50 1 0 U +X ~ 2 -350 300 200 D 50 50 1 0 U +X ~ 4 400 -250 200 U 50 50 1 0 U +X ~ 3 300 300 200 D 50 50 1 0 U +X ~ 5 450 300 200 D 50 50 1 0 U +P 2 0 0 8 -70 100 0 -50 N +P 2 0 0 8 330 100 400 -50 N +S -500 100 -200 -50 0 0 8 N +C -95 75 25 0 0 8 N +C 55 75 25 0 0 8 N +C 305 75 25 0 0 8 N +C 455 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# G2E +# +DEF G2E K 0 20 Y Y 1 L N +F0 "K" -350 475 50 H V L C +F1 "G2E" -350 375 50 H V L C +F2 "G2E" 0 0 50 H I C C +$FPLIST + G2E +$ENDFPLIST +DRAW +X ~ 3 100 -250 200 U 50 50 1 0 U +X ~ 1 100 300 200 D 50 50 1 0 U +X ~ 6 300 300 200 D 50 50 1 0 U +X ~ 2 -200 -250 200 U 50 50 1 0 U +X ~ 5 -200 300 200 D 50 50 1 0 U +X ~ 4 300 -250 200 U 50 50 1 0 U +P 2 0 0 8 130 100 208 -48 N +P 2 0 0 8 100 -50 300 -50 N +S -350 100 -50 -50 0 0 8 N +C 105 75 25 0 0 8 N +C 305 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# G5A-234P +# +DEF G5A-234P K 0 20 Y Y 1 L N +F0 "K" -500 475 50 H V L C +F1 "G5A-234P" -500 375 50 H V L C +F2 "G5A-234P" 0 0 50 H I C C +$FPLIST + G5A-234P +$ENDFPLIST +DRAW +X ~ 3 0 -250 200 U 50 50 1 0 U +X ~ 5 -100 300 200 D 50 50 1 0 U +X ~ 6 50 300 200 D 50 50 1 0 U +X ~ 1 -350 -250 200 U 50 50 1 0 U +X ~ 12 -350 300 200 D 50 50 1 0 U +X ~ 10 400 -250 200 U 50 50 1 0 U +X ~ 8 300 300 200 D 50 50 1 0 U +X ~ 7 450 300 200 D 50 50 1 0 U +P 2 0 0 8 -70 100 0 -50 N +P 2 0 0 8 330 100 400 -50 N +S -500 100 -200 -50 0 0 8 N +C -95 75 25 0 0 8 N +C 55 75 25 0 0 8 N +C 305 75 25 0 0 8 N +C 455 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# G5AK-234P +# +DEF G5AK-234P K 0 20 Y Y 1 L N +F0 "K" -500 475 50 H V L C +F1 "G5AK-234P" -500 375 50 H V L C +F2 "G5AK-234P" 0 0 50 H I C C +$FPLIST + G5AK-234P +$ENDFPLIST +DRAW +X ~ 2 0 -250 200 U 50 50 1 0 U +X ~ 5 -100 300 200 D 50 50 1 0 U +X ~ 6 50 300 200 D 50 50 1 0 U +X ~ 1 -350 -250 200 U 50 50 1 0 U +X ~ 12 -350 300 200 D 50 50 1 0 U +X ~ 11 400 -250 200 U 50 50 1 0 U +X ~ 8 300 300 200 D 50 50 1 0 U +X ~ 7 450 300 200 D 50 50 1 0 U +P 2 0 0 8 -70 100 0 -50 N +P 2 0 0 8 330 100 400 -50 N +S -500 100 -200 -50 0 0 8 N +C -95 75 25 0 0 8 N +C 55 75 25 0 0 8 N +C 305 75 25 0 0 8 N +C 455 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# G5V-1 +# +DEF G5V-1 K 0 20 Y Y 1 L N +F0 "K" -350 500 50 H V L C +F1 "G5V-1" -350 400 50 H V L C +F2 "G5V-1" 0 0 50 H I C C +$FPLIST + G5V-1 +$ENDFPLIST +DRAW +X ~ 5 100 -300 200 U 50 50 1 0 U +X ~ 1 100 300 200 D 50 50 1 0 U +X ~ 10 300 300 200 D 50 50 1 0 U +X ~ 2 -200 -300 200 U 50 50 1 0 U +X ~ 9 -200 300 200 D 50 50 1 0 U +X ~ 6 300 -300 200 U 50 50 1 0 U +P 2 0 0 8 200 -100 150 100 N +P 2 0 0 8 100 -100 300 -100 N +S -350 100 -50 -100 0 0 8 N +C 105 75 25 0 0 8 N +C 305 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# G5V-2 +# +DEF G5V-2 K 0 20 Y Y 1 L N +F0 "K" -500 475 50 H V L C +F1 "G5V-2" -500 375 50 H V L C +F2 "G5V-2" 0 0 50 H I C C +$FPLIST + G5V-2 +$ENDFPLIST +DRAW +X ~ 4 0 -250 200 U 50 50 1 0 U +X ~ 6 -100 300 200 D 50 50 1 0 U +X ~ 8 50 300 200 D 50 50 1 0 U +X ~ 1 -350 -250 200 U 50 50 1 0 U +X ~ 16 -350 300 200 D 50 50 1 0 U +X ~ 13 400 -250 200 U 50 50 1 0 U +X ~ 11 300 300 200 D 50 50 1 0 U +X ~ 9 450 300 200 D 50 50 1 0 U +P 2 0 0 8 -70 100 0 -50 N +P 2 0 0 8 330 100 400 -50 N +S -500 100 -200 -50 0 0 8 N +C -95 75 25 0 0 8 N +C 55 75 25 0 0 8 N +C 305 75 25 0 0 8 N +C 455 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# G6A-274P +# +DEF G6A-274P K 0 20 Y Y 1 L N +F0 "K" -500 475 50 H V L C +F1 "G6A-274P" -500 375 50 H V L C +F2 "G5V-2" 0 0 50 H I C C +$FPLIST + G5V-2 +$ENDFPLIST +DRAW +X ~ 4 0 -250 200 U 50 50 1 0 U +X ~ 6 -100 300 200 D 50 50 1 0 U +X ~ 8 50 300 200 D 50 50 1 0 U +X ~ 1 -350 -250 200 U 50 50 1 0 U +X ~ 16 -350 300 200 D 50 50 1 0 U +X ~ 13 400 -250 200 U 50 50 1 0 U +X ~ 11 300 300 200 D 50 50 1 0 U +X ~ 9 450 300 200 D 50 50 1 0 U +P 2 0 0 8 -70 100 0 -50 N +P 2 0 0 8 330 100 400 -50 N +S -500 100 -200 -50 0 0 8 N +C -95 75 25 0 0 8 N +C 55 75 25 0 0 8 N +C 305 75 25 0 0 8 N +C 455 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# SPDT +# +DEF SPDT K 0 20 Y Y 1 L N +F0 "K" -300 475 50 H V L C +F1 "SPDT" -300 375 50 H V L C +F2 "??" 0 0 50 H I C C +$FPLIST + ?? +$ENDFPLIST +DRAW +X ~ 4 200 -250 200 U 50 50 1 0 U +X ~ 3 100 300 200 D 50 50 1 0 U +X ~ 5 250 300 200 D 50 50 1 0 U +X ~ 1 -150 -250 200 U 50 50 1 0 U +X ~ 2 -150 300 200 D 50 50 1 0 U +P 2 0 0 8 130 100 200 -50 N +S -300 100 0 -50 0 0 8 N +C 105 75 25 0 0 8 N +C 255 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +# SPST +# +DEF SPST K 0 20 Y Y 1 L N +F0 "K" -300 475 50 H V L C +F1 "SPST" -300 375 50 H V L C +F2 "??" 0 0 50 H I C C +$FPLIST + ?? +$ENDFPLIST +DRAW +X ~ 4 200 -250 200 U 50 50 1 0 U +X ~ 5 250 300 200 D 50 50 1 0 U +X ~ 1 -150 -250 200 U 50 50 1 0 U +X ~ 2 -150 300 200 D 50 50 1 0 U +P 2 0 0 8 130 100 200 -50 N +S -300 100 0 -50 0 0 8 N +C 255 75 25 0 0 8 N +ENDDRAW +ENDDEF +# +#End Library diff --git a/KiCad/fp-lib-table b/KiCad/fp-lib-table new file mode 100644 index 0000000..abab46f --- /dev/null +++ b/KiCad/fp-lib-table @@ -0,0 +1,3 @@ +(fp_lib_table + (lib (name OmronG5V)(type KiCad)(uri P:\KiCad\Libraries\OmronG5V.pretty)(options "")(descr "")) +) diff --git a/Pi/PiPower.py b/Pi/PiPower.py new file mode 100644 index 0000000..3ca4aa3 --- /dev/null +++ b/Pi/PiPower.py @@ -0,0 +1,39 @@ +#!/usr/bin/python + +# PiPower +# Copyright 2017 (c) Mark van Renswoude +# +# Yet another power supply for the Raspberry Pi. +# Designed to run on an ATTiny85 with a self-locking button. + +import RPi.GPIO as GPIO +import time +import os + +GPIO.setmode(GPIO.BCM) +GPIO.setup(15, GPIO.OUT) +GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) + +hasShutdown = False + + +def shutdownSignal(channel): + print "PiPower: shutting down" + os.system('shutdown -h now') + hasShutdown = true + + +GPIO.add_event_detect(18, GPIO.RISING, callback=shutdownSignal, bouncetime=300) +GPIO.output(15, GPIO.HIGH) + + +try: + print "PiPower: waiting for signal" + + while not hasShutdown: + time.sleep(1) + + print "PiPower: exiting" + GPIO.cleanup() +except KeyboardInterrupt: + GPIO.cleanup() \ No newline at end of file diff --git a/Pi/notes.txt b/Pi/notes.txt new file mode 100644 index 0000000..ae322fb --- /dev/null +++ b/Pi/notes.txt @@ -0,0 +1,36 @@ +WARNING! +The PiPower board is outputting 5V, which can kill your Pi according +to the specs. + +Either add a logic level converter chip or a simple resistor based +voltage divider: + + + 2.2k 3.3k + PiPower signal ---~~~--+--~~~--- GND + | + | + GPIO + +Source: https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=22841 + + + +To install as a service, save pipower.service to /lib/systemd/system/ and execute: + +sudo chmod 644 /lib/systemd/system/pipower.service +sudo systemctl daemon-reload +sudo systemctl enable pipower.service +sudo systemctl start pipower.service + + + +Please check /boot/config.txt for a line defining enable_uart. +If this is set to 0, change it to 1! If not defined, add it just +to be sure: + +enable_uart=1 + +I have encountered this default of 0 in RetroPie, but I've seen +reports for a standard installation as well: +https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=141195 \ No newline at end of file diff --git a/Pi/pipower.service b/Pi/pipower.service new file mode 100644 index 0000000..cd86e8f --- /dev/null +++ b/Pi/pipower.service @@ -0,0 +1,17 @@ +# PiPower +# Copyright 2017 (c) Mark van Renswoude +# +# Yet another power supply for the Raspberry Pi. +# Designed to run on an ATTiny85 with a self-locking button. + +[Unit] +Description=PiPower +After=multi-user.target + +[Service] +Type=simple +ExecStart=/usr/bin/python /home/pi/pipower.py +Restart=on-abort + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/PiPower.ino b/PiPower.ino new file mode 100644 index 0000000..629289e --- /dev/null +++ b/PiPower.ino @@ -0,0 +1,442 @@ +/* + * PiPower + * Copyright 2017 (c) Mark van Renswoude + * + * Yet another power supply for the Raspberry Pi. + * Designed to run on an ATTiny85 with a self-locking button. + * + * + * + * Known "bug": if you turn the power button back on while it's shutting + * down, it may not power cycle the Pi as it'll only turn the relay off + * for the length of the button debounce time. Since there is a simple + * workaround (turn the button off, wait a few seconds and turn it back + * on again) I didn't bother to add the logic for this situation. + */ +#include + + +/* + * Configuration + */ +// The button needs to be on a pin that supports interrupts +const uint8_t PinButton = 0; +const uint8_t PinButtonInterrupt = PCINT0; + +// The LED needs to be on a pin that supports PWM +const uint8_t PinLED = 1; + +// These just need digital I/O +const uint8_t PinRelay = 2; +const uint8_t PinShutdown = 3; +const uint8_t PinPiState = 4; + + +// The debounce time used to filter button noise +const unsigned long ButtonDebounceTime = 300; + +// How long to wait for a signal from the Pi before alerting the user +const unsigned long BootProblemTime = 5000; + +// How long to wait after the Pi signal turns off to turn off the power, to prevent false positives during a reboot +const unsigned long PowerOffTime = 5000; + + +// How long the LED stays on or off during blinking +const unsigned long LEDBlinkTime = 750; + +// How long it takes to fade from on to off or back +const unsigned long LEDFadeTime = 750; + + + +enum LEDState +{ + Off, + On, + Blinking, + Fading +}; + +struct ButtonState +{ + bool pressed; + bool debouncing; +}; + +typedef void (* StateHandler) (); + + +// Forward declarations +void gotoStateIdle(); +void gotoStateBoot(); +void gotoStateBootProblem(); +void gotoStateShutdown(); + +ButtonState getButtonState(); +void checkPiShutdown(); +inline void checkLEDAnimation(); + +inline LEDState getLEDState(); +void setLEDState(LEDState newState); +void setRelayState(uint8_t newState); +void setShutdownState(uint8_t newState); + + +// State variables +StateHandler currentState; +unsigned long currentTime; + + +void setup() +{ + pinMode(PinLED, OUTPUT); + pinMode(PinRelay, OUTPUT); + pinMode(PinShutdown, OUTPUT); + pinMode(PinPiState, INPUT); + + digitalWrite(PinLED, LOW); + digitalWrite(PinRelay, LOW); + digitalWrite(PinShutdown, LOW); + + gotoStateIdle(); + + // Blink two times to indicate we've got power + digitalWrite(PinLED, HIGH); delay(250); digitalWrite(PinLED, LOW); delay(250); + digitalWrite(PinLED, HIGH); delay(250); digitalWrite(PinLED, LOW); delay(250); +} + + +void loop() +{ + currentTime = millis(); + currentState(); + + checkLEDAnimation(); +} + + +/* + * Idle + * + * Power button is not pressed, no power going to the Pi. + * + * LED: Off + * Relay: Off + * Shutdown signal: Off + */ +void stateIdle() +{ + ButtonState buttonState = getButtonState(); + + if (buttonState.pressed) + { + gotoStateBoot(); + } + else if (!buttonState.debouncing) + { + // Go into sleep mode until the button interrupt wakes us up again + sleep(); + } +} + +void gotoStateIdle() +{ + setLEDState(Off); + setRelayState(LOW); + setShutdownState(LOW); + + currentState = stateIdle; +} + + +/* + * Boot + * + * Power going to the Pi, waiting for confirmation. + * + * LED: On + * Relay: On + * Shutdown signal: Off + */ +unsigned long bootStart; + +void stateBoot() +{ + if (digitalRead(PinPiState) == HIGH) + gotoStateOn(); + else if (currentTime - bootStart >= BootProblemTime) + gotoStateBootProblem(); +} + +void gotoStateBoot() +{ + setLEDState(On); + setRelayState(HIGH); + setShutdownState(LOW); + + bootStart = currentTime; + currentState = stateBoot; +} + + +/* + * Boot problem + * + * No confirmation of a succesful boot within the timeout, + * alert the user. + * + * LED: Blinking + * Relay: On + * Shutdown signal: Off + */ +void stateBootProblem() +{ + if (digitalRead(PinPiState) == HIGH) + gotoStateOn(); + else + { + ButtonState buttonState = getButtonState(); + if (!buttonState.pressed) + gotoStateIdle(); + } +} + +void gotoStateBootProblem() +{ + setLEDState(Blinking); + setRelayState(HIGH); + setShutdownState(LOW); + + currentState = stateBootProblem; +} + + + +/* + * On + * + * Pi is running. + * + * LED: On + * Relay: On + * Shutdown signal: Off + */ +void stateOn() +{ + ButtonState buttonState = getButtonState(); + if (!buttonState.pressed) + gotoStateShutdown(); + + checkPiShutdown(); +} + +void gotoStateOn() +{ + setLEDState(On); + setRelayState(HIGH); + setShutdownState(LOW); + + currentState = stateOn; +} + + + +/* + * Shutdown + * + * Signal to the Pi that a shutdown is requested. + * + * LED: Fading + * Relay: On + * Shutdown signal: On + */ +void stateShutdown() +{ + checkPiShutdown(); +} + +void gotoStateShutdown() +{ + setLEDState(Fading); + setRelayState(HIGH); + setShutdownState(HIGH); + + currentState = stateShutdown; +} + + + +/* + * Helpers + */ +// https://bigdanzblog.wordpress.com/2014/08/10/attiny85-wake-from-sleep-on-pin-state-change-code-example/ +void sleep() +{ + GIMSK |= _BV(PCIE); // Enable Pin Change Interrupts + PCMSK |= _BV(PinButtonInterrupt); // Use button as interrupt pin + ADCSRA &= ~_BV(ADEN); // ADC off + set_sleep_mode(SLEEP_MODE_PWR_DOWN); // Replaces above statement + + sleep_enable(); // Sets the Sleep Enable bit in the MCUCR Register (SE BIT) + sei(); // Enable interrupts + sleep_cpu(); // Sleep + + cli(); // Disable interrupts + PCMSK &= ~_BV(PinButtonInterrupt); // Turn off button as interrupt pin + sleep_disable(); // Clear SE bit + ADCSRA |= _BV(ADEN); // ADC on + + sei(); // Enable interrupts +} + +ISR(PCINT0_vect) +{ + // This is called when the interrupt occurs, but I don't need to do anything in it +} + + + +uint8_t debouncedButtonState = LOW; +uint8_t lastButtonState = LOW; +unsigned long lastButtonChange = 0; + +ButtonState getButtonState() +{ + ButtonState state; + uint8_t currentButtonState = digitalRead(PinButton); + + if (currentButtonState != lastButtonState) + { + lastButtonState = currentButtonState; + lastButtonChange = currentTime; + } + + if (currentTime - lastButtonChange >= ButtonDebounceTime) + { + if (currentButtonState != debouncedButtonState) + debouncedButtonState = currentButtonState; + + state.debouncing = false; + } + else + state.debouncing = true; + + state.pressed = (debouncedButtonState == HIGH); + return state; +} + + +bool shutdownDetected = false; +unsigned long shutdownStart; + +void checkPiShutdown() +{ + if (digitalRead(PinPiState) == LOW) + { + if (shutdownDetected) + { + if (currentTime - shutdownStart >= PowerOffTime) + gotoStateIdle(); + } + else + { + shutdownStart = currentTime; + shutdownDetected = true; + } + } + else + shutdownDetected = false; +} + + +LEDState ledState = Off; +unsigned long ledLastAnimation; +bool ledAnimationOn; + +inline LEDState getLEDState() +{ + return ledState; +} + +void setLEDState(LEDState newState) +{ + if (newState == ledState) + return; + + switch(newState) + { + case Off: + digitalWrite(PinLED, LOW); + break; + + case On: + digitalWrite(PinLED, HIGH); + break; + + default: + ledLastAnimation = currentTime; + ledAnimationOn = true; + break; + } + ledState = newState; +} + + +inline void checkLEDAnimation() +{ + switch(getLEDState()) + { + case Blinking: + if (currentTime - ledLastAnimation >= LEDBlinkTime) + { + ledAnimationOn = !ledAnimationOn; + ledLastAnimation = currentTime; + } + + digitalWrite(PinLED, ledAnimationOn ? HIGH : LOW); + break; + + case Fading: + unsigned long elapsedTime = currentTime - ledLastAnimation; + while (elapsedTime >= LEDFadeTime) + { + ledAnimationOn = !ledAnimationOn; + ledLastAnimation = currentTime; + + elapsedTime -= LEDFadeTime; + } + + byte currentStep = (byte)((elapsedTime * 255) / LEDFadeTime); + if (!ledAnimationOn) + currentStep = 255 - currentStep; + + analogWrite(PinLED, currentStep); + break; + } +} + + +uint8_t relayState = LOW; + +void setRelayState(uint8_t newState) +{ + if (newState == relayState) + return; + + digitalWrite(PinRelay, newState); + relayState = newState; +} + + +uint8_t shutdownState = LOW; + +void setShutdownState(uint8_t newState) +{ + if (newState == shutdownState) + return; + + digitalWrite(PinShutdown, newState); + shutdownState = newState; +} +