Controlling Mains Power Rube Goldberg Style


[g3gg0] has some nice radio equipment including an AOR AR-5000 receiver and a HiQ SDR. They are so nice that it appears they lack an on/off switch. [g3gg0] grew tired of unplugging the things, and decided to nerdify his desk with a switch that would turn his setup on and off for him. He decided to accomplish this task by emulating the Scroll, Number and Caps Lock LEDs on his keyboard via a Digispark board. He uses the LEDs to issue commands to the Digispark allowing him to control a 5V relay, which sits between it and the AC.

Starting off with some USB keyboard emulation code on the Digispark, he tweaked it so he could use the Scroll Lock LED as sort of a Chip Select. Once this is pressed, he can use the Caps Lock and the Number Lock LED to issue commands to the Digispark.

It’s programmed to only stay on for a total of 5 hours in case he forgets to turn it off. Let us know what you think about this interesting approach.

19 thoughts on “Controlling Mains Power Rube Goldberg Style

  1. Maybe if you’re not allowed to install or run any foreign software on you office PC it might be viable way around that restriction. For home use i would rather build something with an ESP8266 and be able to control it from every (even remotely if have a normal internet connection).

    1. Well, even if you have rights on your computer it is helpful.
      I didnt want to have another tool for just controlling the mains switch.

      I just wanted the simplicity of pressing mechanical buttons (keyboard) to power on/off the radio receiver stuff all at once.
      No wifi which may fail to connect, no VCP driver to be installed, no custom tool that i have to program.

      simple, self-contained and robust.

      1. Neat :) – I mean, I’d have gone for the ESP as well (my lighting is already running off of them and the “software” I need is just bash – stuff like echo “fade on” > /dev/udp/light-hostname/portno does it, no driver involved – I’ve not had an issue with the wifi connection since I got enough power to the ESP), but this is a clever hack and avoids a 3.3V source.

      1. Most likely to avoid plagiarism Hackaday (can?) only give as an overview and that why they give the link to the information the builders puts on the web. Read that he rejected what you suggested as not nerdy enough. Should be point scored in his column?

  2. Interesting and novel, though I’d rather just have did a simple serial interface to the mcu and wrote a simple script that did a one off burst of serial data to toggle relay. Could have linked that to a hotkeys or keyboard shortcut software of choice.

    Probably would have used a bluetooth module, and made the automatic power down a mcu side thing.

    1. Automatic power down is MCU sided already.
      I can press SCROLL/CAPS to let the “keyboard” enter the time left as keypresses.

      Good point with the BT module. Also thought of using a BT (HID Over GATT Profile) keyboard emulation.
      But that was more components/programming involved than i wanted to spend :)

      About the shortcut: Yeah, i already bound the scroll/num lock presses to my logitech G-buttons :)

    1. Yeah looked already whats available. I didnt find anything useful that is comparable.
      Found some switches for 55€ upwards that use AT commands.

      I wanted it to be as simple as toggling the scroll lock LED. No big fuss on PC side.
      There was no solution, not even the expensive 180€ ones, that didn’t need OS specific drivers or special tools.
      Some of them were also programmable and had power meters. Probably a good expansion project :)

  3. It’s a nice and simple hack, (didn’t HaD cover something like this just a couple days ago?)

    … but how does this have anything to do with Rube Goldberg style?

    I was expecting, at the very least, a fan, a ball that is tied around a pole, some scissors cutting twine that has a boot swing down to hit a power switch or something.

    False advertising!


  4. Couldn’t he just set his Digispark to emulate a serial port? Rather than having to kludge one out of an emulated keyboard?

    I suppose that’s a bit Heath-Robinson (thank you very much) in a way.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.