# Stepped output voltage values with switches for a music project

#### HurdyGuigui

##### New Member
Hello,

I am new on this forum. I am professional musician and use to be a computer engineer, I have done electronics in the past but it has been a long time.
My project is related to music gear and how to control some musical effects with a home made foot pedal that I want to build.
Now I am using an expression pedal to control some effects parameters in my effect processor. Basically it is a 100k potentiometer plugged into the expression port of the the effect processor which is a TRS jack connector. The TRS plug deliver 3,3V from tip to sleeve and the potentiometer give back the reduced tension from ring to sleeve.

So electronically speaking, I have 3,3v at input of my circuit, now I use a potentiometer to have a variable tension from 0v to 3,3v at output.
I would like to replace the potentiometer with 12 momentary switches to have 12 stepped output values :
Press switch 1 : output = 0v
Press switch 2 : output = 0,3v
Press switch 3 : output = 0,6v
Press switch 4 : output = 0;9v
Press switch 5 : output = 1,2v
Press switch 6 : output = 1,5v
Press switch 7 : output = 1,8v
Press switch 8 : output = 2,1v
Press switch 9 : output = 2,4v
Press switch 10 : output = 2,7v
Press switch 11 : output = 3v
Press switch 12 : output = 3,3v

Note that the tension at output needs to stay still once the switch is pressed, and change only when the next one is pressed.

Do you have any idea how to achieve this?
Any help will be very appreciated.

If you are curious about my music, you can go check my YouTube channel, I play an electric hurdy gurdy : https://www.youtube.com/c/guilhemdesq

#### ronsimpson

##### Well-Known Member
I can not find what I am looking for. This is a push button switch. It can be set to latch. Push on-Push off.
I have used them in a bank. In your case 12 next to each other. Switch 5 is on and all the rest are off. If you push button 7 as it turns on it will release all of the switches that are on. (wants to have only one on at a time)
There is a piece of metal that hold all 12 switches together and resets all the switches at one time.
I have seen these used on very old car radios and some TV sets to set channels.

Do you know how to connect the resistors to make the circuit do what you want?

#### gophert

##### Well-Known Member
Without using a microcontroller, an easy way will be as follows. Only 7 voltages drawn to save space.

This **assumes** you will push a button every 10 minutes to an hour. You may see a few mV sag over longer periods of time.

Use a good quality/low leakage film capacitor.
Instead of the resistor pairs, use 15-turn trimmers to dial in each of the 12 voltages.
Use an op amp with JFET inputs so no current flows into them.

Last edited:

#### rjenkinsgb

##### Active Member
I can not find what I am looking for. This is a push button switch. It can be set to latch. Push on-Push off.
I have used them in a bank. In your case 12 next to each other. Switch 5 is on and all the rest are off. If you push button 7 as it turns on it will release all of the switches that are on. (wants to have only one on at a time)
There is a piece of metal that hold all 12 switches together and resets all the switches at one time.
I have seen these used on very old car radios and some TV sets to set channels.
The purely mechanical ones with one-of-many latching action are generically called "Radio switches" as a common use was channel selectors.

You can still buy the switches and mounting rails to make these up from some switch manufacturers, eg. Switchcraft.

A circuit such as this could be used to recreate the switch action electronically, using just momentary buttons:

That can be expanded to as many ways as required by just using the R6-C6-R7 part once & connecting the diodes from all switches to the same point, then feeding the CK (clock) input on all latches from the same R6-R7 junction.

You can then use analog switches (eg. CD4066, 74HC4066 or various other types) to pass the voltage from a preset or resistor chain to the output.

Another method would be use a microcontroller with the switches acting as a keyboard input array and a minimal program to store the last switch press, read a value from a look-up table and output that via a digital to analog converter.

Or if the voltage output after a selection is only needed for a few minutes or tens of minutes, just go with Gophert's capacitor hold circuit - that's a simple and straightforward as you can get!

#### HurdyGuigui

##### New Member
Thank you so much for your help ! The mechanical approach could be good but I didn't manage to find the right switches.
Also I need them to be in a specific layout which might not work for the mechanic reset.
I love your proposal Gophert, I think this is exactly what I was looking for. It is ok if the voltage start to drop after ten minutes, specially since I will program steps in my effect processor, meaning that for exemple, if the voltage is 0.9v and drop to 0.8v after a while, it will still be on the same step.
I am going to do some testing this week and tell you how it goes.

#### gophert

##### Well-Known Member
Thank you so much for your help ! The mechanical approach could be good but I didn't manage to find the right switches.
Also I need them to be in a specific layout which might not work for the mechanic reset.
I love your proposal Gophert, I think this is exactly what I was looking for. It is ok if the voltage start to drop after ten minutes, specially since I will program steps in my effect processor, meaning that for exemple, if the voltage is 0.9v and drop to 0.8v after a while, it will still be on the same step.
I am going to do some testing this week and tell you how it goes.

