Universal MIDI Expression Pedal

Thundercat

Well-known member
Hey all, was considering adding a pedal input to some MIDI faders that use a Teensy 4.1. I'd like the pedal input to accommodate lots of different pedals if possible. But as many of you may know, some pedals reverse wiper/positive, and this can't be fixed in software.

Or can it?

I read a bunch, and then stumbled on a post mentioning using a digital write output for a 3.3V source.

I thought, could I get away with using one pin as a digital output pin, outputting HIGH to serve as the 3.3V source, with another pin as an analog input for the wiper...and then in software, provide a way for the user to switch these, flipping their functions (and thus obviating the need for an external switch to do same)?

Seems to me this could be a clever way of avoiding an additional switch...

I'm not clear yet if this will work.

Here's some supporting pix:
Screenshot 2025-01-31 at 1.50.26 AM.jpg


(Link to page with this post is here: https://community.gigperformer.com/t/yamaha-fc7-pedal-compatibility/8242)

I'd like to be able to support all the pedals listed.

Here's a Neutrik jack I'd use:

Screenshot 2025-01-31 at 1.51.06 AM.jpg

Also I'd like to add the ability to detect if a pedal is attached, which I was thinking about using one of the switched TRS jacks and using another Teensy pin to detect if one of the circuits is opened.

Perhaps I could use the S/SN pair essentially as a button that is closed, and when the jack is first inserted and the circuit opens, then read the open circuit...

Also there's the concern that not all pedals are the same - some are 10K; others are 50K or even 100K. Not sure how I could handle all those variations, or if it's wise to even try...I'd for sure like to support the FC7 since it's such a standard though.

Sorry this is still in the fuzzy stage but I really think there's some potential here. Any dangers of damaging the Teensy if something is inserted halfway or wrong while the Teensy is on? Or if a mono 1/4" jack is inserted instead of a stereo jack? Any additional resistors I'd want to consider adding for protection? Already I thought of adding some capacitance to the Tip to Ground and Ring to Ground, which would support both use cases if the pins were used as digital voltage source or analog input.

Also probably a dumb question but the Ground connection should definitely go to the Teensy, and not rely on just a chassis connection, correct?

Thanks for any insights anyone may have.

Mike
 

Attachments

  • 1738288746060.png
    1738288746060.png
    10.7 KB · Views: 12
  • 1738288755936.png
    1738288755936.png
    10.7 KB · Views: 11
Just to add one more thing - I need to also protect in case someone plugs in a switch-only pedal instead of an expression pedal. Expression pedals use potentiometers; switch pedals are just switches on/off. The switch-only pedals use a 1/4" mono jack, and if someone plugs a mono jack, I don't want to melt the Teensy with runaway current...this is going to go into a product and I'm concerned about people plugging the wrong kind of pedal in and being in danger, or destroying the Teensy...

Which brings up the final point, if I can figure out how to mitigate the above, then it would be relatively easy to also allow a switch-only pedal to be used too, making this a very universal pedal input...

Just asking for thoughts.

I'll post a proposed schematic soon and your expert feedback would be so valuable.

Thanks,

Mike
 
OK, here's my first attempt at a schematic for the concept. I would welcome your (even harsh) criticisms. This needs to be bulletproof.

Universal Pedal Schematic 1.jpg


Pins 14 and 15 were chosen because they can act as both digital and analog pins, allowing for T&R functions to be flipped.

The capacitors, 100nf and 1uF, are there for filtering. I know many say you only need 100nF on pin inputs, but in my experience with faders I've needed the additional 1uF too - and yes I'm using hysteresis too.

The 47R resistors are there due to a post here where @MatrixRat recommended adding 47R between 3.3V and Ring as a current limit (see https://forum.pjrc.com/index.php?threads/expression-pedal.61805/post-246421).

I added one to both possibilities here since the inputs and outputs may be flipped in software to accommodate both main styles of expression pedals.

The Pedal Detect uses the switch between S and SN to detect if a pedal of any kind is inserted. This is because in the software, when a pedal is inserted, I want to make options available to configure the pedal, but omit those options if no pedal is present.

Finally I hope to be able to also allow for a simple sustain pedal that is just a switch, which would mean the user inserts a mono 1/4" jack and T&R are shorted, using T&R together with S to form a basic on/off switch.

Please let me know if you see anything wrong here, or some additional suggestions or changes that would make this safer, more reliable, etc. This would be going into a product that people would buy, so I want it as safe and smartly done as possible.

Thank you kindly for your support. I've had nothing but amazing advice over the years from you all, so thank you for that.

Mike
 
Last edited:
Well I'm looking at that schematic I posted and I can see the two 47R resistors are not doing anything useful - if T & R are shorted, they will not current limit anything. I can be a little dyslexic/confused about this sort of thing. Of course as parallel resistors with one being 0R the 47R does nothing - the shorted terminals being the 0R portion.

And then I looked up that the max current/pin shouldn't exceed 4mA.

Using Ohm's Law, this R=V/I, this means I'd need an 825R resistor in series with either T or R to limit current to less than 4mA. Adding a 470R resistor in series with both T & R would seem to be the way to do this, cutting the resistance in half roughly and dividing it between the two pins - if T & R are shorted, then the current is limited to less than 4mA per pin. And hopefully this wouldn't affect the pedal performance.

By Ohm's Law, I=V/R, I = 3.3V/940R = 3.5mA, safely below 4mA.

If both T&R are shorted and a mono jack is used, then again, same scenario, current is limited to less than 4mA so this should work for both scenarios, of using an expression pedal or a sustain on/off pedal.

Please someone correct me if I'm wrong or missing something stupidly obvious. I can miss big things sometimes, and as the good book says "there's wisdom in a multitude of counsellors."

So here's the updated schematic:

Universal Pedal Schematic 2.jpg


I feel like this will protect the Teensy and the user in all scenarios - again feedback most welcome. Would this work for the intended purpose as well? Would I need to instruct the user to turn off the device prior to insertion of a pedal? It seems that hotswapping the pedal should be find based on the above circuit, so no need to turn off the device?

Yes, I have parts coming so I will be testing it too of course, but if you see something, say something!

Thank you all again,

Mike
 
Last edited:
Simplest way, which is safe and handles both plug polarities would be to use the pot as a rheostat:
exp_pedal.gif
Downside is it requires calibration for the max range and depending on the pot resistance the range will be different.
 
Hi @Pio, I really appreciate the time you took to share the schematic.

Would it be asking you too much to take me through the purpose/function of the components? I'm pretty clear on the capacitors - C1 is just to filter jitter from the ADC, and C2 is to stiffen the 3.3V supply - correct?

I'm not so clear on the purpose of the shottky diodes. I'm sure this is basic electricity/physics, but I can't seem to get my head around what they are doing.

I'm pretty clear on R2 I think - if 3V3 and ADC are shorted, then R2 is a current-limiting resistor so the Teensy doesn't blow up - keeps the current below 4mA so the ADC pin is safe.

So, what is R1 doing? Why is it needed?

Also, if someone inserted a mono jack, could this work as a basic switch into the Teensy?

And you said if polarity is reversed, it wouldn't be a problem. I think I understand why that is the case, but again the diodes, what are they doing there?

Finally, could I still implement the switch on the Sleeve - use a Teensy pin to detect if S and SN are closed or open, to detect if a pedal is inserted?

I'm so sorry for the noobie questions; I have a lot to learn still.

Again, I so appreciate your beautiful and clear schematic.

Oh, and I don't think it's a problem to have to calibrate each pedal - I was planning on adding a calibration scheme anyway as all pedals are different.
 
Also, sorry, one more question - I was planning to change the definitions of ADC and 3V3 pins in software to accommodate the main expression pedal wiper implementations. But I don't see how this can work with the schematic above. The shottky's are one way valves, so wouldn't that cause a problem? I think not understanding the shottky's is affecting my understanding of the whole schematic.

Thanks for any explanation, and I appreciate your time.

Mike
 
Maybe I'm missing something, or maybe I'm incorrectly over simplifying, but couldn't you just read the analog input & run that thru the map(val, in_min, in_max, out_min, out_max) function, where you set the in_min & in_max in your calibration routine, & you set the out_min & out_max based upon either the polarity detected in your calibration routine, or an operator selected polarity ??

Hope that helps . . .

Mark J Culross
KD5RXT
 
Made this simulation:

exp_sim1.png
It shows another drawback of this solution: R1 + pot inside the Expression pedal create a voltage divider with the variable bottom resistor. This changes the taper of the pot, assuming the ones used in expression pedals are linear ones. Ideally the output should also be linear with the option to remap it in software.
V sets the bus voltage (range 3.3V to 5V)
R1 sets the value of the top (3.3V pull up) resistor
R2 is the pot resistance inside the expression pedal, range set for typical values found in expression pedals (10 - 100k)
Play with the values and see how the curve and the max output voltage are changing.

Diodes are there for protection. They will clamp negative voltages to GND and anything over Vcc+Schottky diode drop to Vcc.
R1+C1 filters the noise, plus R1 acts as current limiting resistor for the clamping diodes.
GPIO on the Teensy is configured as Input, it won't be supplying any current. It has to be protected against something external trying to push too much current into the pin. It is a common way to protect the input against a voltage spikes which might appear for whatever reasons (ie. user plugging something else into the exp jack).

If the TRS jack has switches on all contacts, a simple plug presence sensing circuit as shown can be added.

There are other solutions like using a differential ADC input, often used in Boss/Roland gear (look online for service manuals).
 
Maybe I'm missing something, or maybe I'm incorrectly over simplifying, but couldn't you just read the analog input & run that thru the map(val, in_min, in_max, out_min, out_max) function, where you set the in_min & in_max in your calibration routine, & you set the out_min & out_max based upon either the polarity detected in your calibration routine, or an operator selected polarity ??

Hope that helps . . .

Mark J Culross
KD5RXT
Yes you are right, for the polarity issue where Sleeve and Tip are reversed in the pedal.

However, many pedals have the Tip and Ring reversed - which is wiper and positive.

In past that made it so you could only make a hardware device work with one or the other, unless you had a physical switch and reversed the physical connections and circuitry. Which I may still do.

I wanted to reverse the actual function of the pins in software only, so instead of the Tip having a digital write pin HIGH as the 3.3V source, change it to an analog input with an INPUT_PULLUP.

Same with the Ring - instead of it being used as an analog input, change it to a digital pin writing HIGH.

Does that make sense? I think it could work…

Thanks for your support.

Mike
 
Made this simulation:

View attachment 36807
It shows another drawback of this solution: R1 + pot inside the Expression pedal create a voltage divider with the variable bottom resistor. This changes the taper of the pot, assuming the ones used in expression pedals are linear ones. Ideally the output should also be linear with the option to remap it in software.
V sets the bus voltage (range 3.3V to 5V)
R1 sets the value of the top (3.3V pull up) resistor
R2 is the pot resistance inside the expression pedal, range set for typical values found in expression pedals (10 - 100k)
Play with the values and see how the curve and the max output voltage are changing.

Diodes are there for protection. They will clamp negative voltages to GND and anything over Vcc+Schottky diode drop to Vcc.
R1+C1 filters the noise, plus R1 acts as current limiting resistor for the clamping diodes.
GPIO on the Teensy is configured as Input, it won't be supplying any current. It has to be protected against something external trying to push too much current into the pin. It is a common way to protect the input against a voltage spikes which might appear for whatever reasons (ie. user plugging something else into the exp jack).

If the TRS jack has switches on all contacts, a simple plug presence sensing circuit as shown can be added.

There are other solutions like using a differential ADC input, often used in Boss/Roland gear (look online for service manuals).
Hi @Pio, I really appreciate your time in explaining all of that, plus the demo link. Very cool.

I want to be able to reverse the pin definitions in software, and not rely on an external switch if possible. I don't see the circuit above being reversible without an actual hardware switch, as the connections for the ADC and the 3.3V lines are not mirrors. Maybe I'm not fully understanding how you envision it would work.

But I'd like to define ADC pin as INPUT_PULLUP, so no need for the 10K resistor since it's already part of the Teensy, and define the 3.3V pin as a digital pin outputting HIGH to obtain the 3.3V.

Then if the user has a pedal that operates with wiper/3.3V reversed, I'd like to just have a setting they can change, and then reverse the pin definitions on a reboot of the Teensy.

I'm also not a fan of the extreme non-linear response, even using just a 10K pot. It's really distorted.

The shottkys' are not clear to me - you show two of them, but the BAT54S is already 2 in a row. Perhaps you meant for one shottky to be connected with the middle terminal in between, as they internally are wired like this:

Screenshot 2025-02-02 at 2.31.33 AM.jpg


So would your circuit just use one BAT54S with the middle terminal 3 connected to ADC? Otherwise I'm not clear on how you see connecting two of them, unless you mean to ignore terminal 3?

Also, is the function of R3 to limit current to the ADC in case of a voltage spike? Or is it part of a filter?

In any case, you're given me so much to think about and try to understand, and if you don't have more time to explain or share that's OK. I'm deeply grateful for what you've already given me.

Thank you again,

Mike
 
Last edited:
I want to be able to reverse the pin definitions in software, and not rely on an external switch if possible. I don't see the circuit above being reversible without an actual hardware switch, as the connections for the ADC and the 3.3V lines are not mirrors. Maybe I'm not fully understanding how you envision it would work.
with the input connection as in the posted schematic, where R+T are tied together, there is no need to swap the polarity. The pot acts as a single variable resistor in both configurations.
But I'd like to define ADC pin as INPUT_PULLUP, so no need for the 10K resistor since it's already part of the Teensy, and define the 3.3V pin as a digital pin outputting HIGH to obtain the 3.3V.
I would advice against it. It looks like the MCU used in Teensy4.1 has a few selectable pull up/down resistor values, but i'm not sure if they can be set from Arduino. Still you have to decide how much of the fragile MCU internals will be exposed to the outside world. Next question is, while using the internal pull up as R1, how do you connect the input filter/protection? If the filter is placed before the R1 the minimum/heel position won't reach 0V. Ok, this could be calibrated out in software.
Why use a digital pin set to high to obtain 3.3V instead of just using the 3.3V rail? GPIO set as INPUT_PULLUP will already have that resistor pulled up" internally to 3.3V
I'm also not sure if Teensy allows to mix digital/analog pin configurations, can you set the input as analog ADC in and enable the pull up at the same time? Probably yes in such a feature full microcontroller as the i.MX RT1062.
The shottkys' are not clear to me - you show two of them, but the BAT54S is already 2 in a row. Perhaps you meant for one shottky to be connected with the middle terminal in between, as they internally are wired like this:
I did not have a symbol for dual BAT54S, so i've used two diodes. It's just a schematic to show the idea, not the final design.
The of the diode is also non critical. BAT54S are conveniet having already two of them in correct orientation. 1 goes to GND, 3 to the input signal, 2 to 3.3V.
Also, is the function of R3 to limit current to the ADC in case of a voltage spike? Or is it part of a filter?
R3 + C1 forms a lowpass filter. R3 limits the current going into the diodes at the same time. It does both.

Now, a way to improve the design and make it even more safe for Teensy against all the unexpected operations users can perform on the input EXP jack would be to add a buffer/amp for the voltage signal. This is actually the way i've been using for years. I remember having issues with long cables (exp pedal input, shielded 2 wires) plugged directly into the ADC input. It was long ago in the ancient AVR times, today's ADCs might not experience such problems. I've put a buffer there to further isolate the MCU input from the outside world and to drive the drive the ADC with low impedance output.
Let's add a simple non inverting gain stage. This allows us to do two things:
1. Increase the R1, thus flattening the response curve for the typical exp pedal pot values
2. Adjust the gain to fully drive the ADC input range.

The new schematic looks like this:
exp_sim4.png

Simulation with a new parameter added: g (opamp gain)


I have limited the range of the expression pedal pot values to 10k - 50k, since these are the most commonly used values. 100k/Log is used in Volume pedals.
Worst case scenario is a 50k pot, we need to add a gain of 3 to bring it back to 0-3.3V range
exp_sim2.png
With 10k pot the curve looks close to linear, it needs more gain, though: 11x.
exp_sim3.png
The gain stage has a tiny trimpot, user can set the expression pedal to the max position and adjust the gain. Teensy can then read the ADC value and once it close to the max blink a led using another pin to inform the user the setting is correct.

That gain could be just a buffer if we don't care too much about the ADC resolution. Perhaps doing the gain stage in software + adding a lowpass filter would smooth out the expression pedal signal enough.
Still, one of the tasks for the opamp is to isolate the ADC input, having it there already, why not use it to boost the signal to fill the ADC input range and use all the available resolution.

Sorry for the long post!
 
with the input connection as in the posted schematic, where R+T are tied together, there is no need to swap the polarity. The pot acts as a single variable resistor in both configurations.

I would advice against it. It looks like the MCU used in Teensy4.1 has a few selectable pull up/down resistor values, but i'm not sure if they can be set from Arduino. Still you have to decide how much of the fragile MCU internals will be exposed to the outside world. Next question is, while using the internal pull up as R1, how do you connect the input filter/protection? If the filter is placed before the R1 the minimum/heel position won't reach 0V. Ok, this could be calibrated out in software.
Why use a digital pin set to high to obtain 3.3V instead of just using the 3.3V rail? GPIO set as INPUT_PULLUP will already have that resistor pulled up" internally to 3.3V
I'm also not sure if Teensy allows to mix digital/analog pin configurations, can you set the input as analog ADC in and enable the pull up at the same time? Probably yes in such a feature full microcontroller as the i.MX RT1062.

I did not have a symbol for dual BAT54S, so i've used two diodes. It's just a schematic to show the idea, not the final design.
The of the diode is also non critical. BAT54S are conveniet having already two of them in correct orientation. 1 goes to GND, 3 to the input signal, 2 to 3.3V.

R3 + C1 forms a lowpass filter. R3 limits the current going into the diodes at the same time. It does both.

Now, a way to improve the design and make it even more safe for Teensy against all the unexpected operations users can perform on the input EXP jack would be to add a buffer/amp for the voltage signal. This is actually the way i've been using for years. I remember having issues with long cables (exp pedal input, shielded 2 wires) plugged directly into the ADC input. It was long ago in the ancient AVR times, today's ADCs might not experience such problems. I've put a buffer there to further isolate the MCU input from the outside world and to drive the drive the ADC with low impedance output.
Let's add a simple non inverting gain stage. This allows us to do two things:
1. Increase the R1, thus flattening the response curve for the typical exp pedal pot values
2. Adjust the gain to fully drive the ADC input range.

The new schematic looks like this:
View attachment 36824
Simulation with a new parameter added: g (opamp gain)


I have limited the range of the expression pedal pot values to 10k - 50k, since these are the most commonly used values. 100k/Log is used in Volume pedals.
Worst case scenario is a 50k pot, we need to add a gain of 3 to bring it back to 0-3.3V range
View attachment 36822
With 10k pot the curve looks close to linear, it needs more gain, though: 11x.
View attachment 36823
The gain stage has a tiny trimpot, user can set the expression pedal to the max position and adjust the gain. Teensy can then read the ADC value and once it close to the max blink a led using another pin to inform the user the setting is correct.

That gain could be just a buffer if we don't care too much about the ADC resolution. Perhaps doing the gain stage in software + adding a lowpass filter would smooth out the expression pedal signal enough.
Still, one of the tasks for the opamp is to isolate the ADC input, having it there already, why not use it to boost the signal to fill the ADC input range and use all the available resolution.

Sorry for the long post!
Absolutely incredible @Pio - seriously you've been so incredibly generous with your wisdom and your time! Honestly, your response is an absolute wealth of information!!!

I will go through it slowly to understand it as well as I possibly can. I can't thank you enough!

One quick response - the reason I wanted to be able to flip 3.3V and the input pin via software is because various manufacturers do it both ways, some use the wiper as the 3.3V and some use the Ring, and I wanted to be able to switch the configuration in software only so I could essentially support all, or most, expression pedals out there (as well as sustain switch-only pedals too). That's why I wanted to use a digital pin for the 3.3V source, because otherwise of course just using the 3.3V rail is perfect.

This may be too hard to do, or it may not be possible to do it safely, but I have a feeling it is possible somehow.

Otherwise, I could have a hardware switch to implement the circuitry you have suggested, which I'm sure is fabulous. I just wanted to be able to do it all from software, yet still retain the safety features. That's why I was asking if the circuitry is mirrored (which it isn't).

I may still go with an external hardware switch to implement your suggestions because they look amazing. I'm just wondering if there's a way to make the whole thing mirrored hardware/component-wise on the 3.3V and the Wiper lines. That way the user could select the pedal from software only, or better yet, I could probably figure out how to auto sense it like the MIDI Expression linked above.

In any case - I'm going to respond more fully but I just wanted pop on and thank you a hundred times for your incredibly generous and thoughtful response. Thank you again for being so kind and generous with your IP and your time.

Mike

PS can I ask what software you are using to generate the schematics? They are very clean and professional. thank you!
 
Last edited:
Hi again @Pio, just a question on the inputs - it looks like T and R are both connected?

Am I understanding the schematic correctly? I guess I'm not clear on how this could work then? Is this circuit meant to somehow handle if T/R is flipped to R/T in the pedal somehow? Sorry if this is obvious...

Screenshot 2025-02-04 at 12.32.07 AM.jpg
 
Back in the days of old (yes, I am that old), we used to use CD4066 digital switches to be able to route signals from anywhere to anywhere under microprocessor (8051 and/or 8085) control. I don't know what a modern-day equivalent of the CD4066 might be (the switch-to-switch isolation was only nominal-to-fair back then), but something along those lines would allow your user to select an input "style" (TRS, RTS, TSR, etc.) & your Teensy would activate the corresponding "switch routing selections" to connect the signals as desired to specific Teensy pins, with appropriate discrete filtering/protection as described above . . . just thinking out loud . . .

Mark J Culross
KD5RXT

EDIT: and if you were just swapping TIP & RING, you could do that either with only one Teensy output pin & a digital inverter, or with two Teensy output pins that you drive to opposite states (HI/LO or LO/HI) & no additional digital inverter, depending upon how tight you are on I/O pins. MJC
 
Last edited:
Back in the days of old (yes, I am that old), we used to use CD4066 digital switches to be able to route signals from anywhere to anywhere under microprocessor (8051 and/or 8085) control. I don't know what a modern-day equivalent of the CD4066 might be (the switch-to-switch isolation was only nominal-to-fair back then), but something along those lines would allow your user to select an input "style" (TRS, RTS, TSR, etc.) & your Teensy would activate the corresponding "switch routing selections" to connect the signals as desired to specific Teensy pins, with appropriate discrete filtering/protection as described above . . . just thinking out loud . . .

Mark J Culross
KD5RXT

EDIT: and if you were just swapping TIP & RING, you could do that either with only one Teensy output pin & a digital inverter, or with two Teensy output pins that you drive to opposite states (HI/LO or LO/HI) & no additional digital inverter, depending upon how tight you are on I/O pins. MJC
Fantastic ideas!

In fact I was headed that way thinking about using a relay or an analog switch IC, which sounds similar to what you suggested.

Probably an analog switch would be the way to go because it’s solid state and then I could implement the protection circuits @Pio suggested above (although I still don’t understand why T and R are connected in the schematic above).

Thank you Mark, that was very insightful and helpful.
 
R+T tied together - this is what i have been trying to explain in the previous posts. Maybe this picture will explain it better.
Let assume we have the Exp pedal jack configured as: T=signal/wiper, R=toe position/pot top setting, S=heel position/min setting.
Plugging a pedal with a reversed R+T will create a short between the R and S in the minimum position. R is where usually some kind of reference voltage is supplied. Might be dangerous if it's a 3.3V rail unless it has a current limit protection.
Using R1 =100k and connecting the R+T creates a classic two resistor voltage divider with the bottom resistor being the pot inside the expression pedal.

And that's it. No need to do any complex rerouting, switching etc. The only price paid for that configuration is the non linearity, which as shown above can be limited and perhaps even calibrated out in the software.
A bonus is such an input can be used for a footswitch, too. It had to use a TRS jack, though. A mono TS jack would cause a permanent 0V reading.
exp_pedal3.gif

What i would probably want to do with the previous schematic (with the opamp stage) is to eliminate the trimpot and do the gain setting automatically. It's not like the pot values can have a value of anything between 10k and 50k, rather 10k, 20-25k and 47-50k being the standard values. One idea could be to make the opamp gain control switchable instead of continuous, giving the correct almost full ADC range with the final adjustments done in software.
This could be relatively easy with Teensy's GPIOs configured as OUTPUT_OPENDRAIN and using a combination of 3 resistors:
exp_pedal4.gif
 
@Pio. Ok, first of all, absolutely brilliant! You are so far ahead of my understanding and I start to get what you're doing here. Just fabulous!

I wonder if a digital pot could be used for RV1? Something like this: https://www.mouser.co.uk/datasheet/2/609/AD5246-1501599.pdf

Ideally, I'd like it all controllable from the MCU. I should have plenty of pins as I'm using a Teensy 4.1, so an additional pin for RV1 control wouldn't be an issue.

Also, all the foot switches I've seen are just mono 1/4" jacks. I wonder if an additional pin could be used tapped between T/S, something like this?

Footswitch too.jpg


ADC2 is just another pin and when a footswitch closes, then T/R are shorted to ground, which should then operate as a basic switch. Unless this would conflict with the rest of the design somehow...

If you think something like the AD5246 could work, I can propose the connections, unless you wanted to...

Just amazing work, and beautifully simple.

Thank you so much @Pio.
 
Mono jack will not work with this socket configuration. A mono jack has the Sleeve+Ring as one contact. The jack socket in the circuit above has the T+R shorted = all three contacts will be shorted to GND, no matter what the switch position is.

AD5246 would work. MCP4017/18/19 is cheaper.
 
Mono jack will not work with this socket configuration. A mono jack has the Sleeve+Ring as one contact. The jack socket in the circuit above has the T+R shorted = all three contacts will be shorted to GND, no matter what the switch position is.

AD5246 would work. MCP4017/18/19 is cheaper.
Got it - didn't realize that in a mono jack S&R are shorted, but of course they are.

But, there's always a way.

A digital switch/relay SPST NC could be put at this junction for a foot switch:

Screenshot 2025-02-04 at 12.32.07 AM.jpg


Then in software for a foot switch, the switch could be opened.

Thanks for the tip on the parts!
 
Hi again @Pio, I have a question about the op-amp version of the circuit.

I understand that RV1 controls the gain of the op-amp. I also notice in your simulation, if you change the expression pedal from 10K to 50K, the voltage can spike super high instantly if RV1 is not adjusted prior to inserting the pedal jack.

I'm wondering how safe this would be for the MCU? Forget using a digital potentiometer for a moment for RV1 - if you were doing the adjustment with an actual pot, it would have to be done before a pedal is plugged in or there's a risk of the gain being too high and the input voltage to the MCU being way too high. Am I understanding this correctly?

Can you help me understand this a little better?

I'm sorry to ask so many questions. I've spent a lot of time with the awesome schematic you shared, and I just want to understand it better.

I appreciate it.

Mike
 
Opamp is powered from the same 3.3V as the Teensy. If the gain is too high the signal will be simply clipped at that level. The amp can't produce an output voltage that is higher than it's power rail. At least not in this application.
In practice it will make the expression pedal reach the max value much earlier than the toe position.
 
Opamp is powered from the same 3.3V as the Teensy. If the gain is too high the signal will be simply clipped at that level. The amp can't produce an output voltage that is higher than it's power rail. At least not in this application.
In practice it will make the expression pedal reach the max value much earlier than the toe position.
Thank you so much for explaining this!
 
Back
Top