Author |
Message |
sompost
Joined: Aug 17, 2010 Posts: 58 Location: Switzerland
|
Posted: Mon Aug 19, 2019 10:27 am Post subject:
Problem with discrete potentiometer |
|
|
Hi all,
For a MIDI controller I need a non-monotonic i.e. discrete potentiometer with only a few (4 and 6) different resistor values. I built one using a rotary switch and resistors between the positions to get discrete voltage levels between 5V and ground.
Here's the problem: While switching over, the center is temporarily disconnected, giving a random 0 value on an Arduino analog pin. To fix that, I wired a 100nF capacitor between the center and ground to hold the voltage between switch-overs. But now I get a spike when the capacitor discharges after a switch-over that throws off all discrete pots on the same voltage lines...
Perhaps the cap is too big?
Still, is there a simple way of making a discrete pot without switch-over "holes" and/or voltage spikes?
Thanks for your suggestions.
PS: If I can't get it sorted, I'll remove the cap and "bridge" the hole using software on the Arduino... _________________ Built: MFOS SLMS plus, SL Ultimate & Expander, 10 step seq; SLMS MkII; PAiA FatMan, Mutable-Instruments Shruthi-1; Jasper Wasp Clone
Building: Maddox MonoWave; Auduino; ASM-2; Minimoog Clone
Backlogging: MFOS 16 step seq; TH SN Voice; Takeda One Board Farm; Okita Vocoder; Page TR-9090; TH GM Voice, AY Voice |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
|
Back to top
|
|
|
Grumble
Joined: Nov 23, 2015 Posts: 1294 Location: Netherlands
Audio files: 30
|
Posted: Tue Aug 20, 2019 12:18 am Post subject:
|
|
|
I had exact the same problem: In a circuit I used a 100NF cap for eliminating contact bounce, but when I switched the Arduino nano just completely restarted.
I mounted a resistor (I think) 330 ohm in series with the resistor: problem solved. _________________ my synth |
|
Back to top
|
|
|
sompost
Joined: Aug 17, 2010 Posts: 58 Location: Switzerland
|
Posted: Tue Aug 20, 2019 7:17 am Post subject:
|
|
|
Thanks for your suggestions.
Here's a (bad) image of the situation I have:
I've got 4 different voltages to choose between. The 5V and 3.3V are provided by the Arduino. A voltage divider provides the 1.7V. I've added capacitor behind the switch to hold the voltage between switch-overs (when the pole is floating temporarily). As can be seen, when switching from, say, 3.3V to 1.7V the line is forced to the 3.3V still stored in the cap, until it can discharge through the resistor to ground -- disrupting all other pots on the same 1.7V bus -- some of which randomly trigger changes on the Arduino, flooding the MIDI channel with parameter changes that never happened.
For a moment I thought that, perhaps, adding a diode after the switch would block the path back to the voltage busses, but then I'd need a resistor parallel to the cap to discharge it. Too much hassle.
I can see the benefit of the make-before-break option. I should have thought of that sooner.
Thanks again for your answers. I think I'm going to remove the caps. I can certainly smooth the reading of a single switch in software, but I don't really care to check every random change of a discrete pot to see if it's legit.
Perhaps I should stay away from electronics and stick to software....
Description: |
|
Filesize: |
10.3 KB |
Viewed: |
168 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
_________________ Built: MFOS SLMS plus, SL Ultimate & Expander, 10 step seq; SLMS MkII; PAiA FatMan, Mutable-Instruments Shruthi-1; Jasper Wasp Clone
Building: Maddox MonoWave; Auduino; ASM-2; Minimoog Clone
Backlogging: MFOS 16 step seq; TH SN Voice; Takeda One Board Farm; Okita Vocoder; Page TR-9090; TH GM Voice, AY Voice |
|
Back to top
|
|
|
PHOBoS
Joined: Jan 14, 2010 Posts: 5591 Location: Moon Base
Audio files: 705
|
Posted: Tue Aug 20, 2019 7:37 am Post subject:
|
|
|
hmm, maybe connect a large resistor (at least a factor 10 larger than the ones used for the voltage divider) between 3.3V and the output.
You will mostly be switching from or to 3.3V anyway and it will keep the voltage at 3.3V when the switch 'breaks'. It would also be a good idea
to buffer the 1.7V; add a small capacitor to GND and use an opamp configured as a voltage follower to buffer the voltage. _________________ "My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Aug 20, 2019 12:13 pm Post subject:
|
|
|
And then the other way would be to use a pot .. and make it discrete in software .. probably the cheapest way. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
PHOBoS
Joined: Jan 14, 2010 Posts: 5591 Location: Moon Base
Audio files: 705
|
|
Back to top
|
|
|
|