Feedback using linear potentiometer

Hey guys, I'm new to the forum, but I've been lurking for a while, there's so much useful information I haven't needed to post before this!

Anyway, I plan on using about 18 servos, and 18 linear potentiometers for a project I'm working on. I want to have the servo drag a wire to change the value on the potentiometer, so I can get a feedback as to the position of the servo at any time, I'd also like to write a position to the servos.

I'd like to get a pretty high frequency (about 10 data points per pot per second), and I'm wondering if I can accomplish this with a single Mega 2560, or if I need a second microcontroller to control half of the servos/pots. I plan on using some type of power distribution from an external battery for powering the servos, and grounding everything out, so I'm not worried about overloading the Arduino in that regard, but I'm wondering if it can handle that many potentiometers, and if you guys have any advice as far as that goes.

Also, what should my kOhm values be for the potentiometers if I just wanted the position at any given instant?

Thank you so much, and let me know if you need anything cleared up!

18 pots is more than can be read on 16 analog inputs, so an extra analog multiplexer
chip would be needed. The Mega should drive 36 or maybe 48 servos max, although
I'm not too sure if driving more than 12 has issues (12 servos per timer module, and one
ISR handles each timer, so several timers means interrupts may clash and cause jitter on
the other timers' servos.

Any linear potentometer value from 5k to 100k would work, lower values pick up less noise
and I would suggest 20k as a maximum for that reason. Linear is important, lots of them
are log law and no use to you.

Keep the pot wiring away from the servo power wiring. If noise is a problem (long cables will
be an issue here), you can add 100nF caps from each potentiometer wiper to ground (at the
Arduino end, not at the pot).

Alright! Couldn’t find any 5k pots on digikey that were available in quantities less than 300, so what do you think of this 10k? Will it work?
http://www.digikey.com/product-detail/en/bourns-inc/PTA6043-2015DPB103/PTA6043-2015DPB103-ND/3534247

The pot wiring will be about 1-3 inches away from the servo wiring, is that enough or will I have to worry about noise?

Will the multiplexer let me read the data from the potentiometers fast enough?

robertwlyle:
Alright! Couldn't find any 5k pots on digikey that were available in quantities less than 300, so what do you think of this 10k? Will it work?
http://www.digikey.com/product-detail/en/bourns-inc/PTA6043-2015DPB103/PTA6043-2015DPB103-ND/3534247

Look up the exact part number in the datasheet to see if its linear. If not its useless for you.

The pot wiring will be about 1-3 inches away from the servo wiring, is that enough or will I have to worry about noise?

Definitely help to not have the wires together

Will the multiplexer let me read the data from the potentiometers fast enough?

Way faster than you need - 10us to reprogram the multiplexer perhaps, 110us per analog reading, you
are looking for 10 readings per second per channel...

Couldn't find any 5k pots on digikey that were available in quantities less than 300

They do seem to have a bunch of 10K slide pots starting at $1.16 each. Connecting the outer legs to 5V and Gnd the wiper to two analog input thru two low resistance mux/switch like D406 for example
http://www.digikey.com/product-search/en?keywords=dg406
would let you read 32 pots using 4 control pins and the 2 analog inputs.
8:1 analog mux/switches are also available, use 3 chips with 3 control pins and 3 analog inputs to read 24 slide pots. Still 6 Mega pins.
http://www.digikey.com/product-search/en/integrated-circuits-ics/interface-analog-switches-multiplexers-demultiplexers/2556671?FV=fff40027%2Cfff802ff%2C1ea40009&mnonly=0&newproducts=0&ColumnSort=433&page=1&stock=1&pbfree=0&rohs=0&k=analog+switch&quantity=&ptm=0&fid=0&pageSize=25&pkeyword=analog+switch

Cool, so linear pots, and a multiplexer solves the pin issue, what about power distribution? I've been looking into using a couple of these (just the vin and gnd) to power all of the servos on a battery that isn't connected to the pots:

https://www.servocity.com/servo-power-board-unassembled-with-full-pins

Then use something similar to power the pots with them feeding back into the arduino?

The pots only need 5V/10K = 0.5mA x 18 = 9mA, can supply that from the Arduino.
If all 18 servos can move at once, I'd get a couple of 10A or a 20A supply.
http://www.mpja.com/5-Volt-Power-Supply-20A-100W-Meanwell/productinfo/17823+PS/
http://www.mpja.com/5-Volt-Power-Supply-30A-150W-Meanwell/productinfo/17827+PS/
etc
http://www.mpja.com/5-Volt-Power-Supply/products/534/
Maybe smaller one spread out if the servos are spread out.
Connect all Gnds together, back to a common point if possible.

The servocity part is just a connection point. You can make your own up as well, with 3 pins per servo - signal from Arduino, +5 & Gnd from power supply all connected together.

Hi,
Won't the servo command you last sent to the servo be the position of the servo?
Any special reason why you need position feedback?

Tom... :slight_smile:

robertwlyle:
Hey guys, I'm new to the forum, but I've been lurking for a while, there's so much useful information I haven't needed to post before this!

Anyway, I plan on using about 18 servos, and 18 linear potentiometers for a project I'm working on. I want to have the servo drag a wire to change the value on the potentiometer, so I can get a feedback as to the position of the servo at any time, I'd also like to write a position to the servos.

I'd like to get a pretty high frequency (about 10 data points per pot per second), and I'm wondering if I can accomplish this with a single Mega 2560, or if I need a second microcontroller to control half of the servos/pots. I plan on using some type of power distribution from an external battery for powering the servos, and grounding everything out, so I'm not worried about overloading the Arduino in that regard, but I'm wondering if it can handle that many potentiometers, and if you guys have any advice as far as that goes.

Also, what should my kOhm values be for the potentiometers if I just wanted the position at any given instant?

Thank you so much, and let me know if you need anything cleared up!

Hello there,

You should check your number of pot movement operations required over a given time and compare that to the spec's of any linear pot you intend to purchase. Pots wear out over time and then start to produce bad resistance values. A typical semi failure mode would be a 1k pot starting to give readings of 500 ohms to 100k ohms near the center of travel for example. That would mean the system would go berserk and probably jump around a lot.

Check the specs for any pot you intend to purchase. Look at the lifetime data given such as number of total operations over the life of the product. Some pots have a very low rating and so will wear out quickly (made for set once and leave alone forever type applications) and some have a higher number rating.