PC power through Blynk

Hello. Today I came up with the idea to power my pc through blynk. I tought I’d do this by connecting my nodemcus pins directly to the power pins in my motherboard, where the original power button was initially plugged in. Ok, so I unplugged the power button and plugged the nodemcu with the d1 and gnd pins, and as soon as I plugged the pin in the mcu my PC turned on, then turned off after about 2-3 seconds, as if I held down the power button. I tried using the D0 pin to get a led feedback and as soon as I connected the cables the same thing happened. If I switched the pin value in the app back and forth, the built in led would stay on and would only get brighter when its value is 1. I abandoned the project after another few tries but, when I plugged the original power button back I realised the PC wouldn’t turn on anymore. I’ve unplugged the PC’s power and as soon as I’ve plugged it in the PC turned on, then off after 2-3 seconds. Long story short I can’t turn on my PC anymore. Does anyone know why this is happening? And what was the problem with the nodemcu not being able to set the signal to 0? I should also mention that the motherboard’s power button doesn’t work either. Sorry for being kind of offtopic. Thank you

The power button on a modern PC is simply a momentary push button switch, which shorts together the contacts for the duration that the button is pressed.
A short press turns the PC on, and a long press (around 3 seconds) turns it off.

Your NodeMCU is wither setting pin D0 LOW (connected to GND, so simulating the button on the PC being held down) or HIGH (+ 3.3v, which is something the PC isn’t expecting).

When you connected the NodeMCU it had D0 and GND shorted out so it turned the PC on, but as it remained connected it shut the PC down again because it was simulating a long press.
Once you turned D0 to HIGH then all bets were off about how the PC would respond to having 3.3v injected into a pin that wasn’t designed to take that voltage. It sounds like you’ve killed the motherboard, but I should check that the original power switch isn’t jammed in, or that you haven’t reconnected it back up incorrectly.
The easiest way to check is to disconnect the switch and power-up your PC. If all is well then nothing will happen, and shorting-out the switch contacts with something like a small screwdriver blade, for just a moment, should cause the PC to boot. Good luck!

The correct way to do this is to use a relay with normally open contacts to your PC switch terminals. Use the NodeMCU to actuate the relay for a short time (100ms maybe) to turn the PC on. I wouldn’t turn the PC off with the switch, it’s better to do it via the O/S, but if you do need to turn it off with the NodeMCU then actuating the relay for around 3-5 seconds will do the trick.

Pete.

@PeteKnight I used a multimeter at the power pins, it beeps but the pc doesn’t but. I’m sure the pins ae connected properly. I still hope the mitherboard isn’t dead. Why would it still boot after pluggin in the PC?

I don’t understand this statement.

Pete.

@PeteKnight haha sorry, I’m on my phone. The multimeter beeps but the pc doesn’t boot. Also tried with a screwdriver as you suggested, still no result.

To a degree it depends on the multimeter, but if it’s a good quality one then it shouldn’t beep when used to test the continuity across the pier pins of your PC.

These pins should be open circuit, until closed by the switch.
Your meter is telling you that the pins are now shorted by default, so when you apply power to the motherboard it will power-up then go to sleep after 3 seconds.

You’ve killed your motherboard by applying 3.3v across the power pins.

Pete.

Exactly what I didn’t want to hear :frowning_face: maybe next time I’ll do a little more research before I screw things up

Thanks for your help!

@PeteKnight forgot to ask earlier, but is 3.3v really enough to kill the motherboard? I digged around a little bit and a few people say 3.3 to 5v would be ok

Well, what you’ve described is a situation where the power switch pins on your motherboard are now permanently connected, which is preventing it from working properly.
Whether it’s the 3.3v from the NodeMCU or something else that you’ve done is impossible to say, but the outcome is the same.

Pete.

1 Like

So I’m back with a new motherbord and I’d still ike to get through this. This time I tried using a relay, I made the connection between the relay and the power pins on the mobo. I can turn on the relay, the mobo powers up, but then the relay stays on, I can’t switch it off no matter how times I try. If I disconnect it from the mobo it works fine. Any ideas on why would that be happening? Thank you

So are you saying that when you pulse the relay for say 1 second without it connected to the PC it works correctly (closing the relay contacts for 1 second then releasing) but not when the relay contacts are connected across the PC?

Pete.

@PeteKnight exactly. I also tried seitching an LED on and off to make sure it works.

How exactly are cou connecting this up?

Pete,.

D0 pin,3.3v pin and GND pin from nodemcu to Data,Vnn and GND pins of the relay. The relays open contact and middle contact are connected to the power pins of the motherboard.

I’d definitelly use a relay or an optocoupler.

Well, D0 (GPIO16) isn’t a great choice, see this:

And I’d probably power the relay with 5v rather than 3.3v, but if it’s working well on the bench and not when connected to the PC then it sounds very odd.
How are you powering the NodeMCU?

Pete.

@PeteKnight I’m also using a relay for switching on and off a LED strip that has been working for months, powered by 3.3v. I’ve tried powering the MCU from the PCs USB ports and from an external battery.

It’s almost impossible to diagnose what’s happening here, but it’s obviously something obscure.

I’ll throw in an alternative for you…

I use a Sonoff S20 as my way of remote booting my PC. My BIOS is set to boot on power-on (make sure yours has this option) and the Sonoff switches the mains power. The only small anomaly with this approach is that the PC power supply stores a little bit of power, which takes around 20 seconds to dissipate (in my case). This means that after powering-off the PC you have to wait around 20 seconds before reapplying the power to get the PC to boot. If you apply the power before the stored energy has dissipated the PC doesn’t recognise it as a power-on event, so won’t boot up.

If you want to, you could also use an MCU (ESP-01 maybe) to sense that status of the PC’s power LED to give an indication if the PC has booted. Just be careful that you know what sort of voltage is being supplied to the power LED, as I’ve seen some that use 5v LEDs that would need a resistor to drop it to a safe voltage for an ESP-01.
A shared ground would also be a good idea.

Pete.

I’m assuming the Sonoff S20 is a smart plug, right? I tought about it, too, but can I link it with Blynk? Also, for shutting down, is cutting the power the same as using the power button to shut down?

Yes, the S20 is a smart plug and it can be re-flashed with your own code, including Blynk code. There’s info on re-flashing similar type of smart plugs, and some code examples here:

Cutting the power isn’t the same as using the soft power switch on the PC, but it depends what you want to use it for.
I spend quite a bit of time away from home and want my PC off during these periods. But, I also want a way of remotely powering-up the PC so that I can connect to it remotely via TeamViewer. I don’t like WoL, and it’s not reliable enough for me anyway, so this solution works very well for my needs.

Pete.