# Unable to make a pot work correctly

I have a board I salvaged from a joystick that uses potentiometers to measure the location of the arms. On the PCB a edge pin and the center pin are wired together. I would like to connect the pots to my arduino, but I can't figure out how to connect it properly. This is the basic circuit I have right now. The question: how do I wire this up to receive a meaningful value when the pot is rotated?

• Wire the "edge" pins to Vcc and GND, and the center pin to one of the analog inputs. – Eugene Sh. Jun 28 '16 at 18:37
• The way it's wired it's just a 2-terminal variable resistor. Use it as one leg in a voltage divider. – brhans Jun 28 '16 at 18:38
• I forgot to mention, I have tried the design above but when I have the arduino print the values it just prints 1024. – J Atkin Jun 28 '16 at 18:43
• Add an extra resistor to make the second half of your new potential divider. Value similar to the pot value for best resolution. – KalleMP Jun 28 '16 at 18:50
• @KalleMP Like this? i.stack.imgur.com/czpKJ.png – J Atkin Jun 28 '16 at 20:01

I'd like to take a moment and explain what is happening, just in case.

A potentiometer is simply a resistor with a wiper (your center pin). simulate this circuit – Schematic created using CircuitLab

A potentiometer will have a given value, such as 10K. This is the total resistance from pin 1 to pin 2. No matter where the wiper is, R1 + R2 will always equal the total resistance.

Say you turn your potentiometer to the left. As you turn, R1 will decrease, while R2 increases, because you are moving the wiper physically.

As you turn your potentiometer all the way to the left, R1 will be very close to 0 Ohms, effectively connecting Pin1 and your wiper. Therefore, R2 will be the total resistance of your potentiometer.

The potentiometer works for your scenario by creating a voltage divider. That is to say, because we are probing voltage between R1 and R2 (which can change via the wiper).

Placing a voltage across pins 1 and 3 (eg: 5V), the center pin will measure a voltage between 0V-5V depending on wiper position.

Based on @KalleMP's informative comment, I ended up with this design: (everyone else was helpful, I just don't know enough terminology yet to have picked up on the answer) Where the resister is about the same value as the pot at maximum resistance. In this setup it works like to the original potentiometer with a more limited range

• That is one way to do it but you could remove the resistor and the short from centre to edge pin, connect Vcc to one edge then gnd to the other and the centre pin to the input BUT you might have to check how the ADC in the Arduino code is setup like check what is the ADC reference voltage. – crowie Aug 29 '16 at 16:15
• Agree with crowie. I'm guessing in your setup, the reference voltage for ADC is same as VDD and VSS, in which case, you can simplify the circuitry as follows: 1)Remove all red wires in diagram. 2)Connect 1st leg of potentiometer (any edge will do) to VRef+, which in this case is probably 5V. 3)Connect 2nd leg of potentiometer to AN0 (same as what you have). 4)Connect third leg of potentiometer to VRef-, which is probably ground in this case – mehfoos yacoob Oct 9 '16 at 21:20