theniccolo
Posts: 4
Joined: Fri Apr 10, 2015 7:21 am
Location: Boston USA

Pizero pc power trigger

Sun Dec 31, 2017 2:52 pm

While WOL (wake on LAN) would probably be the easiest route, that's not the objective here. I'd like to use a pizero with a momentary switch to wireless trigger the gpio pins attached to the power + and - pins on a desktop computer motherboard. There isn't much current going across those pins so I'm not worried about shorting anything (pun not intended). Basically to try to draw it out this is what I'd like to do

Momentary switch under my desk>pi zero >wireless network>pizero attached to my desktop>power + and - on desktop motherboard . Any thoughts on how to do this remotely or if there is a better way to configure this.

Thanks for any thoughts or suggestions

User avatar
DougieLawson
Posts: 32998
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pizero pc power trigger

Sun Dec 31, 2017 3:59 pm

Use wake-on-lan, if your PC supports it as that doesn't need any hardware, doesn't need you switching mains voltages and doesn't need you hacking the PC motherboard.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

drgeoff
Posts: 8191
Joined: Wed Jan 25, 2012 6:39 pm

Re: Pizero pc power trigger

Sun Dec 31, 2017 7:48 pm

Having encountered 4 desktop PCs (all with different ATX PSUs) that wouldn't turn on and having found that was due to their 5 volt standby supplies being very low voltage* it is evident that 5 volts is normally present in the power-on circuitry and I would warn you that there is a non-negligible risk of fatally damaging an RPi as its GPIOs are not 5 volt tolerant.

Thankfully there is no mains voltage anywhere inside a conventional desktop PC except inside the metal box of the PSU. Do not go inside there unless you really know what you are doing.

(* All 4 repaired by replacing the relevant £/€/$0.30 electrolytic inside the PSU box.)

pcmanbob
Posts: 3984
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Pizero pc power trigger

Sun Dec 31, 2017 8:10 pm

You could do this using a small relay with a 5v coil driven by a transistor connected to the gpio.
The contact of the relay being used to replace the switch power switch on the pc.

You could also do it using an opto-isolator which you could drive directly from the gpio with a simple resistor to limit the LED current and use the output again to replace the switch on the pc, but you would have to make sure to connect the output of the opto-isolator the right way round.

Then you just need sa simple python script to drive the gpio output high for the required time to boot the pc.
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

User avatar
thagrol
Posts: 695
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pizero pc power trigger

Mon Jan 01, 2018 1:23 pm

This is how I did it: https://github.com/thagrol/fakewake

You could substitue one or more relays for the M74HC4066B1R

Works in parallel with the front panel switches, has web and wol interfaces, monitors PC state (psu and ping) and can trigger both power and reset funstion.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

theniccolo
Posts: 4
Joined: Fri Apr 10, 2015 7:21 am
Location: Boston USA

Re: Pizero pc power trigger

Wed Jan 03, 2018 6:39 am

Thanks for the quick and thorough responses
DougieLawson wrote:
Sun Dec 31, 2017 3:59 pm
Use wake-on-lan, if your PC supports it as that doesn't need any hardware, doesn't need you switching mains voltages and doesn't need you hacking the PC motherboard.
As drgeoff points out
drgeoff wrote:
Thankfully there is no mains voltage anywhere inside a conventional desktop PC except inside the metal box of the PSU.
WOl would require another computer which isnt really what i was going for
The power and reset switches literally connects to 2 sets of +/- pins. I wouldn't be dealing with mains power, its 5Vs from what i have read. It just requires a short to activate the psu. I wonder if i could use a relay and trigger it for a short enough amount of time for the psu not to think of it as a hard reset.
thagrol wrote: This is how I did it: https://github.com/thagrol/fakewake

You could substitute one or more relays for the M74HC4066B1R

Works in parallel with the front panel switches, has web and wol interfaces, monitors PC state (psu and ping) and can trigger both power and reset funstion.
This is almost perfect but all i really want is to make the power button "wireless" as in not directly connected to the desktop. What is a M74HC4066B1R? Couldnt find it on any of the regular electronic bits websites i wander through

drgeoff
Posts: 8191
Joined: Wed Jan 25, 2012 6:39 pm

Re: Pizero pc power trigger

Wed Jan 03, 2018 9:19 am

theniccolo wrote:
Wed Jan 03, 2018 6:39 am
What is a M74HC4066B1R?
It is a quad FET switch. Generic number is just 4066. Different prefixes and suffixes for various manufacturers and versions. Eg http://www.ti.com/lit/ds/symlink/cd4066b-q1.pdf.

Or use a NPN transistor (with base resistor), a low threshold voltage FET or an opto-isolator.

The 5 volt standby supply in the PC probably has enough spare current to power a Zero.

User avatar
thagrol
Posts: 695
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pizero pc power trigger

Wed Jan 03, 2018 1:17 pm

drgeoff wrote:
Wed Jan 03, 2018 9:19 am
The 5 volt standby supply in the PC probably has enough spare current to power a Zero.
In my experience it does, not sure what the ATX spec demands but you can expect at least a couple of amps on the 5v standby line.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

User avatar
thagrol
Posts: 695
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pizero pc power trigger

Wed Jan 03, 2018 1:31 pm

theniccolo wrote:
Wed Jan 03, 2018 6:39 am

WOl would require another computer which isnt really what i was going for
Depends on how you define computer. There are WOL send apps available for smart phones and tablets. A full on PC is not needed. It's probably even possible using an arduino (or similar) with ethernet/wifi.
This is almost perfect but all i really want is to make the power button "wireless" as in not directly connected to the desktop.
Might be worth investigating remote controlled relay boards. RF not IR though.

One thing I forget to mention when singing my own praises: WOL doesn't normally work when the PC is only connected via WiFi. (a limitation of the WiFi cards) my solution allows use of WOL even if the target PC has no wired ethernet connection (or no network connection at all)
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 22 guests