Overclock.net › Forums › Case Mods & Cases › Other Hardware Mods › Remote Power Switch for my PC using a Raspberry Pi
New Posts  All Forums:Forum Nav:

Remote Power Switch for my PC using a Raspberry Pi

post #1 of 30
Thread Starter 
The Problem: my PC doesn't like to sleep (the fans never turn off) and Wake-On-Lan can be really touchy, usually turning on my PC when I didn't ask it to and after only 2-3 minutes of sleep. Also, sometimes I forget to turn on my computer when I am at work or school so I can't access any of my files or services.

The Solution: I'm going to buy a Raspberry Pi. The Pi will host a web server (via wireless) which will have a single web page with a single button to Power On or Off my PC. When I click the button, I will use the GPIO pins on the Raspberry Pi to switch a relay connected to the power pins on my PC. This will all fit nicely inside my PC case.

So, I need to set up a web server on Linux, which I can do. I need to wire up a relay circuit which I can sorta do but my EE roommate can help me with. Then I need to code the web page to actually switch the relay which I have no idea how to do but my roommate says he does.

All in all I'm not sure how I'm going to fit this project into my time but I hope to get it done in the next month or so. Anyone done this sort of thing before?


EDIT: Final update here: http://www.overclock.net/t/1429479/remote-power-switch-for-my-pc-using-a-raspberry-pi/0_50#post_21592386
Edited by IEATFISH - 1/15/14 at 6:34pm
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
post #2 of 30
Sub'd. Good luck man, this sounds like a cool project.
MicroHammer
(10 items)
 
  
CPUMotherboardGraphicsRAM
i5-4690k - 4.6GHz @ 1.250V ASRock Z97M OC Formula Sapphire R9 290 G.SKILL TridentX (2 x 4GB) DDR3 2400 
CoolingMonitorPowerCase
2x H105s: CPU and 290 (via NZXT G10) The Tube (39" LG LED) Corsair AX760 Thermaltake Core V21 
  hide details  
Reply
MicroHammer
(10 items)
 
  
CPUMotherboardGraphicsRAM
i5-4690k - 4.6GHz @ 1.250V ASRock Z97M OC Formula Sapphire R9 290 G.SKILL TridentX (2 x 4GB) DDR3 2400 
CoolingMonitorPowerCase
2x H105s: CPU and 290 (via NZXT G10) The Tube (39" LG LED) Corsair AX760 Thermaltake Core V21 
  hide details  
Reply
post #3 of 30
Thread Starter 
Alright, I ordered the Pi and wifi adapter today. It should show up on Wednesday and I hope to be able to get started this weekend. My first steps will be to get the PI set up and stable.
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
post #4 of 30
Thread Starter 
Look what showed up today!



Raspberry Pi, USB power brick, Wireless N adapter, and an old 4GB SD card I had lying around.


Installing the OS was extremely easy. Download the image, format the card, copy the files, and let it do its thing.



Setup was a breeze. I had to edit a few lines of text for my wifi settings and one or two clicks to enable SSH. I'm installing the web server components now and then I need to start reading up on coding for the GPIO pins and how to get my webpage to send a command there.
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
post #5 of 30
Thread Starter 
Last night I was also able to get the python libraries for the GPIO installed as well as messing around with the Pi a bit. If anyone wants a cheap way to play with Linux, this is a pretty amazing option.
Edited by IEATFISH - 10/3/13 at 11:53am
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
post #6 of 30
As long as the button on the web page is a giant red one that says "DO NOT PRESS THIS BUTTON", I approve. thumb.gif
Obsiden V2.0
(20 items)
 
HP Touchpad
(0 items)
Random Tech Stuff
(27 photos)
CPUMotherboardGraphicsRAM
Intel Core I7 970 @ 4.2Ghz Asus Rampage Formula III ASUS GTX780 12GB G.Skill DDR3 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 840  Seagate 3TB LG DVD Burner Thermalright Silver Arrow 
OSMonitorMonitorKeyboard
Windows 10 Tech Preview Samsung SyncMaster 2343 BWX Acer H243Hbmid 24"  Ducky Shine Zero TKL MX Browns 
PowerCaseMouseMouse Pad
OCZ 1010watt Syrillian Built Tech Bench (Obsiden Silence) Zowie EC2 Blue SteelSeries QcK Mini 
AudioAudioAudioAudio
Creative ZxR KRK Rokkit 5 Gen2 Novation Launchpad Control Pack M-Audio Axiom25 
  hide details  
Reply
Obsiden V2.0
(20 items)
 
HP Touchpad
(0 items)
Random Tech Stuff
(27 photos)
CPUMotherboardGraphicsRAM
Intel Core I7 970 @ 4.2Ghz Asus Rampage Formula III ASUS GTX780 12GB G.Skill DDR3 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 840  Seagate 3TB LG DVD Burner Thermalright Silver Arrow 
OSMonitorMonitorKeyboard
Windows 10 Tech Preview Samsung SyncMaster 2343 BWX Acer H243Hbmid 24"  Ducky Shine Zero TKL MX Browns 
PowerCaseMouseMouse Pad
OCZ 1010watt Syrillian Built Tech Bench (Obsiden Silence) Zowie EC2 Blue SteelSeries QcK Mini 
AudioAudioAudioAudio
Creative ZxR KRK Rokkit 5 Gen2 Novation Launchpad Control Pack M-Audio Axiom25 
  hide details  
Reply
post #7 of 30
Thread Starter 
Quote:
Originally Posted by KarmaKiller View Post

As long as the button on the web page is a giant red one that says "DO NOT PRESS THIS BUTTON", I approve. thumb.gif

Ha, that's exactly what I was planning. Or maybe the Staples easy button.
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
post #8 of 30
Call me old school. But I am just a fan of the good old power button! One to power it on, the other to power it off. smile.gif
Warning: Spoiler! (Click to show)
00-vt.jpg
post #9 of 30
Cool project!

I've been meaning to play around with a raspberry pi for a while.

Strongly recommend securing that page via htaccess or other means - is there a web based API you're using to interface the site with the hardware?
    
CPUMotherboardGraphicsRAM
Phenom II X3 720 @ 3.5 (1.39v) Gigabyte GA-MA790XT-UD4P ASUS 5850 @ 880/1180 (1.118v) 4gb 1333mhz G.Skill DDR3 
Hard DriveHard DriveHard DriveHard Drive
64gb Crucial M4 SSD 3x 250gb WD2500JD - RAID0 1tb WD1001FALS 1tb WD10EARS 
Optical DriveCoolingOSMonitor
Pioneer DLDVD/CDRW Arctic Freezer Pro 64 Win 7 64bit Ultimate E2305 LG 23" LED 
KeyboardPowerCaseMouse
Filco Majestouch II Ninja Tenkeyless Fortron BlueStorm II 500w CM 690II Advanced Razer DeathAdder 
Mouse PadAudioAudio
generic Echo Miamidi PCI M-Audio BX5a Studio Monitors 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Phenom II X3 720 @ 3.5 (1.39v) Gigabyte GA-MA790XT-UD4P ASUS 5850 @ 880/1180 (1.118v) 4gb 1333mhz G.Skill DDR3 
Hard DriveHard DriveHard DriveHard Drive
64gb Crucial M4 SSD 3x 250gb WD2500JD - RAID0 1tb WD1001FALS 1tb WD10EARS 
Optical DriveCoolingOSMonitor
Pioneer DLDVD/CDRW Arctic Freezer Pro 64 Win 7 64bit Ultimate E2305 LG 23" LED 
KeyboardPowerCaseMouse
Filco Majestouch II Ninja Tenkeyless Fortron BlueStorm II 500w CM 690II Advanced Razer DeathAdder 
Mouse PadAudioAudio
generic Echo Miamidi PCI M-Audio BX5a Studio Monitors 
  hide details  
Reply
post #10 of 30
Thread Starter 
Quote:
Originally Posted by _02 View Post

Cool project!

I've been meaning to play around with a raspberry pi for a while.

Strongly recommend securing that page via htaccess or other means - is there a web based API you're using to interface the site with the hardware?

I was thinking about that. I'll do some simple security and might move it to an isolated VLAN so I don't have to worry about and intrusions. The web page will run on a non-standard port which will help.

As for interfacing the site with the hardware, I found that you can run terminal commands via php and so I should be able to run the python API triggers directly. I may wire up the reset button as well and then have the power button ping the PC first so it doesn't switch if the PC is already on, if that makes sense.
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
Gunmetal Tower
(23 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2600K ASUS P8Z68-V GEN3 Asus GTX 580 CORSAIR Vengeance 16GB 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 830 256GB Western Digital Caviar Black 640GB LG DVD Corsair H80 
OSMonitorMonitorKeyboard
Microsoft Windows 8.1 Professional 64 Bit Asus PB278Q Dell 1907FPc  Ducky 9008-G2 Browns and Reds 
PowerCaseMouseMouse Pad
ABS SL1050 1050W Antec P280 Logitech G700 Mionix Propus 380 
AudioAudioAudioAudio
HT | OMEGA Claro Halo Audio Technica ATH-A900X Audio Technica ATH-AD900 M-Audio AV 40 
OtherOtherOther
Logitech USB Desktop Microphone APC Back-UPS XS 1500 Wacom Intuos4 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Other Hardware Mods
Overclock.net › Forums › Case Mods & Cases › Other Hardware Mods › Remote Power Switch for my PC using a Raspberry Pi