I'm making a simple microcontroller based circuit to turn on a computer when certain events are triggered. I am interfacing it using the PCs soft power switch pins on the front panel header:
There are two relevant pins on this header, I'll call them
SW- shares the PCs system ground, though I'm not sure this is always the case.
SW+ is, in my test system, 3.3v above ground, although I suspect this could be more or less.
In a typical computer, a NO momentary switch on the front panel shorts these two pins when the power button is pressed. I want this to instead be controlled based on a logic level signal from a microcontroller.
My first attempt at a test circuit is as follows:
I tested the polarity of my header and made sure
SW+ really was the positive pin. My microcontroller was powered from USB, therefore sharing system ground, so connecting
SW- and controller ground was not a problem.
The circuit worked as intended, but it's obviously not very great. I want to make this circuit as universal (not system dependent) as possible. This poses the following problems:
- The polarity is not indicated - the user can not be relied on to insure a specific polarity.
- The voltage is not exactly known - it's better to assume it will be somewhere between 2-12v.
- The controller should be isolated - it might share the computer's ground, but this is not guaranteed.
The simplest solution that comes to mind is using a relay. I may end up doing this, but I really would like to avoid it due to reliability, size and price.
Is there any transistor based solution (essentially like a relay) meeting the criteria above?