<p><img src="content/pic/closeup_onswich.jpg" width="538" height="437" align="right">Switch on your pc when power applied, not by pushing a button. Originally designed for EPIA MS8000 Mini ITX motherboard, this baby will switch your pc on when eve it gets power.</p>
<h3>Description:</h3>
<p>A replacement for the momentary action switch on the front of a of a PC this detects the power being restored to the PC waits a second and a half and then pops the power switch automatically. Great for home built servers that you want to turn on when power is restored. Or in out case when its in a Waterproof box up a tree in Glastonbury.</p>
<h3>PARTS:</h3>
<ul>
  <li>Strip board</li>
  <li>CMOS Quad NAND gate Chip (4011)</li>
  <li>2.2&mu;F Capacitor</li>
  <li>4.7&mu;F Capacitor</li>
  <li>1M&Omega; 0.25W Resistor</li>
  <li>560k&Omega; 0.25W Resistor </li>
  <li>4.7k&Omega; 0.25W Resistor</li>
  <li>BC549B NPN Transistor (or similar)</li>
  <li>1 Reset/Pwr Switch case wire.</li>
  <li>1 case speaker wire.</li>
  <li>Couple of bits of wire (single strand insulated for preference)</li>
  <li>Self Adhesive PCB mount (optional) </li>
</ul>
<p align="center"><img src="content/pic/circuit_onSwich.png" width="508" height="250" border="1"><br>
  Circuit Diagram</p>
<h3 align="left">How it Works: </h3>
<p align="left">The Resistors on the left charge the capacitors up. When the capacitors get above 2.5 volts the NAND gate's detect their inputs going from low to high. The left hand NAND above is configured as a NOT gate, so when power is applied to the circuit its inputs are low and its output high. The Middle NAND gate is receiving at startup a low from its resistor capacitor and and a high from the left hand NAND. After about 1.5 seconds the right hand capacitor has reached 2.5 volts, turning the middle NAND gates inputs to HIGH and HIGH, as the left hand capacitor takes longer to reach 2.5 volts. The left hand capacitor takes about .25 seconds longer to reach 2.5 volts, when it does the middle NAND goes back to HIGH low. IF we look at the truth table for a NAND (Not And) gate:</p>
<table width="100%"  border="1" cellspacing="0" cellpadding="2">
  <tr bgcolor="#000000">
    <th scope="col"><div align="center">Input 1 </div></th>
    <th scope="col"><div align="center">Input 2 </div></th>
    <th scope="col"><div align="center">output</div></th>
  </tr>
  <tr>
    <td><div align="center">0</div></td>
    <td><div align="center">0</div></td>
    <td bgcolor="#9900CC"><div align="center">1</div></td>
  </tr>
  <tr>
    <td><div align="center">0</div></td>
    <td><div align="center">1</div></td>
    <td bgcolor="#9900CC"><div align="center">1</div></td>
  </tr>
  <tr>
    <td><div align="center">1</div></td>
    <td><div align="center">0</div></td>
    <td bgcolor="#9900CC"><div align="center">1</div></td>
  </tr>
  <tr>
    <td><div align="center">1</div></td>
    <td><div align="center">1</div></td>
    <td bgcolor="#9900CC"><div align="center">0</div></td>
  </tr>
</table>
<p align="left"><img src="content/pic/trace_onswich.png" width="496" height="318" border="1" align="right">We can see that a NAND gives out a low, only when BOTH its inputs are high. In this case that only occurs when one capacitor has reached 2.5 volts and the other has not. This gives us the wait for 1.5 then switch the pc on, nut don't hold the button in signal we want. Unfortunately its the wrong way up. On power up the middle nand gives out high for 1.5 seconds, then low for a quarter second then goes high again. To drive the transistor on the right we want he opposite, so we use another NAND with its inputs hooked together to make a NOT gate. The 4.7k resistor is to limit the current into the base of the transistor. The Image shown on the right is a dual trace PC oscilloscope. the Lower, red, trace is the power supply coming in. The green trace the output to the transistor switch on the right, which is connected to the switch header of the PC. </p>
<h3 align="left">Connections</h3>
<p align="left">On the Mini ITX boards we're using, the keyboard and mouse header has the ITX always on power supplied to it. We use pins 2 and six, because their easy to spot, separated as they are by the blank key slot. We use an old PC case speaker connector, with the pins moved from 1 and 4 to one and 3. If you want you can cut off the extra slot too, if it makes you feel better. </p>
<p align="center"><img src="content/pic/swich_kb_header.png" width="550" height="494" border="1"><br>
  EPIA MS8000 mother board Keyboard/Mouse header used as power supply.</p>
<p align="left">If your running this off another type of motherboard you'll need to find your own source of always on 5 volts.</p>
<p align="left">The on switch is easier, all you need to do is plug the thing in instead of the switch NOTE, I'm not sure abut this but I think the current has to flow the right way through the transistor. The +ve side of the switch there for, needs to be attached to the COLECTOR, top of my circuit diagram, emitter, the one with the little arrow on the bottom of my circuit diagram to ground. Pins 6 and 8 respectively:</p>
<p align="center"><img src="content/pic/swich_pw_header.png" width="749" height="606" border="1"> <br>
  EPIA MS8000 Power Switch Header</p>
<h3>Construction</h3>
<p>Well that's relatively easy, I'll add the strip board layout when I have time to draw it on a PC. The only things you really need to look out for are:</p>
<ul>
  <li>Capacitors are POLORISED, that means they need to be connected the right way round, the negative leg is marked by a strip with &quot;-&quot; on it on the case.</li>
  <li>Chips need power, these are customarily left out of the circuit diagram for clarity, as they are in this case. Pin 14 needs +5 volts and pin 7 0 volts.</li>
  <li>Transistors have different pinnouts, make sure you get yours with the resistor on the base, and the outputs on the collector and emitter.</li>
</ul>