electro/transistor-stage0.html
2026-08-24 14:09:36 -04:00

153 lines
7.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<title>Transistor Stage 0, One Zone</title>
<style>
:root{
--bg:#faf8f4; --ink:#1c1a17; --muted:#6b6459; --card:#fff;
--line:#3a352e; --red:#c0392b; --grn:#2e7d32; --slate:#5b6b7a;
--amber:#c98a1a; --rule:#d8d2c7;
}
@media (prefers-color-scheme:dark){
:root{ --bg:#17150f; --ink:#eee7d9; --muted:#a49a88; --card:#211e17;
--line:#c9c2b4; --red:#e5675a; --grn:#6bbf70; --slate:#8fa3b5;
--amber:#e0b24e; --rule:#3a352b; }
}
:root[data-theme=light]{ --bg:#faf8f4;--ink:#1c1a17;--muted:#6b6459;--card:#fff;
--line:#3a352e;--red:#c0392b;--grn:#2e7d32;--slate:#5b6b7a;--amber:#c98a1a;--rule:#d8d2c7; }
:root[data-theme=dark]{ --bg:#17150f;--ink:#eee7d9;--muted:#a49a88;--card:#211e17;
--line:#c9c2b4;--red:#e5675a;--grn:#6bbf70;--slate:#8fa3b5;--amber:#e0b24e;--rule:#3a352b; }
body{background:var(--bg);color:var(--ink);
font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
margin:0;padding:24px;}
.wrap{max-width:860px;margin:0 auto;}
h1{font-size:20px;margin:0 0 2px;}
.sub{color:var(--muted);margin:0 0 18px;font-size:13px;}
.card{background:var(--card);border:1px solid var(--rule);border-radius:12px;
padding:16px;margin-bottom:18px;}
.scroll{overflow-x:auto;}
svg{display:block;margin:0 auto;max-width:100%;height:auto;}
text{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;fill:var(--ink);}
.lbl{font-size:13px;} .sm{font-size:11px;fill:var(--muted);}
.wire{stroke:var(--line);stroke-width:2.2;fill:none;}
.w5{stroke:var(--red);stroke-width:3;fill:none;}
.wg{stroke:var(--line);stroke-width:3;fill:none;}
.wsig{stroke:var(--slate);stroke-width:2.2;fill:none;stroke-dasharray:6 4;}
.node{fill:var(--line);}
.box{fill:none;stroke:var(--line);stroke-width:2;}
.chip{fill:var(--card);stroke:var(--line);stroke-width:2;}
table{border-collapse:collapse;width:100%;font-size:13px;margin-top:4px;}
th,td{border:1px solid var(--rule);padding:6px 10px;text-align:left;}
th{background:rgba(128,128,128,.08);}
code{font-family:ui-monospace,Menlo,monospace;background:rgba(128,128,128,.12);
padding:1px 5px;border-radius:4px;font-size:.92em;}
.key{display:flex;gap:18px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-top:8px;}
.key span{display:inline-flex;align-items:center;gap:6px;}
.sw{width:22px;height:0;border-top:3px solid;}
</style>
<div class="wrap">
<h1>Transistor Stage 0, one zone (GF / D3)</h1>
<p class="sub">PN2222 low-side switch · clone ×4 for the other pins · Arduino Uno R3</p>
<div class="card scroll">
<svg viewBox="0 0 780 440" role="img" aria-label="One-zone transistor LED driver schematic">
<!-- +5V rail -->
<line class="w5" x1="150" y1="40" x2="720" y2="40"/>
<text class="lbl" x="150" y="30" fill="var(--red)">+5V rail</text>
<!-- GND rail -->
<line class="wg" x1="150" y1="400" x2="720" y2="400"/>
<text class="lbl" x="150" y="422">GND rail</text>
<!-- Arduino block -->
<rect class="box" x="30" y="120" width="90" height="200" rx="8"/>
<text class="lbl" x="52" y="112">Uno</text>
<!-- pins -->
<text class="lbl" x="46" y="150">5V</text>
<line class="w5" x1="120" y1="145" x2="150" y2="145"/>
<line class="w5" x1="150" y1="145" x2="150" y2="40"/>
<circle class="node" cx="150" cy="40" r="3.5"/>
<text class="lbl" x="46" y="205">D3</text>
<line class="wsig" x1="120" y1="200" x2="300" y2="200"/>
<text class="lbl" x="46" y="265">D2</text>
<line class="wire" x1="120" y1="260" x2="600" y2="260"/>
<text class="lbl" x="40" y="315">GND</text>
<line class="wg" x1="120" y1="310" x2="150" y2="310"/>
<line class="wg" x1="150" y1="310" x2="150" y2="400"/>
<circle class="node" cx="150" cy="400" r="3.5"/>
<!-- 1k base resistor along D3 line -->
<rect class="chip" x="300" y="190" width="60" height="20" rx="4"/>
<text class="sm" x="308" y="204">1kΩ</text>
<line class="wsig" x1="360" y1="200" x2="470" y2="200"/>
<!-- PN2222 -->
<circle class="chip" cx="510" cy="200" r="34"/>
<text class="lbl" x="486" y="205">Q1</text>
<text class="sm" x="470" y="250">PN2222</text>
<!-- base lead -->
<line class="wire" x1="470" y1="200" x2="476" y2="200"/>
<text class="sm" x="452" y="188">B</text>
<!-- collector up -->
<line class="wire" x1="510" y1="166" x2="510" y2="120"/>
<text class="sm" x="518" y="150">C</text>
<!-- emitter down to GND -->
<line class="wg" x1="510" y1="234" x2="510" y2="400"/>
<text class="sm" x="518" y="255">E → GND</text>
<circle class="node" cx="510" cy="400" r="3.5"/>
<!-- LED + 220 from +5V down to collector -->
<!-- from +5V rail down -->
<line class="w5" x1="620" y1="40" x2="620" y2="70"/>
<circle class="node" cx="620" cy="40" r="3.5"/>
<!-- LED symbol (triangle + bar) -->
<polygon points="606,70 634,70 620,96" fill="none" stroke="var(--amber)" stroke-width="2"/>
<line x1="606" y1="96" x2="634" y2="96" stroke="var(--amber)" stroke-width="2.5"/>
<text class="sm" x="640" y="86" fill="var(--amber)">LED</text>
<text class="sm" x="640" y="99">warm white</text>
<text class="sm" x="560" y="66">anode +</text>
<line class="wire" x1="620" y1="96" x2="620" y2="112"/>
<!-- 220 resistor -->
<rect class="chip" x="590" y="112" width="60" height="20" rx="4"/>
<text class="sm" x="596" y="126">220Ω</text>
<!-- down to collector node -->
<line class="wire" x1="620" y1="132" x2="620" y2="120"/>
<line class="wire" x1="620" y1="120" x2="510" y2="120"/>
<circle class="node" cx="510" cy="120" r="3.5"/>
<!-- button on D2 to GND -->
<line class="wire" x1="600" y1="260" x2="600" y2="300"/>
<rect class="box" x="580" y="300" width="40" height="26" rx="4"/>
<text class="sm" x="588" y="317">BTN</text>
<line class="wg" x1="600" y1="326" x2="600" y2="400"/>
<circle class="node" cx="600" cy="400" r="3.5"/>
<text class="sm" x="628" y="285">D2 → button → GND</text>
<!-- current path note -->
<text class="sm" x="150" y="60">current: +5V → LED → 220Ω → collector → (Q1) → emitter → GND</text>
</svg>
<div class="key">
<span><span class="sw" style="border-color:var(--red)"></span>+5V</span>
<span><span class="sw" style="border-color:var(--line)"></span>GND / wire</span>
<span><span class="sw" style="border-color:var(--slate);border-top-style:dashed"></span>signal (PWM)</span>
<span><span class="sw" style="border-color:var(--amber)"></span>LED</span>
</div>
</div>
<div class="card">
<strong>Then clone the transistor block ×4</strong>, same wiring, just change the Arduino pin:
<table>
<tr><th>Zone</th><th>Arduino pin → 1kΩ → base</th><th>Fixtures</th></tr>
<tr><td>GF_INT</td><td><code>D3</code></td><td>living + kitchen ceilings</td></tr>
<tr><td>UP_INT</td><td><code>D5</code></td><td>bedrooms + attic</td></tr>
<tr><td>EXT</td><td><code>D6</code></td><td>porch, entry, deck, balcony</td></tr>
<tr><td>FIRE</td><td><code>D9</code></td><td>hearth (flicker)</td></tr>
</table>
<p class="sm" style="margin:10px 0 0">Each zone shares the same <code>+5V</code> and <code>GND</code> rails.
Add more LEDs to a zone by putting each one (anode→+5V, cathode→220Ω→collector) in parallel on that transistor.</p>
</div>
<div class="card">
<strong>PN2222 leg order</strong>, flat face toward you, legs down: <code>E · B · C</code> (left→right).
If nothing lights, swap E↔C, that's the usual culprit and it's harmless.
</div>
</div>