Automate Repetitive PC Actions With A Foot Pedal

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.

41 thoughts on “Automate Repetitive PC Actions With A Foot Pedal

  1. 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?!

  2. 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.

  3. 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!

  4. 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.

  5. 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.

  6. 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).

  7. 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.

  8. 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.

  9. 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.

  10. @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.

  11. 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!

  12. 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!

  13. “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.

  14. @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?)

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

    What.

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

  16. 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…

  17. 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.

  18. 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.

  19. @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.

  20. 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.

  21. 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.

  22. 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’.

  23. 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.

  24. 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.

  25. 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.

  26. 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?)

  27. 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

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.