Vertical laptop stand with Arduino Wake on LAN

Many people use laptops connected to bigger screens and to many other peripheals as usb hubs, mouse, keyboard, external storage devices, etc. .
Laptops are used often as desktop computers, and vertical laptop stands are very usefull because they are space savers.
The only inconvenient with the vertical stands is that you will have to remove the laptop from the stand in order to power it up.

I decided to build my own 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 a ethernet cable to connect the laptop and arduino. In the vertical laptop stand i will integrate an Arduino,
an ENC28J60 ethernet module and an 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 easyly cut with a cutter and glued together so you dont need expensive tools as 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 disavantage also: you will have to remove the laptop from the vertical stand when you need to turn it on, and this thing in 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 ehernet 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 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.

In order 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 an 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 is a BIG problem with this solution.
The battery lasts only few hours because the ENC28J60 Ethernet module and the Arduino consumes 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 the efficiency:
– arduino works continuously and consumes current.
– wasting space while 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 of time
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 Batery
– 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 componets together.
You can change the 2N7000 with another MOSFET, but then you will probably have to change the resistors values.

Leave a Reply

Your email address will not be published. Required fields are marked *