potentiometer help

i have a project that is going to require a lot of Potentiometer's. about 40 of them i think was the final count plus 3 analogue accelerometers.

I wanted to know if anyone had any advice for connecting so many analogue inputs up. Its only going to be connecting to my pc. I am currently using a mega. I want the controller options to be as cheap as possible so buying 3 megas to handle the amount ist viable at all.

Use a 4051 8-channel or 4067 16-channel analog multiplexer on each of several analog inputs. Use 3 or 4 digital outputs to select the input channel and read the analog inputs to get the data.

5 analog inputs * 8 channels per input will give you 40 channels.

Ah right yeah. Thats awesome. So i wouldnt really even need to use a mega, i can cut costs even more by using this method

Jaychad:
Ah right yeah. Thats awesome. So i wouldnt really even need to use a mega, i can cut costs even more by using this method

If you don't need analog inputs for anything else (like I2C) you can use 5 of the 4051 multiplexers on 5 of the 6 analog inputs of an Arduino UNO.

If you need some analog inputs for other stuff you can use three of the 4067 multiplexers on 3 of the 6 analog inputs of an Arduino UNO to get 48 analog channels.

Don't forget to filter the measurements coming out of the ADC. There will be electrical noise especially when the pot slider is moving.

Hi, if you choose multiplexing, how often do you want to measure the output of each pot, accelerometer?

Before each analogue read you will have to allow for a settling time at each channel before asking for a A to D conversion.

Tom..... :slight_smile:

IT NEEDS TO BE AS CONSTANT AND CLOSE TO REALTIMME AS IS POSSIBLE

It will always feel to be real time if that is what you mean.
Is this for a midi application?

Normally with a pot there is no need for any settling delay so long as the pot is 10K or so. But the simplest way to have a delay is to just read the same channel twice and use the second result.

The best way i can describe it is as a position monitoring device for a custom machine which will link to a software simulator. so when the positions of the arms change it will update the simulator

You need to know what speed you need the updates to occur in terms of samples per second to know if this is feasible.

Why potentiometers (rather than rotary encoders), why so many, what type of potentiometer?

Always has to be asked first.

So many simply because its what the project requires. And potentiometers because of cost and its what i know. Ive always been a programmer rather than a hardware developer.

I dont really have much experience with using rotary encoder's. But i know i can work out an almost exact angle using a simple potentiometer.

I was going to be using these ones http://www.ebay.co.uk/itm/All-Horizontal-Vertical-Preset-Trimmer-Variable-PCB-Potentiometer-Resistor-/180982867325?pt=UK_BOI_Electrical_Components_Supplies_ET&var=&hash=item2a236b657d

I was going to be using these ones

Poor choice, they are not very mechanically robust and will not stand the amount of ware you will inflict. It is normal to use wire wound pots for angle sensing. Yes I know these are expensive but they are accurate and will stand the ware.

Well higher quality is very much worth extra cost. I will of course take the advice, its why i ask for advice here :slight_smile: