0
\$\begingroup\$

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: circuit diagram

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:

Incorrect circuit diagram

This is light of the "standard" expression pedal diagram:

Pedal part of the circuit

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – JRE Feb 8 at 9:01
  • \$\begingroup\$ @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. \$\endgroup\$ – fret Feb 8 at 9:05
  • \$\begingroup\$ 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. \$\endgroup\$ – JRE Feb 8 at 9:38
  • \$\begingroup\$ The thing that occurs to me first is that you may have it wired as a rheostat rather than as a potentiometer \$\endgroup\$ – JRE Feb 8 at 9:40
  • \$\begingroup\$ That is, two pins rather than three. \$\endgroup\$ – JRE Feb 8 at 9:41
3
\$\begingroup\$

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:

schematic

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.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ 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). \$\endgroup\$ – fret Feb 9 at 23:54
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Brian Drummond Feb 9 at 23:59
  • 1
    \$\begingroup\$ This is pretty close. Swapping the tip and ring contacts solves all the issues. \$\endgroup\$ – fret Feb 12 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.