Vertical laptop stand with Arduino Wake on LAN
Many people use laptops connected to bigger screens and too many other peripherals like USB hubs, mouse, keyboard, external storage devices, etc.
Laptops are used often as desktop computers, and vertical laptop stands are very useful because they are space savers.
The only inconvenient with the vertical stands is that you will have to remove the laptop from the stand to power it up.
I decided to build my vertical laptop stand. I will turn on my laptop using Arduino that will generate wake on LAN magic packets.
Because the RJ45 port is unused, I will use an ethernet cable to connect the laptop and Arduino. Inside the vertical laptop stand, I will integrate an Arduino,
an ENC28J60 ethernet module and a USB hub.
Building a vertical laptop stand
For this project, we can choose between several materials. You can use thick cardboard, cellular polycarbonate sheets, Acrylic Sheets, Foam PVC Sheets, etc.
I decided to use Foam PVC sheets because they can be easily cut with a cutter and glued together so you don’t need expensive tools like a Dremel.
I chose a structure that can safely support my Acer laptop of almost 3 kg.
Although Foam PVC Sheets are pretty flexible, the final product, vertical laptop stand, will be very solid.
The Vertical Laptop Stand consists of several parts, which must be cut according to the attached pictures.
On the side of the laptop stand, I will mount the device that will start the laptop.
After I cut all the parts, I glued them together with hot glue.
You can download HERE the sketch in pdf format, which you can print on A4 paper.
Adding wake on lan functionality to the vertical laptop stand
Using a vertical laptop stand on your desk brings several advantages as , more space, or lower processor temperature, but it has a great disadvantage also: you will have to remove the laptop from the vertical stand when you need to turn it on, and this thing is annoying because there are many cables (USB, HDMI, VGA, audio, etc.) connected to the laptop .
The only way to turn on the laptop without opening the lid is Wake on Lan / Wake on Wan functionality. Because my laptop has only Wake on Lan and because I do not use the RJ45 port,
I decided to use the Wake on Lan for turning the laptop on.
It is very easy to power on your laptop using Arduino and ENC28J60 ethernet module.
You can read THIS article to find out how you can do it ( choose ENC28J60 ethernet module STATIC IP example! ).
For this project i used :
- Arduino Pro Mini 3.3V/8MHz
- ENC28J60 Ethernet module
- momentary button
- PCB board
- 1×10 kΩ resistor
- wires
- Crossover ethernet cable
After you made all the connections according to THAT project, and you managed to turn on your laptop using Wake on LAN we can move on to choosing the power supply.
When it is turned off or in standby, the laptop does not supply power to the USB connectors so we can not power Arduino from the USB plugs.
We have the following options for powering the project:
1. Power from a LiPo battery
The plan is to power the Arduino from the battery and to charge the battery from a USB port when the laptop will be on.
To power the Arduino pro mini 3.3v 8mhz from a LiPo battery we will need:
- 3.7V 330 mAh LiPo Battery
- 18650 Lithium Battery Charging Board
- SPDT on-off switch
- wires
Arduino Pro Mini 3.3V/8MHz can be powered from 3.3V to 12V and the 3.7V 330 mAh LiPo Battery seems to be enough for powering the whole project.
In this project, I will use a USB hub and, I plan to connect the 18650 Lithium Battery Charging Board to one port of the USB hub.
In the end, I desoldered one USB connector from the USB hub and connected the battery charger module to the Vcc and Gnd pins.
You can look at the picture gallery for more details.
After I made all the connections, I found out that it is a BIG problem with this solution.
The battery lasts only a few hours because the ENC28J60 Ethernet module and the Arduino consume too much current.
So i tried another solution for powering my project.
2. Powering the project from an old phone charger.
We will need these materials:
- micro USB breakout board
- 5V / 1A max old phone charger
- wires
Arduino Pro Mini 3.3V/8MHz can be powered from 3.3V to 12V so, we can use an old phone charger with a micro USB connector.
Connect the micro USB breakout board to RAW and GND pins of the Arduino Pro Mini 3.3V/8MHz and then connect the phone charger to the micro USB breakout board.
The only problem is efficiency:
- Arduino works continuously and consumes current.
- wasting space while the charger is connected all the time to the socket.
I decided to try another solution
3. Powering from a LiPo Battery only for a short period
That way the battery will last longer. There is no need for Arduino to be running all the time. We will turn it on only when we need to send WoL packets.
materials needed:
- 1x 1kΩ resistor
- 1x 3.3 kΩ resistor
- 3.7V 330 mAh LiPo Battery
- 18650 Lithium Battery Charging Board
- 2N7000 n-channel MOSFET
- on-off switch
- wires
The plan is that the Arduino is initially switched off and connected to a battery. After it is started, it begins to emit WoL packets, and after 10 seconds it shut down itself.
This will not consume a lot of battery power. The battery is connected to the USB hub and will charge when the laptop is turned on.
I am using a 2N7000 n-channel MOSFET as a switch. The basic idea is that at a single push of the button, the Arduino is powered, and then it sets the pin 5 HIGH. Pin 5 is connected with the GATE pin of the MOSFET, so, the MOSFET will power the Arduino board (even if the button is no longer pressed). After 10 seconds, Arduino will set the pin 7 LOW, and the MOSFET will cut off the power supply.
Here is the updated code that works in this situation:
#include // ethernet interface ip address static byte myip[] = { 192, 168, 1, 30 }; // gateway ip address static byte gwip[] = { 192, 168, 1, 1 }; // ethernet mac address - must be unique on your network static byte mymac[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 }; byte Ethernet::buffer[700]; // tcp/ip send and receive buffer static byte targetmac[] = {0xB8, 0x??, 0x??, 0x??, 0x??, 0x??}; static int CONTROL_PIN = 10; const int MOSFET_PIN = 5; void setup() { pinMode(MOSFET_PIN, OUTPUT); // Relay Signal Pin digitalWrite(MOSFET_PIN, HIGH); if (ether.begin(sizeof Ethernet::buffer, mymac, CONTROL_PIN) == 0) Serial.println( "Failed to access Ethernet controller"); ether.staticSetup(myip, gwip); ether.printIp("IP: ", ether.myip); ether.printIp("GW: ", ether.gwip); ether.printIp("DNS: ", ether.dnsip); } void loop() { sendWol(); delay(2000); sendWol(); delay(2000); sendWol(); delay(2000); digitalWrite(MOSFET_PIN, LOW); // shutdown the circuit } void sendWol() { ether.sendWol(targetmac); }
Make the connections on the breadboard and test the functionality. After you are done, you can solder the components together.
You can change the 2N7000 with another MOSFET, but then you will probably have to change the values of the resistors.