electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software
Problem with discrete potentiometer
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [7 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
sompost



Joined: Aug 17, 2010
Posts: 58
Location: Switzerland

PostPosted: Mon Aug 19, 2019 10:27 am    Post subject:  Problem with discrete potentiometer Reply with quote  Mark this post and the followings unread

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... Laughing

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
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Aug 19, 2019 11:14 am    Post subject: Reply with quote  Mark this post and the followings unread

You may be able to find a different kind of rotary switch which "makes (the new contact) before break (the old one)" or "shorting" .. like (first google hit here for it) https://nl.farnell.com/lorlin/ck1037/switch-4-pole-3-pos-0-15a-250v/dp/1123693
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 1294
Location: Netherlands
Audio files: 30

PostPosted: Tue Aug 20, 2019 12:18 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
sompost



Joined: Aug 17, 2010
Posts: 58
Location: Switzerland

PostPosted: Tue Aug 20, 2019 7:17 am    Post subject: Reply with quote  Mark this post and the followings unread

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.... scratch


DiscPot.png
 Description:
 Filesize:  10.3 KB
 Viewed:  168 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

DiscPot.png



_________________
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
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Tue Aug 20, 2019 7:37 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Tue Aug 20, 2019 12:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Wed Aug 21, 2019 6:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

yeah, a pot is also what I ended up using for the DW6000 controller for which I had also considered using a switch + resistors.
_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [7 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use