Blog Home

A DIY hardware watchdog for your mining rig

Arduino TeamMarch 2nd, 2018

Vadim Panov wanted a way to automatically restart a PC that was simple and cheap to make.

For this task, he turned to an Uno due to its wide availability; however, any Arduino board with at least one digital I/O pin and a USB-enabled serial port will work.

The device sends a “hello” string to the PC, to which it expects a “HELLO” back from the PC—running its own corresponding Java program—within 10 seconds. If it doesn’t receive this string, it assumes that the computer is frozen, and uses a reed relay to trigger the motherboard reset pin.

Panov’s idea could be used to monitor and reset cryptocurrency rigs, but could be adapted to other PC setups as needed.

Here’s how it works: the PC-side program tries to connect to every single serial port in your system within a period of 30 seconds (including the ports that appear during this process). To each port it’ll send the handshake string “hello” and monitor the input, expecting to receive uppercase “HELLO” back. When the handshake is finished, it’ll send ping strings once each five seconds.

The watchdog program on Arduino scans the input for “ping” strings. If no such string has been received within 10 second period, the watchdog will forcibly restart your PC.

Therefore, this scenario where you manually run it will be “one-off”, i.e. once the PC has been restarted, the watchdog will be stuck in the pre-handshake state. To make it work all the time, add the Java program to the startup list of your operating system of choice.

You can read more here and check it out in action below!