Your op amp will need 5 or more volts in most cases (few op amps can put output all the way to 3.3v when powered by 3.3v)..

Also, use 10k or 20k ohm trimmers - if you get up to megohms, a very quick button press may not allow the capacitor to charge/discharge to your target voltage. 10k ohm trimmers will insure the cap charges within 5mSec.

#### HurdyGuigui

##### New Member
Your op amp will need 5 or more volts in most cases (few op amps can put output all the way to 3.3v when powered by 3.3v)..

Also, use 10k or 20k ohm trimmers - if you get up to megohms, a very quick button press may not allow the capacitor to charge/discharge to your target voltage. 10k ohm trimmers will insure the cap charges within 5mSec.
Thank you for the precisions.
If possible I don't want to add an external source of power. I don't necessary need to go up to 3.3v for the output though. I could have my output vary from 0 to 2v with 12 steps this would work for my application. Would a 3.3v powered op amp be able to give 2v in output? I could even go less than 2v if needed.

5ms sounds good for the minimum button press time.

#### gophert

##### Well-Known Member
Thank you for the precisions.
If possible I don't want to add an external source of power. I don't necessary need to go up to 3.3v for the output though. I could have my output vary from 0 to 2v with 12 steps this would work for my application. Would a 3.3v powered op amp be able to give 2v in output? I could even go less than 2v if needed.

5ms sounds good for the minimum button press time.
Yes,

This (below) is a low voltage op amp (and through hole mounting). Output can swing up to 3.25v on 3.3v supply and down to 0.05v (assuming your load is 10k ohms or more. There may be many other options if you can handle the small surface mount chips.

Last edited:

#### gophert

##### Well-Known Member
Note - op amp recommendation was changed above

.

Last edited:

#### eTech

##### Active Member
Thank you for the precisions.
If possible I don't want to add an external source of power. I don't necessary need to go up to 3.3v for the output though. I could have my output vary from 0 to 2v with 12 steps this would work for my application. Would a 3.3v powered op amp be able to give 2v in output? I could even go less than 2v if needed.

5ms sounds good for the minimum button press time.
Hi

Do you need the circuit to prevent a voltage change if more than one button is pressed at the same time?

eT

#### HurdyGuigui

##### New Member
Hi

Why not use a single series voltage divider (11x1k)? Last resistor could be trimmer(?)

Just curious...

eT
Thank you for your input. Something like this?

If this work, this would be very easy to wire.
If two buttons are pressed at the same time, hopefully the last one pushed will print his value. I guess I need to test for that.

#### gophert

##### Well-Known Member
You'll need one button connected to Vcc and one to Vee of you need 3.3 and 0V as in your original post, but, yes, that resistor ladder should work.

#### HurdyGuigui

##### New Member
You'll need one button connected to Vcc and one to Vee of you need 3.3 and 0V as in your original post, but, yes, that resistor ladder should work.
You are right thank you so much.
Corrected schematics :

#### AnalogKid

##### Well-Known Member
Note that the tension at output needs to stay still once the switch is pressed, and change only when the next one is pressed.
This is called a "radio button" circuit because it acts like old car radios with pushbutton tuners. You have two options. First, 12 switches interlinked mechanically with a "bale". Press any switch, it latches down, and all other switches pop up. This works only if all 12 switches are in a row. Switches like the one pictured in post #2 were very popular for this back in the 80's.

Second - a bunch of SPST momentary pushbutton switches (pretty much any kind you like), in any physical arrangement you want, connected to a radio button circuit that does the latching and releasing electronically. The circuit generates the output voltage by switching resistors as above,

From your description in post #1, it sounds like a microcontroller-based solution (PIC, Arduino, etc.) is not a good fit for you

Which approach sounds best to you?

ak

#### gophert

##### Well-Known Member
It is ok if the voltage start to drop after ten minutes, specially since I will program steps in my effect processor, meaning that for exemple, if the voltage is 0.9v and drop to 0.8v after a while, it will still be on the same step.

Good luck with your project and check back if you need any help.

#### HurdyGuigui

##### New Member
Hello,

I finally made some tests today, it works great ! Sometime the output tension was not very stable on the further right switches, I added a resistor after R14 so that the tension before the OPamp is a bit smaller. Now I can draw the final board and make it happen ! I will keep you posted with pictures.
Thank you so much for your help !

#### Beau Schwabe

##### Active Member
Just don't press Sw3 and Sw8 at the same time .... you might want to current limit them.