Control your computers from anywhere with the Raspberry Pi

If you are one of those who often need to use the home computer from a remote location, then you need a Web-based application that can power your home computers up or down. For example, you may have a specific file or folder on your home computer that you urgently want to access but cannot do so because you are in a different location.

Keeping the home computer always powered on is not a great idea, even though it allows remote connections when required. For one, an always-on computer consumes power unnecessarily. Additionally, if there is a crash, there is no way you can get it up running again from your remote location. This is exactly what Martin Peters faced when he devised a hardware-based solution to cut the power down to his home computer and put it back up again when necessary.

What Martin realized that he had to have at least one computer always on and connected to the internet, to be able to control the others from a remote location. He hit upon the cheapest and lowest power consumption computer – the Raspberry Pi or the RBPi. Additionally, this tiny single board computer comes with an Ethernet port and some General Purpose Input Output or GPIO. The Ethernet port allows the RBPi to connect to the Internet and the GPIO allows controlling additional electronic circuitry.

Martin used the GPIO on the RBPi to control electronic circuitry on a circuit board he has custom made, see details here. This allows him to cut the power to his home computer, press its power switch and read the state of its power LED. For doing this, he has designed a web-based user-interface with which he wraps those GPIOs. The user-interface updates in real time and displays logs along with the power LED status.

The C++ widget-oriented web toolkit used by Martin is called Wt. The toolkit handles updates with a very simple method and even provides a native library called wiringPi to handle the GPIOs of the RBPi.

The GPIOs on the RBPi are very sensitive and can easily be damaged if more than 3mA is drawn from them when in output mode. The best solution Martin found was to isolate those using opto-isolators. Since Martin wanted to control many computers from the RBPi, he decided to place all the opto-isolators close to the RBPi and all the switching on the PC side. That meant each PC was to have a PCB and all the circuits could be connected with an Ethernet cable.

Keeping a relay to cut the power to the computer would require an additional 12V power supply to operate the relay. Instead, Martin accessed the green wire on the secondary side of the ATX power supply unit. When the computer’s motherboard wants to wake up, it shorts the green wire to the ground, which signals the ATX PSU to start supplying voltage to its other pins and the entire computer boots up.

Martin used a MOSFET in series with the green wire. He tied the gate pin of the MOSFET to the +5V (violet wire) of the ATX PSU via a 10K resistor. Pulling the gate to ground using an opto-isolator gave Martin complete control of the ATX PSU.