A Foot Pedal for the Computer Keyboard
by JanHerman in Circuits > Computers
859 Views, 10 Favorites, 0 Comments
A Foot Pedal for the Computer Keyboard

It has been a number of years since I thought it would be useful to have certain keys on the keyboard also in a foot pedal. And then of course those keys for which you regularly need two hands, such as Shift, Control and Alt. But this was never urgent enough to actually make it. Until I recently watched an instructional video on YouTube that involved my both hands. Pausing or rewinding something is then an unproductive interruption. The irritation about this was great enough to now develop a suitable foot pedal.
How does a computer keyboard actually work?
In a keyboard, each key makes a certain contact in a matrix. A matrix consists of lines and columns, like a table. A contact made is, for example, 'R2C3' (third cell in the second line, if at least the counting starts at one, and not at zero). The chip in the keyboard generates the corresponding keyboard code and transmits it to the USB output. Building something like this seems like it will be a huge job (matrix, chip, USB connection, printed circuit board, etc.) but the reality is very simple.
Don't worry: your existing keyboard remains completely intact, everything continues to work. The new foot pedal device is connected to a separate USB port on your computer.
Supplies
Materials required:
1 cheap computer keyboard
3 stereo 3.5mm jack connectors (or less)
8 stereo chassis stereo jack connectors (or less)
3 foot pedals (or less/more) E.g. Aliexpress IMC Hot SPDT Nonslip Momentary Electric Power Foot Pedal Switch
1 to 2 meters two-core thin cord
1 small piece of Veroboard on something similar
1 or 2 Dupont connectors (or solder tabs)
1 small enclosure
Buy a Cheap Keyboard
Buy a cheap keyboard, open it and unscrew the (only) printed circuit board containing the electronics. Then you have a complete set including USB cable to the PC. In my case I bought an Acer USB Black QWERTY type DP.PR2EE.X71 for 11 euros, but much cheaper is also possible. The circuit board has a 26-pin contact strip placed below two membranes on which the keyboard contacts are located. Between these two membranes you will see a blank membrane with holes at specific points. The holes make it possible for the two outer membranes to come into contact with each other at certain points, by pressing a keyboard key (button). We no longer need these membranes, nor the keyboard buttons (maybe you have neighbor children who want to play with them).
Prepare the PCB

The tongues of the contact strip must first be cleaned with methylated spirit or something equivalent, then pre-tinned and in my case first treated with flux. The tongues are very thin and fragile, and because several wires will sometimes lead to one strip, it will be necessary to connect the entire contact strip to something more robust, with which you can continue working. I opted for mounting on a piece of veroboard and two Dupont connectors (connected in parallel, see photo), but that could also be one connector or solder tabs. Carefully solder 26 wires to the contact strip and connect them to the Dupont connector or solder tabs.
Which Commands Do You Want

Choose which commands you want in a foot pedal. I chose Shift, Alt, Arrow Left, Space, Esc, Control, Enter and Arrow Right. Of course we're not going to connect eight foot pedals to that. I use a maximum of three pedals, which are then connected using a simple 3.5mm (stereo) jack to the chassis connector on the box, in which the whole thing is housed. Next it is time to puzzle out which matrix points correspond to the selected commands. Connect the PCB to the PC using the USB connector and run through the various options with a wire. On my PCB the tongues of the contact strip are numbered with R0..R7 and C0..C17 for the lines and columns respectively. So start at R0, then connect it, with a short pulse (!), to C0 and so on until C17 is reached. Repeat until R7 has finished. At https://w3c.github.io/uievents/tools/key-event-viewer.html you'll find an event viewer that indicates which key command you have found.
Prepare the Housing

Choose (or make) a housing, mount the PCB and the jack chassis connectors to which the pedals will be connected. Next connect each jack chassis connector to the corresponding two contact points found. Leave the earth pins open.
Buy and Prepare the Foot Pedals

Buy as many foot pedals as you think you'll need. The pedal must have a 'momentary' switch. Connect this switch to a wire with a (stereo) jack connector. The choice of pedals is large. I bought three pedals on Aliexpress for just over 10 euros together. The rectangular shape of these pedals is suitable for placing two pedals so close together that they can be pressed simultaneously (for example for Alt+Ctrl). Sewing machine pedals (where you must remove the resistors) are also possible, but are much more expensive.
Finaly, connect the pedals to the device and the device to your pc and test!
Enjoy
There is a ready-made solution on the market: A programmable USB pedal where a key (combination) can be selected in an associated application. This costs about 30 euros. It is unclear whether you can connect multiple pedals at the same time, it does not seem so. The price would also increase significantly. But if you think one pedal is enough, then this is a solution.
When watching my YouTube instruction video I use three pedals: left arrow, space, right arrow. This way I can easily pause, rewind or fast forward while keeping my hands in position. In another application where many Ctrl Alt Shift combinations are used, I connect the pedals differently. It sometimes takes some getting used to, but I should have done this years ago.