Go Down

Topic: Recommendation for project needing ~15 potentiometers (Read 1 time) previous topic - next topic

BrenL

Hi all,

I have an idea for a little project I'd like to try and build that would require reading about ~15 potentiometers from a PC, ideally through USB.

The pots would be a mix of standard rotary (knob) pots and 2 axis (joystick) pots.

I'm a total Arduino newb, so I'm looking for suggestions on feasibility, what kind of board I should get, etc.  I have done some research, but I'm still not sure about the limits on the number of inputs possible, etc.

Thanks!

MichaelMeissner

A potentiometer requires analog input, so if you want ~ 15 pots, your only choice for an Arduino without additional hardware is the Arduino Mega 2560.  Note, the Mega only has 16 analog inputs, so it doesn't have room for growth.

Now, I was curious and did a google search for USB potentiometer, and found this.  It is a little expensive, but it probably would allow to to use up to 16 or 24 pots without having to build a project with the Arduino: http://www.controlanything.com/Relay/Relay/UPOTS

Magician

Do you mean arduino 'd read 15 pot's and send it to PC via USB?
What is the voltage coming from pot's? If it's in 0- 5V range, than you need an analog multiplexer, build your own board with 2 x IC (8 inputs) or even one 16 inputs.
SFE has : https://www.sparkfun.com/search/results?term=analog+multiplexer&what=products Look around, now you know what to google...

BrenL

Thanks a lot guys, you've given me a lot to research.

I have what might be a stupid question now, assuming I go with an Arduino, but I'm a newb so please excuse me.  I understand that traditionally you write programs which you upload to an Arduino controller.  That's cool for robots or whatever.  

But is it possible to write a program that merely reads A/D input (pots) from the Arduino board and into a PC program at run-time?  So, as I fiddle with these pots, I can read the values from a program on the PC?

arduinoPi

to read the values you would need to make a program to get serial values from the Arduino.
sending it should not be a problem you would just read the values and write to serial.

retrolefty

Quote
But is it possible to write a program that merely reads A/D input (pots) from the Arduino board and into a PC program at run-time?  So, as I fiddle with these pots, I can read the values from a program on the PC?


The ardunio IDE already has an example sketch that reads a analog input pin and sends it's value out it's USB serial port to a PC, so it wouldn't take much to add the additional channels to that. Called AnalogInOutSerial:

Code: [Select]

/*
 Analog input, analog output, serial output

Reads an analog input pin, maps the result to a range from 0 to 255
and uses the result to set the pulsewidth modulation (PWM) of an output pin.
Also prints the results to the serial monitor.

The circuit:
* potentiometer connected to analog pin 0.
  Center pin of the potentiometer goes to the analog pin.
  side pins of the potentiometer go to +5V and ground
* LED connected from digital pin 9 to ground

created 29 Dec. 2008
modified 30 Aug 2011
by Tom Igoe

This example code is in the public domain.

*/

// These constants won't change.  They're used to give names
// to the pins used:
const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to

int sensorValue = 0;        // value read from the pot
int outputValue = 0;        // value output to the PWM (analog out)

void setup() {
 // initialize serial communications at 9600 bps:
 Serial.begin(9600);
}

void loop() {
 // read the analog in value:
 sensorValue = analogRead(analogInPin);            
 // map it to the range of the analog out:
 outputValue = map(sensorValue, 0, 1023, 0, 255);  
 // change the analog out value:
 analogWrite(analogOutPin, outputValue);          

 // print the results to the serial monitor:
 Serial.print("sensor = " );                      
 Serial.print(sensorValue);      
 Serial.print("\t output = ");      
 Serial.println(outputValue);  

 // wait 10 milliseconds before the next loop
 // for the analog-to-digital converter to settle
 // after the last reading:
 delay(10);                    
}


Lefty

zoomkat

Quote
But is it possible to write a program that merely reads A/D input (pots) from the Arduino board and into a PC program at run-time?  So, as I fiddle with these pots, I can read the values from a program on the PC?


It would be fairly simple to use the below multiplexer with a standard arduino. For very basic pc display, you could use the arduino serial monitor.

https://www.sparkfun.com/products/9056
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

nitinsane

I think what the original poster had in mind was to build a device using Arduino that from a PC will look like a USB device that has 15+ potentiometers + 2 joystick axes.

I am currently thinking of a similar device (although with not so many analog controls but a analog outputs and few buttons).

first (and probably most easy) thing to do is to write a Ardunio sketch that reads the analog and digital signals. Then send them to the Atmega16U2 which has been re-programed to appear as a USB device to the PC. Look at this site for inspiration.

http://hunt.net.nz/users/darran/weblog/a3599/

Where I am stuck at the moment, is the lack of information on how to compile the modified firmware (using LUFA and avr-gcc) that can be flashed to the Atemga16U2. I have asked that question in another post, awaiting the response.

PeterH

Presumably there will be an application on the PC which receives and handles the values from all these pots. In that case, wouldn't the simplest option be to buy the appropriate number of USB joysticks, chop the hardware around as necessary to give the user interface you want, and then connect them all to the PC (via USB hub if necessary)? Then the application can just treat them like joysticks using DirectInput (or whatever API is appropriate for the local OS), since that's what they are.
I only provide help via the forum - please do not contact me for private consultancy.

Mozart

Mayhew Labs sells a Mux shield:
>
http://mayhewlabs.com/products/arduino-mux-shield
>
This shield can take up to 48 analog inputs which would support the large number of potentiometers the OP requested.  They also provide some simple sample code for reading the mux's so you can process the signals.  To get the data into the PC will require writing to the serial USB port and perhaps the use of the "Processing" software to handle whatever changes you would like to do to the data written.

Kghunt

why don't you multiplex in inputs by connecting more than one pot to each pin and switching between them using transistors or relays at the time of read.

eg
pin 1 high enables pot 1 disables pot 2
read pot 1 (a0)

pin 1 low disables pot one enables pot 2
read pot 2 (a0)

so on and so forth.

Go Up