Making Connections: Building a USB Footswitch

by Chris Warren

The concept is simple: replace a few of the keys on a USB keypad with heavy duty footswitches. Then use the select function in Max to direct these switches to control your patch.



Disclaimer: This tutorial assumes basic familiarity with electronics and the use of soldering tools. Cycling ’74 assumes no responsibility for damages to your keypad or any other device in following this tutorial.

As a guitarist, I was looking for a simple hands-free controller for Max. Rather than buy an expensive pedalboard and MIDI interface, I decided to build a simple USB footswitch. It’s ridiculously easy to make and costs less than fifty bucks.

Here are the parts you will need:

  • USB keypad (a keyboard can work too, but is slightly more difficult to wire up—more non-ASCII key functions)
  • momentary on switches (you will find these labeled “off-(on)”)
  • fine wire
  • a box (I used a project box from the local electronics shop)

and the tools:

  • a soldering iron and solder
  • a small screwdriver
  • wire strippers

Download the Max 4.6 legacy patch and the updated Max 5 patch used in the tutorial.

First open the USB keypad. Each brand is designed a little differently, but most of them are held together with tiny screws. Some brands hide these under rubber feet or stickers. Don’t worry if you have to crack the plastic shell (it gets discarded), just be careful not to damage the circuit board itself.

Inside the enclosure, you will find a folded plastic sheet with wiring embedded in it. The keys press against this to complete a circuit. This sheet is connected to a terminal on the circuit board. Gently remove it from the terminal.

Trace the circuit on the plastic sheet to figure to see which two leads produce a desired character. Since this is a matrix, each lead is used for multiple characters so jumpers may be required. If you don’t particularly care which characters the buttons produce (we are, after all, going to be using select to filter this input data) you can skip this step. Just check each pair before you solder to make sure you don’t get results outside of the standard ASCII codes (i.e. num lock or “000”). If you want to specify the character output of each button, simply trace the circuit on the plastic sheet

Solder wires onto the terminal. There isn’t a lot of space, so you’ll probably want to use some fairly fine wire. To keep things neat, I used an old printer ribbon cable.

Drill holes in the box and mount the switches. Make sure to tighten them all the way. Then connect the wires, but don’t solder them just yet.

Run the test patch. As you press each button, its ASCII number will be displayed in the number box. Once you verify the ASCII numbers for each button, input these values as arguments to the select operator. In this example patch I ran each outlet of the select operator to an oversized bang as a simple display.

Once you have verified that the desired characters are produced, solder wires to the buttons.

Enjoy!

Afterthoughts:

Essentially this is just a cheap and easy way to connect momentary switches to your computer via USB. This same principle can be used with other types of momentary switches—percussion triggers, tilt switches or even some types of light sensors. Non-momentary switches can be used too; they will output continuous streams of repeated keystrokes. Use the change operator if you want to make these switches behave like momentary switches.

This same footswitch could also be built using a wireless keypad. How could this change the usability of the footswitch?

If you wire one of the switches to num lock, you can in effect double the number of keystrokes available to you while using the same number of switches. If you plan to do this, you may want to use a keypad that has an LED num lock indicator. If it is difficult to mount the circuit board in such a way that the LED is visible on the footswitch, consider replacing the LED with one with longer leads.

Making Connections: Building a USB Footswitch

Jan 5, 2010 at 5:34pm

You have done a great job with this. I greatly appreciate such a fine and useful piece of work. Thanks very much indeed. Kind Wishes from Ireland, ATB, Trigger

#261302
Feb 15, 2011 at 5:06pm

This was incredibly helpful. Thank you.

#261303
Feb 16, 2011 at 6:13pm

How would add LED’s to each switch? I need to know when the button is engaged (for use with latching buttons)

#261304
Apr 18, 2012 at 1:46pm

thanks for this!

#261305
Sep 3, 2012 at 3:13pm

Thanks for this, it got me started on my own pedal but I just couldn’t seem to get it working with this method, however a friend and myself managed to get it working with an arduino. http://finalprojectlcoma.blogspot.co.uk/2012/09/arduino2max.html

May help others.

-Liam

#261306
Sep 4, 2012 at 7:21am

You could use DPDT momentary switches that could also trigger LEDSs to light up for each individual switch. It’s pretty easy to set up since USB has +5v. Just run a wire from the +5v to the momentary section of each switch. Then to the positive end of an LED (usually the longer lead). Make sure you do your LED resistor math using one of the many popular online calculators. Then connect the negative lead of the LED to ground and you’re good to go.

The cheapest place to get SPST, DPDT and 3PDT footswitches is from BitchesLoveMySwitches.com. They’ve got momentary and latched versions of everything. eBay is pretty good for LEDs but can take a while. You can go to your local hardware store and use electrical junction boxes for enclosures if you’re a cheapskate. They’re difficult to work with but they cost like $2. O

#261307

You must be logged in to reply to this topic.