Food

Living

Outside

Play

Technology

Workshop

impBoot: Remotely Turn on a Desktop Computer
by hymelsr on November 20, 2012 Table of Contents impBoot: Remotely Turn on a Desktop Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Intro: ImpBoot: Remotely Turn on a Desktop Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 1: Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 2: Prepare Wires and Breakout Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 3: Connect the Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 4: Create Electric Imp Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 5: Configure the Imp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 6: Connect the impBoot Hardware to the Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 7: Write Electric Imp Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 8: Configure Electric Imp Toggle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 9: Try It Out! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 2 3 3 4 4 5 5 7 8 8 9 9

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

Intro: ImpBoot: Remotely Turn on a Desktop Computer
While at school, I found myself needing to remote desktop or SSH into my computer quite frequently. I would send MATLAB scripts to run while I was in class or working on something else. I needed to either leave my desktop running (sucking around 200W while idle) or find a way to turn it on remotely. Wake-on-LAN (WoL) works quite well but requires a wired, Ethernet connection, and try as I might, I could not get Wake on Wireless LAN (WoWLAN) to work with my hardware. The Electric Imp with a simple switch allows for a different kind of Wake on Wireless LAN as long as you have WiFi access and a USB port that always provides power (even when the computer is off). This inscrutable is fairly straightforward but assumes you are comfortable soldering and stripping wires.

