Using ESP8266 as a WiFi switch while still having the mechanical button function

I'll not worried about the code for this project as much as the wiring. I would like to use an NPN transistor to short the power switch pins on my motherboard. I plan to do this by having the GPI0 attached to the mechanical switch, completing GPI0's circuit. I will have GPI2 connected to the base of the transistor, while having the collector and emitter of the transistor connected to the + and - pins of the motherboard's power switch.

GPI0 will be configured as an input.
GPI2 will be configured as an output
.
I plan to have a webpage that I activate a button using Siri's Javascript feature.

I posted here to get help on wiring because I am extremely new to the world of Arduinos, and this is my first permanent project. Therefore:

Any tips for more efficient wiring or if there are any problems with my wiring would be extremely appreciated.
I've read that motherboards send and receive at the 3.3V logic level, but if this is wrong, please correct me
If it's necessary, my motherboard is a GA-Z97X-SLI

I edited the post to correct the resistance of R1 as pointed out by Paul__B
I also removed my original image, and replaced it.

PC Power SW Schematic.png
Where is the base resistor for the 2N222?

Why is R1 so low? (100 Ohms in original) It will probably work, but ...

I apologize for my carelessness. R1 is supposed to be 10K Ohms. About the base resistor, I’m not very familiar with the application of transistors. Could you recommend a certain amount of resistance? Anything that you could correct me on would be greatly appreciated

Hi
If your goal is just turn on your computer remotely maybe the wake in lan feature of your motherboard network card could do it.

In order for this circuit to work, the computer button must actually be connecting to ground which I suspect it usually does (but being in the middle of the night, I am not going to pull anything apart to investigate).

This means the transistor emitter will be grounded. The base-emitter junction is a diode, it will hold the base voltage to about 0.7 V. If you try to connect an ESP output pin to that it will be overloaded. You need a resistor in series with the base to control the current fed to the transistor to a reasonable amount. 1k would be an excellent guess.

Transistors - "BJT"s - are current amplifiers.

hugo007:
Hi
If your goal is just turn on your computer remotely maybe the wake in lan feature of your motherboard network card could do it.

I attempted this in the past, but I’m mostly doing this project as a fun way to learn more about electronics. The sole purpose isn’t just to be able to turn my computer on from anywhere, but a fun and customizable way to do this. Also in the past wake on lan hasn’t been reliable, and I plan to use my computer as a stream PC since my laptop will not be capable of running the SolidWorks renderings well. Thanks for the idea though!

Paul__B:
In order for this circuit to work, the computer button must actually be connecting to ground which I suspect it usually does (but being in the middle of the night, I am not going to pull anything apart to investigate).

This means the transistor emitter will be grounded. The base-emitter junction is a diode, it will hold the base voltage to about 0.7 V. If you try to connect an ESP output pin to that it will be overloaded. You need a resistor in series with the base to control the current fed to the transistor to a reasonable amount. 1k would be an excellent guess.

Transistors - "BJT"s - are current amplifiers.

Screen Shot 2019-03-20 at 1.46.47 PM.png
Thank you for your input I will see about adding that 1K resistor. Just to make sure, I don't think I mentioned this before: The motherboard sends out a 3.3V signal voltage out and all that the button does is connect this circuit together.

For clarity I included a basic sketch of the button's circuit

Is there any component I could find or any circuit I could make that could have this action performed by a micro controller at all?
Thanks!

Screen Shot 2019-03-20 at 1.46.47 PM.png

Heckzagon:
Screen Shot 2019-03-20 at 1.46.47 PM.png
Just to make sure, I don't think I mentioned this before: The motherboard sends out a 3.3V signal voltage out and all that the button does is connect this circuit together.

Well, "sends out a 3.3V signal voltage" is not really an adequate description. I take it that you have measured that when the button is not pressed, the voltage across the terminals is in fact, 3.3 V.

Heckzagon:
For clarity I included a basic sketch of the button's circuit

Yes, that is pretty basic. Full marks for using www.circuitlab.com.

What you need to know is that the "SW-" is in fact, ground; the same as the black wires on the power supply or indeed, the USB negative and that the "SW+" is 3.3 V positive to this. If the voltages are different relative to ground, you have an entirely different problem.

