Pi-Pico-ExpressionPedal2Midi now with added USB
This is a Raspberry Pi Pico CircuitPython project that takes an expression pedal input via a TRS 1/4" jack connected to ADC pins on the Pico, and outputs respective Midi CC messages simultaneously to UART and USB.
Midi channel, CC number, and maximum and minimum values are customisable. Your choice of logarithmic or linear expression pedal feel.
The expression pedal is automatically calibrated. At startup, simply move your pedal from minimum to maximum. The values are determined accordingly, and CC messages will start being sent.
- Raspberry Pi Pico (loaded with MicroPython)
- ¼” jack TRS socket
- 5 pin DIN midi socket1
- 10Ω resistor1
- 33Ω resistor1
1 Required only if using midi port (non-usb)
Optional: breadboard, 40 pin male headers, pin cables, scotch whisky
Power source: Either USB or 3xAA battery holder
- Download CircuitPython and install on your Pico.
- Download CircuitPython Libraries and copy
adafruit_midi
folder tolib
folder on your Pico. - Customise the midi settings in
code.py
. Season to taste - Copy
code.py
to your Pico.
Now for the stuffing:
The expression pedal is connected to ADC0 on the Pico.
- Connect the jack sleeve to Pico ground pin (any of 3, 8, 13, 18, 23, 28, or 33)
- Connect the jack ring to Pico pin 31 (ADC0)
- Connect the jack tip to Pico pin 36 (3V3 OUT)
If you're only using USB, you're done!
Otherwise...
Midi messages are sent simultaneously to USB and UART1. If you wish to connect your Pico to a Midi port, proeceed with the following.
- Connect a 10Ω resistor to pin 6 on the Pico (UART1 TX). T’other end of the resistor to pin 4 of your midi socket
- Connect a 33Ω resistor to pin 36 on the Pico (3V3 OUT). T’other end of the resistor to pin 5 of your midi socket
- Connect a Pico ground pin (any of 3, 8, 13, 18, 23, 28, or 33) to pin 2 of your midi socket
Jubilations, you’re done.
Ashley Strahle