T H U R S D A Y , J U L Y 2 8 , 2 0 1 1
Remote Power Switch For A Computer, Part 1
My friends know that I am an incredibly lazy person. So lazy that one
of my irritations is that the HTPC (Home Theater PC) in the bedroom
requires that I actually get up out of bed to turn it on. This is fine if I
remember to switch it on before getting into bed, but most of the
time I only remember after I have swaddled myself in blankets.
The solution of course is to have a way to use a remote control of
some sort to turn on the PC. The first option is to not shut down the
PC at all, but leave it in “sleep” mode. This is probably the most
sensible option and I believe that I could set it up so a key press from
my beloved IOGear wireless keyboard would accomplish it. But I don’t
like sleep mode. I like computers to either be on or off. I’m cranky
and old fashioned.
So how then to power on a PC remotely? There are again a couple of
options. I could use Wake Over LAN to start it with the laptop I keep
on the bedside table (roll your eyes). I could use a PS2 keyboard or
mouse to power it on remotely, which would entail some wires strewn
across the floor. I tried to get the USB wireless keyboard to power it
on but was unsuccessful. Possibly I should have tried harder, but I
wanted to try something different.
So my option is an IR remote controlled power switch. The nice folks
at Simerec will sell you a kit or assembled IR remote power switch for
the PC for about $30.00. This is probably the best option so you should
just stop reading this post now and head on over there and order one.
You’re still here? Fine, don’t say I didn’t warn you. I did not buy the
Simerec switch because I’m somewhat cheap (although in the end this
project has cost 10 times that amount as it has spurred on new-hobby-
buying-syndrome). I also was fresh from the high of Henry and my
Awesome Button project and thought that a Teensy would fit the bill.
The Teensy can use Ken Shirriff’s IR remote library to receive and
transmit IR remote control signals. So all I needed was to get an IR
receiver and remote, figure out how to wire it up to receive input,
Contributors
Felice Luftschein
Nick Carter
Etsynicholasandfelice
Blog Archive
► 2013 (19)
► 2012 (24)
▼ 2011 (33)
► December (1)
► November (2)
► October (2)
► September (4)
► August (2)
▼ July (9)
Remote Power Switch For A
Computer, Part 2
Remote Power Switch For A
Computer, Part 1
0 Mais Blogue seguinte» Criar blogue Iniciar sessão
The Mechanical Philosopher The musings of a dilettante on parenting, mechanics, philosophy and the background noise that is daily life. From beautiful ruralburbian Philomath, Oregon.
Page 1 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
figure out how to wire a relay to turn the PC power switch on, and
program the thing. Easy! It will practically make itself!
The Soul
Survivor
Destiny Image
Crash My Party
Luke Bryan (A…
$11.88
Quick and Ugly Stroller Repair
Disassembly of a Logitech
Quick Cam
A Nice Picture and A Few Links
Soldering Iron Stand
Repairing a Targus Laptop
Cooler
Philomath Classic Car Show
2011
The Awesome Button
► June (1)
► April (3)
► March (5)
► February (1)
► January (3)
► 2010 (29)
► 2009 (34)
► 2008 (53)
► 2007 (48)
► 2006 (40)
► 2005 (64)
Search
Links
Who is Nick Carter?
Cartertools.com, Taig Lathes and
Mills.
Nick's Taig Lathe and Milling
Machine Blog
Our Homepage
Felice's Blog
Our Etsy Store, Jewelry and
More!
My Airgun Tinkering Blog
Amazon.com (I get a cut from
purchases...)
My Experimental Roku Blog
Search Amazon.…
Page 2 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
Kindle Fire HD
7", Dol…
Amazon Digita…
$199.00
Blood Money
$1.99
Sunlight on My
Shadow
City Creek Pre…
The Civil Wars
The Civil Wars…
$11.88
Chromecast…
$35.00
Get Widget Privacy
Another Airgun Blog
Quick Set of Walnut Grips for a
Crosman 2240
Another Breech for a Crosman.
Part 5
HW50S Rebuild, Part 2
Another Breech for a Crosman.
Part 4
Another Breech for a Crosman.
Part 3
Nick's Taig Lathe and Milling Machine Blog
Ron Kiely’s Taig Powerfeed
Universal Joint Modification and
Lock.
Leon Dionne’s Method of
Tramming the Taig Mill
Monty Remon’s Quick Retract
Threading Tool
Monty Remon’s Taig Lathe Flex
Shaft Holder
Bryan’s CNC Mill Enclosure
Blogs Foolish Enough to Link to Me
Omegamom
The Walls of St. Paul
From the Northwoods
Positive Ape Index
Pancake and Lulu
Where Have You Gone Joe
Dimaggio?
Siris
Page 3 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
This is what the code looks like:
#include <IRremote.h>
const int RECV_PIN = 6; // pin that the IR receiver is on
IRrecv irrecv(RECV_PIN); // receive IR on that pin
decode_results results; // the code sent by the remote
int relayPin = 1; // pin out for relay pin and LED
void setup()
{
Serial.begin(9600);
Clueless in Carolina
Miss Cellania
A Metalsmith's Journey
Followers
with Google Friend Connect
Members (19)
Already a member? Sign in
Page 4 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
irrecv.enableIRIn(); // Start the receiver
irrecv.blink13(true);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
}
void loop() {
if (irrecv.decode(&results)) {
if (results.value != 0) {
Serial.println(results.value);
}
if (results.value == 332 results.value == 2380) {
Serial.println("power");
digitalWrite(relayPin, HIGH);
delay(1000); // waits for a second
digitalWrite(relayPin, LOW);
delay(10000); // waits for 10 seconds
}
irrecv.resume(); // Receive the next value
}
}
The code is simple and I’m not going to go into great detail about it
but basically it starts the receiver, then in the main loop sees if a
button press has been received. If the press is received it prints that
value to the serial monitor (which makes it easy to decode each
button as it is pressed). If the code received is either 332 or 2380 then
the power switch has been pressed. You can look into IR protocols and
learn more if you want. It is fascinating. If the power switch has been
pressed then it sets the relay pin high for one second, then turns it off
and waits ten seconds before resuming the loop. I did this to prevent
accidentally turning it on and off in rapid succession.
Here are two short, grainy and boring videos of my turning the LED on
and off as well as fading it (not applicable to this project, but neat
nonetheless).
Page 5 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
Page 6 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
Next I had to figure out how to run a relay. Apparently with relays you
need to protect the actuating circuit from the collapse of the coil
field (snore…) which dumps a ton of voltage the wrong way ‘round
into your circuit. This would be bad. So I found a schematic (PDF) that
showed the parts I needed to avoid the problem.
LED off…
LED on…The button is mimicking the 5V signal from the Teensy. The
LED is standing in for the PC power switch.
Page 7 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
It’s a simple circuit. The 1N4005 diode was scavenged from the VCR.
My suffering mentor (Thanks Gregg!) told me that a 1N4005 would
work as well as a 1N4004.
This will make it more or less clear. Ok, maybe it won’t. This is the
relay I used.
Then I grafted the IR receiver breadboard to the relay breadboard.
Page 8 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
Then I carefully moved all the IR components to the one breadboard. I
tested all along the way to make sure I didn’t make any mistakes.
An extension cord I whipped up runs from the PC power switch header
to the breadboard.
Plugged into the breadboard.
Page 9 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
Did it work? Yes. See this incredibly boring and thankfully short video:
More to come in part 2…
Posted by Nick Carter at 1:11 PM
Labels: project
2 comments:
Anonymous said...
Cool! :P
3:52 AM
RFPCREMOTE said...
rfpcremote.com has a rf remote power button.
5:37 AM
Recommend this on Google
Page 10 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...
Newer Post Older Post
Post a Comment
Home
Subscribe to: Post Comments (Atom)
Privacy Policy
Page 11 of 11The Mechanical Philosopher: Remote Power Switch For A Computer, Part 1
19-08-2013http://mechanicalphilosopher.blogspot.pt/2011/07/remote-power-switch-for-computer...