On second thoughts, it is more to the point that while you press the button, "SW+" goes down to ground and "SW-" is not pulled up to 3.3 V, but that is rather unlikely. That is what you need to check as well.

Heckzagon:
Is there any component I could find or any circuit I could make that could have this action performed by a micro controller at all?

Is this not exactly what you are describing here? :roll_eyes:

Paul__B:
Well, "sends out a 3.3V signal voltage" is not really an adequate description. I take it that you have measured that when the button is not pressed, the voltage across the terminals is in fact, 3.3 V.
Yes, that is pretty basic. Full marks for using www.circuitlab.com.

What you need to know is that the "SW-" is in fact, ground; the same as the black wires on the power supply or indeed, the USB negative and that the "SW+" is 3.3 V positive to this. If the voltages are different relative to ground, you have an entirely different problem.

On second thoughts, it is more to the point that while you press the button, "SW+" goes down to ground and "SW-" is not pulled up to 3.3 V, but that is rather unlikely. That is what you need to check as well.
Is this not exactly what you are describing here? :roll_eyes:

Okay so I tried out my circuit, putting an LED in place of the motherboard with a 220 Ohm resistor. At this point I'm confused. I programmed an Arduino to accept button input and output a signal to the base of a transistor. I used a LMS11173v3 to bring the signal voltage down to 3.3V. The circuit successfully sent a HIGH and LOW signal to the LED when the button was pressed, but there was a weak glow of the LED when the button was not pressed, so I feel that when I hook it up to my motherboard, it will constantly activate the power switch.

I attempted measuring the current going into the LED by using a multimeter, but couldn't get a reading.

I feel as I may be using the multimeter wrong. I plugged the black wire into common and the red into the slot labeled: 10A max. Then, I turned the knob on the multimeter to all of the different Amp measuring options, but didn't get a result on any. I touched the black wire prong to the resistor leg leading to the LED, and the positive lead to the positive leg of the LED.

I noticed during this as my finger acciedentally touched the transistor, that is was extremely hot. the voltage across the transistor is definately 3.3V.

Thanks for the help, especially since I'm just a beginner

Unfortunately, your description gives us no idea of what you connected to what. It seems pretty clear that you did something wrong, but without the necessary diagram, we may never know. :roll_eyes:

Alright, so I took some time to learn more about transistors and I my circuit was finally successful.

After correcting the circuit, I pulled out an old computer to test it out. The button was integrated to the motherboard, but I just touched both of the wires in my circuit labeled “Motherboard Switch” to the solder points under the button portruding out of the bottom of the motherboard. I’m not sure which is which, but there were two different results. When I connected the wires to each side of the button’s solder points the first time, it gave a constant signal on, but when I switched the two leads, The switch was activated by my transistor’s switch function. Once my motherboard comes back from repairs, I’ll give an update on which lead of the wires goes on each lead of the motherboard.

Next I will make it a permanent circuit by moving the voltage regulator to convert USB voltage to 3V3 voltage for the ESP8266. After, I will start on the programming portion. Thanks for all the help everyone, especially Paul__B. If there’s anyway I can help you get more karma or rate your help, I’d be happy to.

Also on an added note, I couldn’t find anything anywhere giving the current that goes through a motherboard switch. For the particular motherboard I tested with, it was 0.4 mA. I combined 3 10 Ohm resistors to create a reisistance of 30 Ohms, bringing the amperage on the lead I attached to the button pins down to 0.3-0.5 mA. I don’t know if this is necessary, but just in case, I included it. Thanks everyone!

That circuit is just so wrong in so many ways that I am for the moment lost for words! :astonished:

I can't face it. Someone else can have a go! :grinning:

Paul__B:
That circuit is just so wrong in so many ways that I am for the moment lost for words! :astonished:

I can't face it. Someone else can have a go! :grinning:

As much as i appreciated these very helpful replies, I eventally figured out that I'd have to buy a relay. I did this and the circuit now only includes a basic button as an input, and the solid state relay as an output.
Edit: no transistor was used. just direct signal pin to relay wiring
@Paul__B thanks for nothing

Heckzagon:
@Paul__B thanks for nothing

That's OK.

I just found it exasperating when you started adding multiple random pieces to the mix. :roll_eyes: