0
Offline
Newbie
Karma: 0
Posts: 2
Arduino rocks
|
 |
« on: February 16, 2009, 04:53:17 am » |
Hi. I'm a novice at this, trying stuff for the first time. I want to connect a set of (maybe 6?) 'softpot' linear potentiometers to an Arduino Duemilanove, via a breadboard, & then use the outputs to drive midi patches in Max. Any ideas out there how to connect it up & get it going? I'm using MaxMSP 5 on Mac 10.4. thanks 
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2338
Do it !
|
 |
« Reply #1 on: February 16, 2009, 06:29:24 am » |
Could you explain "softpot" a little more ?
it's easy to connect 6 ordinary potentiometers to Arduino, they shold just be hooked up to the analog inputs as voltage dividers. One side to ground center to analog pin, other side to +5V.
Then use AnalogRead(pin number here) to read the pot, it will return a value between 0 (0V) and 1023 (5V)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 2
Arduino rocks
|
 |
« Reply #2 on: February 18, 2009, 03:46:06 am » |
Hi, thanks for the reply. A softpot is a thin metallic strip encased in flexible clear plastic. The ones I have are about 25cm by 2 cm. They have 3 terminals at one end: centre and right connected to the top of the strip (right terminal is marked with an arrow pointing out), and left running down the side and connected to the bottom end of the strip. The idea is, when you run your finger along the strip, it will send a variable resistance message, thus functioning like a mixer fader. They're a bit expensive, which is why I'm being a bit cautious. Which pins of the Arduino to connect to? And should I add in a resistor somewhere? Any help much appreciated. 
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #3 on: February 18, 2009, 03:49:46 am » |
Centre to an analogue input pin, and the ends to the +5V and ground. There is no need for anything else to get you going.
However, you might like to consider what happens (what do you want to happen?) when you are not pressing on the pot. There will be no connection to the analogue input pin and so you will get readings that fluctuate all over the place when nothing is being pressed.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
Arduino rocks
|
 |
« Reply #4 on: February 10, 2010, 10:56:42 am » |
Hi I bought 10 circular sofpots and have already burnt up two of them by connecting like is described here - centre to analog input pin, left (with triangle above) connects to 5v and right goes to ground. I have also tried putting resistors (5-100 ohm) before the 5v go to the softpot but I always get a bad reading out of it (only about 1/4 of the softpots gives out a reading) If i put a resistor that is lower than 10 ohm, the sofpots overheats and starts burning/smoking. I think this is really wierd since I was under the impression that you couldnt burn up these sofpots with 5v If anyone can spot a solution it would be much appriciated 
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #5 on: February 10, 2010, 11:15:51 am » |
It sounds like you are not connecting the wiper to the analogue input but to one of the rails. Then when you are at one end you have the whole supply across a very small resistor and you are drawing a lot of current. Check again the data sheet and make sure both ends of the pot are connected across the supply not the wiper.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
Arduino rocks
|
 |
« Reply #6 on: February 10, 2010, 11:26:06 am » |
Hi Mike and thanks for the quick reply
I connect the middle (wiper) to analog input 1. am very sure of this.
when you say rails you mean either 5v input or ground ouput; right?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #7 on: February 10, 2010, 11:41:18 am » |
Yes - The middle wire in a pot (wiper) might not physically be in the middle. Please check the data sheet of the pot you are using.
|
|
|
|
« Last Edit: February 10, 2010, 11:41:40 am by Grumpy_Mike »
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 83
Arduino rocks
|
 |
« Reply #8 on: February 10, 2010, 11:46:11 am » |
You can check your pins most easily by connecting the ones that you think are the power pins to a 5V supply and GND, and then connect the other one to a voltmeter. The voltage should change as you adjust the pot (or in this case, move your finger along it). If not, you've got the wrong pins. Change them and try again.
Do make certain (with the voltmeter) that you've really got 5V between the two leads of your power supply first.
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5079
Where's the beer?
|
 |
« Reply #9 on: February 10, 2010, 12:23:12 pm » |
You might try using that voltmeter (eh, multimeter) to connect up to the softpot with a resistance reading setting higher than the spec of the softpot. Two of the lines should give you an open reading (infinite resistance), two should give you the reading of the max value of the softpot. With those readings, you should be able to figure out which leads are for what (ie, which is wiper and which are for voltage/ground) without burning it up.
Now, as for what to do about keeping it from burning up - there should be some clues in the spec sheet; usually a resistor of a certain size is needed (as mentioned by someone) - but I would think the "output" would be after that resistor, with the wiper of the softpot connected to ground as well. So you would always measure the value of the extra resistor at minimum on the output.
Thinking something like (sorry for bad ascii art!):
100 ohm Softpot 5V ----/\/\/\----+-----/\/\/\/\/\/\/\/\/\/\------ GND | ^ | | | +------------- GND | Output to Arduino
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 11
Arduino rocks
|
 |
« Reply #10 on: February 10, 2010, 12:51:13 pm » |
thanks for the reply´s guys
one question: should it matter if I connect 5v to what should be connected to ground and connect ground to what should be connected to 5v ???
Shouldnt that just reverse the pot?
Best regards
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5079
Where's the beer?
|
 |
« Reply #11 on: February 10, 2010, 02:28:13 pm » |
On my example above, I am kinda intending the "100 ohm" resistor to be a current limiting resistor on the pot (if they are so fragile as to burn up under a low-current 5V source); reversing the connections (so that the 5V and grounds were swapped) would defeat that and probably burn the potentiometer out...?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 0
Posts: 417
Arduino rocks
|
 |
« Reply #12 on: February 10, 2010, 07:45:43 pm » |
Right pin 5v middle analog pin left pin ground usually... Usually...
|
|
|
|
|
Logged
|
|
|
|
|
NE Wisconsin
Offline
Full Member
Karma: 0
Posts: 195
Arduino is the Better Stamp!
|
 |
« Reply #13 on: February 11, 2010, 01:48:20 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #14 on: February 11, 2010, 04:00:32 am » |
cr0sh you said:- reversing the connections (so that the 5V and grounds were swapped) would defeat that I can't see how that is. Current has to flow from the power terminals through the pot to the other power terminal. To my mind it makes no difference where the protection resistor is, it will still limit the current. The arduino input is high impedance so that doesn't affect things. Can you explain where I am thinking wrong?
|
|
|
|
|
Logged
|
|
|
|
|
|