Automate repetitive PC actions with a foot pedal


Instructables user [bkovac] was sick of clicking the terminal icon on his desktop whenever he wanted to launch a terminal window. Keyboard shortcuts aside, he figured the easiest way to take the tedium out of the process would be to launch terminal windows with a foot pedal.

He grabbed a pedal that he had sitting around in his workshop and took it apart to ensure the switch contacts were configured for his particular use. The wires were run to an Arduino which talks to the computer over serial using a Python script.

While the setup works just fine, it’s definitely not the most efficient or simplest way of getting the job done. In fact, we have seen other methods that are quite a bit simpler, though they lack the potential versatility of this particular modification.

Rather than simply loading a terminal window on his computer, we would love to see this pedal enhanced to perform multiple functions – at which point the Arduino would be a pretty decent choice. We would probably start out by swapping out the full-sized Arduino for a Teensy, mounting it inside the pedal. Multiple foot presses could be used to trigger different events, based upon the number of presses that occur within a given time period. It could be made even more useful by using it to trigger gesture-based events, similar to those seen in plug-ins for Chrome and Firefox.

How would you enhance [bkovac’s] pedal interface? Let us know in the comments.


  1. Ferg says:

    I would love to see this enhanced to simulate the scroll wheel for reading.

  2. maloushe says:

    Way too much time and expense…

    Like the one in the second link, why not just pull the PCB out of a USB keyboard and hook the switch(es) up to a regular or esoteric keystroke?

    Key re-mapping / macro software can be used too.

    What’s the advantage of doing it this way?!

  3. Aaron says:

    I’d probably dig up a second one and use them to cycle input focus backward and forward through open windows, in order to have one less reason for needing to take my hands off the keyboard. It’d be nifty to have press-and-hold change virtual desktops, too, and probably easy enough to implement.

  4. FoxxCommand says:

    Makes me think of the set-up in Metalocalypse..

  5. Grovenstien says:

    i really want to do this for the esc key when i use AutoCAD. Esc and return are the two keys i use very often all day long! So much so i have polished the lettering off of them!

  6. adam outler says:

    How would I improve it? Search for the Awesome Button. That’s what id do.

  7. Flip says:

    A few years ago I created a 1-key-keyboard project, which is a lot simpler if you ask me. Later I expanded this to a 4-key-keyboard, which can also emulate multiple keys pressed simultaneously, so any system shortcuts can be triggered by pressing just 1 button (or foot pedal if you want)


  8. Andrew says:

    Why not hook the switch up to the serial input lines, like CTS or DSR? Have Python monitor the line and do something when the line changes state.

    No Arduino required.

  9. Anne says:

    I’d love to talk about the software end of this. I got hold of an older USB transcriptionist’s pedal. I want it to keep it’s function with my transcribing software, but I want to change the functions for other applications. Some pedals have the capacity to do that out of the box, but I have a hunch it’s a software thing and not a hardware one.

  10. ProfP says:

    Over engineered! Use the switch to link the handshake lines on the serial port (e.g. CTS & RTS), monitor with your script and you are golden.

  11. AdoZ says:

    What Andrew said. I’ve done that to implement input buttons for PC’s used in production line applications to significantly reduce the need for mouse and keyboard input. (RI can also be used. I think DCD/RLSD should also work though I haven’t used it).

  12. Matt says:

    Replace the switch with a pot, or sone sort of sensor to detect how far the pedal is being pushed down. You could then map it to do heaps of different functions. You could make it zoom in and out of the application you are in – photoshop or gimp comes to mind, when you want to zoom in for short periods of time.

  13. bkovac says:

    Well this was the first try, i haven got any keyboards or keyboard interfaces :( left :(, and for these signals, well I forgot about them and they aren’t on my homemade USB to serial converter.

  14. Aaron says:

    Y’all with the idea to do it in a serial port: meh. No good for modern laptops, for a start, unless you’ve got a USB-to-serial converter lying around or $30 to buy one — talk about overdoing things, I’d say that’s a good example of it.

    Actually, thinking about it, the first thing I’d do to improve the pedal would be to stick a 1/8″ mono TRS plug on the end of the cable, then build all the smarts into a little box with a 1/8″ mono TRS jack on one side. That way, if I come up with another bright idea that needs a pedal a week from now, I can just trade back and forth. I can also replace the pedal with another kind of SPST switch, too, either for prototyping or if I decide a different kind of switch would work better for a particular task.

  15. ProfP says:

    @Aaron – you did RTFA didn’t you – he has got a serial port. If he didn’t have a serial port, an nice arduino free alternative would have been to use a 555 wired as an astable multivibrator to generate a tone into the sound card, and intercept that. Or bit bang a single character into the homebrew USB-serial adapter using hardwired logic for each press if handshaking really isn’t an option. Either way, introducing a microcontroller to pass simple switch info is a sledgehammer to crack a hack and whilst admirable as a project, a bit lacking in ingenuity.

  16. MattQ says:

    I love this. I love the idea of using the foot more on a computer. Mine just tap the foot of my desk idly while I work. I would love to see a three pedal version, done with driving pedals. The clutch could switch desktops or windows, the accelerator would bring up more terminal windows, and the brake could be configured for whatever. If I had some free time, I would totally do this!

  17. jeff says:

    Combine it with an eye-tracker; when you tap on the peddle, whatever window you’re looking at gets brought to the front. Hold the pedal down for a moment longer than a tap, front-most window goes to back. No more alt-tab shuffle when you have a bunch of stuff going on!

  18. msc says:

    It wouldn’t have been featured on HAD if it didn’t have an arduino.

  19. fartface says:

    “Key re-mapping / macro software can be used too.

    What’s the advantage of doing it this way?!”

    ADHD person looking for a distraction… This is too easy to click on a icon…. Hey I’ll spend 6 hours dinking around to do it with my foot….

    Look! I’m saving time! I saved 65,534 clicks! the pedal will pay it’s self back in time in 543 years!

    VERY Useful for a foot pedal auto hide the web browser when the boss comes around the corner, launching a terminal window? Kinda silly.

  20. Aaron says:

    @ProfP: I did not RTFA closely enough; I see he does have a serial port. Still, I can see some possible benefits to the presence of an MCU, especially if you want to do more with the switch later, like sending a different keypress on press-and-hold.

    (On the other hand, I’d just stick the MCU in by itself, rather than the whole prototyping board. What’s an Arduino cost, like thirty bucks?)

  21. Anonymous says:

    “open up a terminal console and cd to the location of the file. And type python”


    Yo dawg, I herd you lieked opening terminals, so I put a foot pedal on yo terminal, so you can open terminals.

  22. phisrow says:

    A move to a Teensy would, arguably, have considerable advantages besides those of size: Since the Teensy is a direct USB device, not a USB-serial-converter, you can configure it to directly act as a USB HID device, and generate arbitrary keystrokes. Boom. Works without any software(aside from a HID keyboard driver, which everything has). Want more buttons, or macros, or something? it has enough I/O and onboard memory to allow all sorts of individual keys, or keystroke sequences, to be stored and played back in response to environmental inputs.

    Honestly, I’m a bit surprised that the availability of the Teensy(and cheap stomp-pedal boxes) hasn’t more or less murdered the horribly overpriced specialty assistive devices for foot control niche…

  23. Mark O'Malley says:

    There were, years ago, foot pedals marketed as shift key alternatives. Don’t know if that remains the case. Seems to me this would be much more useful for a single command foot switch.

  24. Squirrel says:

    Guake ftw

  25. abobymouse says:

    Someone needs to trawl through hack-a-day and tag any project that could be used for accessibilities – or set up some open source accessible hardware website.

    this stuff costs a fortune from regular suppliers.

  26. Mark O'Malley says:

    @abobymouse – I suspect that this is the case due to the fact that with many with accessibility needs, the equipment cost is being paid by an insurance or gov’t entity. There is very likely a market here for a low-cost supplier, if anybody is looking for a way to make a buck. Produce a polished prototype, contact some of the larger insurers, and you’re making moolah.

  27. twopartepoxy says:

    i like this. simple, but thats good. how about one for each foot (or even each toe?), an eye tracker, then get something that you can control with mouth/tongue movements and/or responds to simple sounds/grunts. maybe even throw in a brain/eeg gizmo. you might look a bit odd using it but no odder than somebody talking into a handsfree mobile phone mic whilst walking down the street.

  28. Gavin says:

    You can configure the Stealth Switch or Stealth Switch 2 to do whatever you want, and they are only about $40.

    You can also add four more foot pedals (or other types of 3.5mm mono plug switches) to the Stealth Switch 2. I have one sitting on my desk right now.

  29. Kris says:

    I did this years ago by cutting up a $10 usb gamepad and wiring up the buttons to 1/4″ mic jack. Then I bought a bunch of cheap guitar pedals (which have 1/4″ male mic plugs) and they plug right in. Then I used a key mapper to map the button presses to keystrokes. I used to use it in WoW to control multi-boxing. I thought about selling the idea, but now Logitech has a USB foot-pedal for like $30.

  30. ewanuno says:

    wouldn’t it be much simpler to just use a usb joystick?
    just hack up one old game controler, solder up a switch. and make a simple glovepie script?
    then you could use that arduino for something more interesting.
    the arduino is a fantastic thing,it irks me to see it used for such simple ‘hacks’.

  31. veneficus says:

    I used 4 STAPLES buttons and modified them as foot pedals and used them with x-keys macro keyboard in the past to automate repetitive keystrokes. However the STAPLES buttons are not that sturdy and eventually need carbon on their pads to function again. If you do repetitive tasks on the keyboard I recommend the x-keys keyboards, you can create a macro on the fly with ease as it records as you type. I found it easier to operate than AutoHotKey.

  32. doubleup says:

    For those who complain about using too much of a microcontroller for such a simple project, just envision a post-apocalyptic scenario. These things could be everywhere, with re-programmable hardware.. I like the idea, maybe I’ll start over-engineering everything.

  33. kyrannian says:

    Seems like the perfect tool to use as your spacebar. I’m constantly using that key, and as an added bonus you could put on some music and type to it.

  34. echodelta says:

    If you play piano etc you need the sustain pedal. Three pedals are standard for a grand.
    For starts backspace and forespace and maybe enter. would make typing and browsing easier. Since I don’t dwino, cheap usb and 2 or 3 switches. Before I do that I have a slim 25 note pedal-board to wire up to a keyboard so I can pedal a soft-synth like ZynAdd. Simple and standalone, separate output from the main sounds.

  35. GB says:
  36. hexagon5un says:

    I’ve built more than a few USB peripherals with an AVR Tiny45 and the VUSB firmware. That’s the way I’d go.

    Slightly modify the code from e.g. to open up a terminal when the switch is closed and you’re done.

    Total cost < $2.00. Bam!

  37. Antony Van der Mude says:

    Well, to take this to its logical conclusion, take an old pipe organ, replace the keyboard with (one or more) computer keyboards and go to town! You’d have at least a couple of dozen foot pedals, and you could use all those knobs (stops) for extra control (What do you get when you press Shift-Ctrl-Alt-Gemshorn-Doublette-Bourdon C?)

  38. nightHawk says:

    Heck, why not go ALL the way and strap a couple mice to your feet!

  39. twall says:

    or even better: put your smartphone on the floor and send each tap of your right pinky toe via bluetooth to your laptop!

  40. Sean says:

    FYI, the best product out there in terms of programmability and flexibility is the Fragpedal. As Aaron suggested, it could be configured to switch windows on a tap, and do something else on a hold — say, Show Desktop.
    It supports different actions on press/release and on tap/press/hold (with configurable timing thresholds), so it’s very hacker friendly.

Leave a Reply

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

You are commenting using your 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