Step 1: Equipment
Materials * Electric Imp * Electric Imp Breakout (with male headers soldered to all ports) * 3x Female-Female jumper wires * Breadboard * 1kΩ resistor * 2N3904 (NPN Transistor) * USB-mini cable * 4x wires (22-26 ga. stranded), each about 4 feet long (both ends stripped and tinned ) * Android smartphone (if you can replicate Electric Imp Toggle functionality, Android isn't needed) Tools * Wire strippers * Soldering iron * Solder * Flux * Wet sponge

Image Notes 1. Electric Imp Breakout 2. Electric Imp 3. 1k resistor 4. 2N3904 (NPN Transistor) 5. Breadboard

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

6. 3x Female-Female jumper wires 7. USB-mini cable 8. 4x wires (stripped and tinned), each about 4 feet long 9. Android smartphone

Step 2: Prepare Wires and Breakout Board
Stranded wire is the best for this application, as it allows for some flexibility (solid core wire has a habit of snapping after too many bends). Cut four lengths of wire, each about 4 feet long. You then need to strip and tin the ends, leaving about 1/2" to 1" of bare wire exposed. There are many good tutorials on stripping and tinning. If you are short on soldering equipment, try this one by Jayefuu : Strip and Tin Wires Like a Pro . If you have good soldering equipment (and love reading ridiculously long training manuals), check out this guide: Wiring Techniques by CED Engineering . As for the breakout board, you'll need to solder male pins to each of the header ports. Have the main row on the edge of the board face down and the 3 pins labeled "BAT, VIN, USB" face up. For soldering pin headers, see this guide: Pin header soldering .

Image Notes 1. Flux the exposed wire. With a dab of solder on the iron tip, move the tip from the end of the insulation to the end of the exposed wire while slowly feeding solder. 2. Helping hands aren't necessary, but are quite....handy.

Step 3: Connect the Hardware
1. Place the Electric Imp Breakout on the breadboard 2. Slide the Electric Imp into the breakout board (you'll hear a click when it's seated properly) 3. Connect the 1k resistor from PIN8 of the breakout board to a free row on the breadboard 4. Place the transistor on the breadboard - line up the BASE with the other end of the 1k resistor 5. Using a jumper wire, connect "USB" to "VIN" power pins 6. That's it! The hardware is pretty simple, actually.

Image Notes 1. Connect resistor to PIN8 of the breakout board 2. Connect the other side of the resistor to the BASE of the NPN transistor 3. Connect together the pins labeled USB and VIN 4. EMITTER goes to negative side of POWER_SW (mobo and case switch) 5. COLLECTOR goes to positive side of POWER_SW (mobo and case switch)

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

Step 4: Create Electric Imp Account
If you already have an Electric Imp account, you can skip this step. Sign up for an account at https://plan.electricimp.com/signup .

Step 5: Configure the Imp
1. Download the Electric Imp configuration utility a. Google Play: electric imp b. iTunes: electric imp c. PC: Electric Imp Blink-Up Application for Windows 2. Plug in the USB-mini cable from a power source (e.g. a computer) to the breakout board 3. Make sure the Electric Imp is powered. It should start blinking orange waiting for a BlinkUp. 4. In the configuration utility, click "Other Network..." 5. Fill out your SSID and Password 6. Click "Send BlinkUp" and immediately hold the screen against the edge of the Electric Imp 7. Wait while the pattern is blinked to the Imp 8. The Imp should then slowly blink green, meaning it has connected to the cloud server.

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

Image Notes 1. Hold the screen as close as possible to the edge of the Imp. This might take a few tries.

Step 6: Connect the impBoot Hardware to the Computer
1. Open up your computer case, and find the power switch connector on your motherboard (it will be labeled "POWER SW" ) 2. Unplug the connector. Remember which pin is negative (black wire) and which pin is positive (not black wire). 3. Connect the positive header pin to the impBoot a. Connect a F/F jumper wire to the positive POWER SW header pin on the motherboard b. Connect one of the 4 ft. wires to the jumper wire c. Route the wire through the computer case d. Connect the wire to the COLLECTOR of the transistor 4. Repeat step 3 to connect the negative header on the POWER SW to the EMITTER on the transistor 5. Connect the positive wire from the case switch to the impBoot (COLLECTOR) using one of the 4 ft. wires 6. Connect the negative wire from the case switch to the impBoot (EMITTER) using the last wire 7. Place the impBoot in a safe location (e.g. on top of the computer case) 8. Connect the USB cable from the impBoot to a USB port that is always powered

Image Notes 1. Find a USB port that is always on 2. Run the 4 wires through the case to the motherboard Image Notes 1. POWER SW positive to COLLECTOR and POWER SW negative to EMITTER 2. POWER SW positive header to COLLECTOR 3. POWER SW negative header to EMITTER 4. Connect 2 female-female jumper wires to POWER SW header pins

Step 7: Write Electric Imp Code
1. Sign in to electricimp.com with your account 2. Go to https://plan.electricimp.com/code 3. Hit the giant "+" button 4. Name your new firmware "impBoot" and click OK 5. In the programming environment, enter the following (between START and END lines): ==START OF CODE== // impBoot // // Cloud Wake-On-LAN. Remotely boots a desktop through the motherboard's switch // // Author: Shawn Hymel // Date: November 15, 2012 // // Hardware: // Connect 1k resistor to pin 8 of the imp. Connect that to the base // of an NPN transistor. Connect the collector to the + of the POWER // SW on the motherboard and the emitter to the - of the POWER SW on // the motherboard. // // You will need the Electric Imp Toggle Android app (or something similar). // // Based on the example Imp code provided by Taylor Alexander, which can // be found at https://github.com/tlalexander/Electric-Imp-Toggle // // License: BeerWare (thanks Sparkfun!) // Please use, reuse, and modify this code as you need. // We hope it saves you some time, or helps you learn something! // If you find it handy, and we meet some day, you can buy me a beer // or iced tea in return. //

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

//***************************************************************************** // Class definitions // Input port to accept on/off commands from Electric Imp Toggle app class inputHTTP extends InputPort { // Event handler when HTTP command is received function set(httpVal) { // If HTTP receives a "1" hold switch on for 1 second // If HTTP receives a "0" hold switch on for 6 seconds, forcing a // hard shutdown if (httpVal == 1) { server.log("Received ON command."); hardware.pin8.write(0); imp.sleep(0.01); hardware.pin8.write(1); imp.sleep(1); hardware.pin8.write(0); imp.sleep(0.5); } else if (httpVal == 0) { server.log("Received OFF command."); hardware.pin8.write(0); imp.sleep(0.01); hardware.pin8.write(1); imp.sleep(6); hardware.pin8.write(0); imp.sleep(0.5); } } } //***************************************************************************** // Function definitions // Initialize pin 8 to be output to control motherboard POWER SWITCH function initSwitch() { hardware.pin8.configure(DIGITAL_OUT_OD_PULLUP); hardware.pin8.write(0); } //***************************************************************************** // Start of program server.log("Started"); // Configure the input port of the Imp to listen for HTTP commands imp.configure("impBoot", [inputHTTP()], []); // Configure pins on the Imp initSwitch(); ==END OF CODE== 6. Click the "Save Code" button 7. Go to "Planner" on the Electric Imp site, where you should see a single block - your Electric Imp 8. Click the Settings Button on the Electric Imp block 7. In the drop-down box that appears, click on "impBoot" 8. Click the 'Add Node' button and add an "HTTP In" block, which should appear in the planner window 9. Click the "+" button on the "HTTP In" block and click the impBoot block to connect the two blocks (an arrow will appear)

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

Image Notes 1. Settings button

Step 8: Configure Electric Imp Toggle
1. Download the Electric Imp Toggle app on Google Play 2. Download the Barcode Scanner app on Google Play (if you don't have it already) 3. Start the Electric Imp Toggle app and click on "Scan code" 4. Go to the Planner on your Electric Imp account 5. Click on the Settings button on the "HTTP In" block 6. Highlight and copy the web address (https://api.electricimp.com/v1/f1...) 7. Find a QR code generating site such as http://qrcode.kaywa.com/ 8. Paste in the web address and click "Generate" 9. Hold up the smartphone running the Barcode Scanner to the newly generated barcode 10. The scanner should recognize the QR code, and Electric Imp Toggle will be configured!

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

Step 9: Try It Out!
Turn off your newly impBoot-improved desktop. Power up the Electric Imp Toggle App, which should be configured with your impBoot website. Press the "Turn On" button. Magic should happen. Note that the "Turn Off' button works by holding the switch for 6 seconds. This forces a hard shut down on the computer (if you're running Windows, you'll probably get a nasty message about not shutting down properly next time you start). If you run into problems, you can start debugging by looking at the system messages. Go to your Planner on electricimp.com and click the "edit" button on the "impBoot" block. Under the "log" tab, you should see messages about power state and received "ON" or "OFF" commands. There you have it. You can now be a lean, mean, remote tasking machine.

Related Instructables

ControlBox: An internetconnected knob to control... anything! by tombrew

Power Saving Remote Computing by 3rugger

Internetconnected joystick by tombrew

Emma: an 8digit Alphanumeric LED Display powered by Electric Imp by tombrew

Controlling RGB LEDs with controlBox (video) by tombrew

impBot: a PanTilt Electric Imp Robot by tombrew

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/

Advertisements

Comments
3 comments

Add Comment

Orngrimm says:

Nov 22, 2012. 4:58 AM REPLY I successfully made a small server i can wake up on wireless. BUT: I had to use quite special hardware where you have an always-on-WiFi-Card with a small headercable connecting to the WoL-Pins on the Motherboard... It was a nightmare to find and build. So yeah: The solution (Nice 'ible by the way! Like it!) presented here is 100x simpler and for SURE more fun to build. :)

hymelsr says:

Nov 22, 2012. 7:18 AM REPLY I'm glad you liked it! I thought about doing something like you described with a Raspberry Pi, but it seemed overly complicated. I'm curious, are you able to get information about the state of the computer (e.g. ON or OFF) from the WoL pins? That's the one thing impBoot is missing, and I'd like to be able to determine if the computer is on or not.

Orngrimm says:

Nov 22, 2012. 11:04 AM REPLY As i posted, the hardware i used isnt selfmade... I dont know if you somehow can communicate with the Mobo and ask about status... But if i were you, i would simply check an unused USB-Port for +5V. If the Comp is shut down, that should be 0V. ;)

http://www.instructables.com/id/impBoot-Remotely-Turn-on-a-Desktop-Computer/