# Using lots of slide potentiometer for computer control

I want to mount a bunch (say 16+) slide potentiometers in a long project box (or other housing that can sit on a desk) that I can use to interact with software on my computer, specifically lighting software, which I would program.

How could I get the output of these slide potentiometers into my computer so software could read the values? I'm thinking using a USB input.

Keep in mind I'm a beginner at electronics (but I can do software).

• Do not use potentiometers but encoders. Encoders use various techniques, but basically they avoid A-to-D conversion, and all the nasty problems of potentiometers, like wear leading to failure or intermittence. In an encoder, when you turn the knob or move the slider, digital signals are generated which cause a microchip to count up or down. These signals can come from optical sensors that read light/dark bars on a sliding strip or rotary disc, or other techniques. – Kaz Nov 9 '12 at 22:31
• Digitizing regular pots is tricky. One problem is that is usually done DC going through pots. Pots do not like DC. It is well-known that if you send audio through a pot that has a DC potential across it, when the pot is moved, you get "scratching" noise in the audio. I have an old Alesis synthesizer whose controls are analog pots that are digitized. When these pots get dirty, the controls become very flaky. The digital values jitter and jump when you turn the knobs, and sometimes spontaneously. If done at all, this silly technique should be done with AC, without any DC applied to the pots. – Kaz Nov 9 '12 at 22:38
• @Kaz I'd love to but they seem to be very expensive ($50+), am I looking at the right place? – James T Nov 9 '12 at 22:39 • They are expensive. So if you want cheap, stick with pots. I'd try to find a solution where only AC flows over the pots. That is to say, we generate a signal, say 5 Khz or whatever. We attenuate that with a pot, and then rectify it to determine its level as a DC signal, and then digitize that DC. The AC signal is coupled with capacitors so no DC flows through the pot. – Kaz Nov 9 '12 at 23:04 • @Kaz Any suggestions on how to do that? – James T Nov 9 '12 at 23:20 ## 3 Answers You need some kind of analog I/O board ( that basically contains ADC converters to communicate with the PC ) there is also multiple channels available. You need a channel for each potentiometer ( unless you want to do some multiplexing ). Here some examples. • Seems... expensive. Anything else cheaper? Maybe possible with a arduino board? – James T Nov 9 '12 at 14:35 • What about this? appliedplatonics.com/anshield – James T Nov 9 '12 at 14:37 • @buddy4j yep it probably works :) – Felice Pollano Nov 9 '12 at 14:38 • Another thing that can be used is this: sparkfun.com/products/9056 – James T Nov 9 '12 at 14:49 • sparkfun.com/products/9832 Just adding more resources to the answers – James T Nov 9 '12 at 14:52 If you don't want to deal with microcontroller programming: Buy a Teensy++2.0 board for$24:

Use the GenericHID software to connect up to 8 potentiometer wipers to the F0 through F7 pins:

After programming the device and wiring it up, it will connect to the computer as a HID input device. You can read the values with libhid, etc.

• I do like the approach, except that it's limited to 8 inputs. Very attractive if I ever need to make a small one with 8 or less though. – James T Nov 9 '12 at 20:38
• I forgot to add that part, but I was going to say that if you want more than 8, just buy two. Still pretty cheap. Also note that it can do more than 8 if you're using other inputs, like pushbuttons. – Jim Paris Nov 9 '12 at 20:47
• It's not as cheap per channel as using a Arduino, so it's only worth it for lower numbers, and you can't re-purpose this as much as you can a Arduino. – James T Nov 9 '12 at 21:05
• Arduinos don't have more than 8 analog inputs either; you'll need to use a mux. Which you could add to these boards too, of course. Arduinos and these boards are essentially the same AVR hardware, it's just a question of what software you're putting on it. – Jim Paris Nov 9 '12 at 22:03
• I was going to use a Mux Shield with the Uno, is there something similar for that? It would probably end up cheaper than using a Uno. – James T Nov 9 '12 at 22:22

The choices for slides seem to be pots or linear encoders. For pots you need a system with many analog inputs, then you need to send them to your computer. USB seems like a no brainer. Might I suggest using a MIDI over USB descriptor. Many Digital Audio Workstation controllers work with this protocol, and the libraries for the PC side should be readily available.

In fact, if you're in a rush, you might look into the commercial availability of these controllers. In the Audio Workstation world, they tend to call them "control surfaces"

"Cheap" is relative. About $300 gets you this, or plenty of others like it, which might have enough sliders and pots to meet your needs, and you can start to program the host side right away. You also know it will work, and you don't have to worry about design. This is a huge advantage (unless, of course, you're doing this for the design experience!) I don't think you'll be able to build anything like what you describe for much less than$250-- assuming you own everything in your development chain already, so we're in the ballpark.

Pots would probably be the less expensive option, and probably easier to program, but you need to make sure that you get a microcontroller that can handle the job, or a separate a/d converter.

• The entire point for me is to do it cheap, not fast. – James T Nov 9 '12 at 15:34
• Also, what would be cheaper? Pots or linear encoders? – James T Nov 9 '12 at 15:35
• Got some more input based on your follow up, but a bit long for comment. I'll modify my answer. – Scott Seidman Nov 9 '12 at 17:19
• @Bubby4j - Pots would be way cheaper than linear encoders in almost all cases. As a matter of fact many on-line discount component outlets offer slider pots of various types. One example can be seen here with good additional discount for quantity purchase: allelectronics.com/make-a-store/item/SLP-20KS/… – Michael Karas Nov 9 '12 at 17:26
• Right now my idea is just to mount some pots in a plastic box with a Arduino Uno ($30) and a Mux Shield ($25). Would be less than \$100. Pretty isn't my goal, just something functional. – James T Nov 9 '12 at 17:46