Quick Keyboard Hack to Control Heavy Loads

When you want to control an external device (like a lamp) from your computer, you might reach for a USB enabled micro. Looking for an inexpensive and quick option to control two lamps [Pete] wanted to control a couple 12 volt halogen lamps, he reached for his keyboard and used a little bit of python.

Desktop PC keyboards have 3 LED’s indicating lock functions, hardly anyone uses the scroll lock, and on a laptop with no keypad, numlock is no big loss as well. Adding wires to the little PCB out of a USB keyboard the numlock and scroll lock LED’s 5 volt output was redirected to a switching circuit.

That switching circuit takes the output of either LED, inverts it with a PNP transistor, then connects to the gate of a FQP30N06L, “logic level” mosfet transistor to handle the heavy lifting. Once the wiring is in place a fairly simple Python script can take over turning on and off the two chosen lock keys, giving  control of up to 32 amps with the touch of a button.

20 thoughts on “Quick Keyboard Hack to Control Heavy Loads

    1. Where are you buying your keyboards from? Or, alternatively, where are you buying your teensys from? You can usually pick up a keyboard for a couple of quid; even less if you pick up someone elses old one. teensys are usually about £20ish

  1. PIC 18F2550 is about $2 on eBay, it has native USB interface, 2k of RAM, runs at up to 96MHz … also there is that thing called Arduino Nano.
    However this is the cool hack, giving some purpose to scroll lock LED is nice option. I wish some keyboard manufacturer realized that and put general purpose out connector on keyboard.

  2. How odd, I was considering doing this very thing with my keyboard a couple weeks ago, I was going to glue an LDR to the scroll lock LED of the keyboard instead of hacking it open though. But I keep my keyboard on my lap most of the time and I don’t want to deal with extra wires coming off it. I suppose that could be remedied with change to a cord with more wires though…

  3. On most laptops with no numpad some of the ordinary keys become the numpad when Num Lock is on (for me UIO becomes 456, JKL becomes 123 etc.) S6 5f 5 d5d th5s, th5s 5s what everyth5ng 5 ty*e w643d 3662 352e when the 3a0* was 6n.

  4. MAME has long supported mapping some of the original games’ cabinet lights to LEDs – I think even the Q*Bert pinball thumper can be triggered via CAPSLOCK light or something. Atari had several games with individually lighted Player 1 and 2 “volcano” buttons once you had put in enough coins.

  5. Cool idea have done similar things when I was a teenager and didn’t yet have microcontroller powers. On another note this post makes me miss parallel ports…

    Oh also I wonder what type luck one would have use a pre-amp circuit wired directly to an audio output through some passive highpass/lowpass (notch?) filters interfaced with a flip/flop. Turn on tone once lamp on again lamp off.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s