I recently saw a blog post on the Adafruit site for a Three Button Foot Switch. I started thinking about it and thought it could be a fun project and maybe useful, but I wanted to make it more expandable.
I found the Foot Switch model created by OK1HRA and thought the design was perfect. I had a bunch of micro switches from a previous project and designed my version to use this switch.
I made it so the switch was screwed in and added a slot so the cable could be soldered to the switch outside of the foot pedal and then inserted. This way if the switch goes bad, it can be replaced.
I previously built a little macro keypad using a Raspberry Pi Pico and thought it would also work well for this project. I needed a place to put the Pico so I built a control box and added some 3.5mm Stereo 3-Pole (3-Pin) TRS Plug Jack Sockets so I could use some 3.5mm Male Plug 3 Pole Stereo 1/8" 3.5mm Plug Jack Connectors to connect everything.
Currently, the control box can connect up to 4 foot pedals. The Pico has 23 GPIO pins so technically it could handle a lot more pedals.
Parts
Here is what is needed to make all 4 foot pedals and 1 control box:
Everything is printed in PLA. The pedals are not meant to be stomped on so PLA should be fine. Supports are needed for a few areas. Just make sure you put blockers around any of the screw holes. They are small enough not to need supports. Tree supports worked well for me.
Code
I used the original code from the blog as a starting point for my code. I am not a CircuitPython expert. I know enough to make things do what I want them to do. There may be a better way to do things than how I did them.
I have added comments to the code. Hopefully, it will make sense. If you have questions, let me know and I will try to answer them. I will continue working to better document the code.
Wiring
The wiring is pretty basic and requires some minor soldering. I will work on a diagram.
Double-check connections from the switch to the Pico to make sure everything works.
Installing switch
The foot pedal has a slot in it for installing the switch cable (see picture). Before doing this, install the strain relief clip. It is very small and may not be easy to install. Look at the close-up picture of the installed switch and note the orange clip. You may decide to use a dab of hot glue, a small cable tie or something else. Make sure to use something so the wire can not get pulled out.
Adding code to Pico
If you have never installed CircuitPython on a Raspberry Pi Pico, Adafruit has a nice page on how to do it.
Also, install the adafruit_hid library from the Adafruit CircuitPython Bundle.
Once CircuitPython and the adafruit_hid library are installed, copy the copy.py file to your Pico.
The code is set for 4-foot pedals that do the following:
I have added comments in the code so hopefully it is easy to adjust and/or expand.
Control Box
The lid to the control box is connected using a piece of filament. The hole goes all the way through the lid so a single piece can be used. If the filament slides out, there are 2 cutouts on the back of the lid where you can put a drop of glue to hold the filament.
Hopefully, somebody can come up with a great use for this. If you do, please let me know.
If there are any questions, please add them to the Comments section.
Updated 8/3/2024
The author remixed this model.
Remodeled to use a different type of switch and to make it easier to add the switch. Also added some other parts to expand the functionality.