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.