# Why is my linear pot is causing a non-linear voltage at my ADC input?

So I have a socket that connects an expression pedal to a simple input circuit that feeds a voltage to an ADC chip that I then read from a Raspberry PI. I've checked the resistance on the expression pedal and it's definitely linear (as per spec). While I move the pedal back and forth the voltage the ADC reads stays very high for most of the travel and suddenly drops to zero.

This is the circuit at the TRS socket: When plugged in the expression pedal forms a linear 100k potentiometer between A and D. When unplugged the 3V3 voltage passes from E to D and on to the ADC. This allows the software to know when there is no expression pedal plugged in (assuming values near 3V3 at the ADC). The 150ohm is because the plug is short circuited temporarily when plugged or unplugged and it limits the current (I blew up a Raspberry Pi before putting this in). I don't know if it's enough. But I'm not game to try unplugging in a powered up state yet.

The actually more serious issues is that the voltage the ADC sees is not linear. Despite the variable resistance part being linear. Previously when I've implemented this circuit it has worked as expected. The voltage is proportional with the variable resistance between the tip and ring connections. Do I need to match the 150ohm on the ground side as well?

Or something else?

Edit: I think what I've done wrong is swapped the tip and ring like this: This is light of the "standard" expression pedal diagram: I think it might work if I swap them. Will try tonight and update.

Note: Potentially there is another "hidden" resistor between R3 and R1's wiper. But that would be inside the expression pedal. And somewhat unimportant in the grand scheme of things.

• Can you draw the circuit as a schematic diagram rather than as a wiring diagram? I think I know what the problem is. I also think it'd be pretty obvious in a circuit schematic - I'm sure you'll see it if you draw it properly.
– JRE
Feb 8 '20 at 9:01
• @JRE I would've if I could easily, but I'm not sure what symbol to use for the switching socket? Or how to connect up the other parts. I'm a mainly a software dev. In any case I'm running low on time.
– fret
Feb 8 '20 at 9:05
• Draw it as it would be when plugged in and connected. Put simple switches in appropriate places with a note which switches close (or open) when the pedal is plugged in.
– JRE
Feb 8 '20 at 9:38
• The thing that occurs to me first is that you may have it wired as a rheostat rather than as a potentiometer
– JRE
Feb 8 '20 at 9:40
• That is, two pins rather than three.
– JRE
Feb 8 '20 at 9:41

I'm not going to attempt to read that mess but I think I know what JRE's getting at : you may have a circuit like this: simulate this circuit – Schematic created using CircuitLab

Now with R2 at 100% the output is obviously very close to 3V3, and at 0% it is 0V.

But at 50% R2 = 50K and V = 3.3 * R2/(R1 + R2) = ... very close to 3V3

Even at 1%, R2 = 1K and V = 3.3 * R2/(R1 + R2) = 3.3 * 1000/1150 = 2.87V.

Which matches the symptoms you describe.

• I don't think that's quite what I did... I do tie all the parts of the pot to something. Check the new diagram in the post for what I think I actually implemented (incorrectly of course).
– fret
Feb 9 '20 at 23:54
• Since the resistance between the wiper and the ADC doesn't matter (as far as the pot law is concerned, what you have is essentially equivalent to the above (works equally badly). Take R3 to the top of the pot, and take the wiper to the ADC. Feb 9 '20 at 23:59
• This is pretty close. Swapping the tip and ring contacts solves all the issues.
– fret
Feb 12 '20 at 4:01