Teensy 3.2 AnalogRead issue with 50k pot (SOLVED!!!!)
Hi all,
I'm hoping someone could solve or even just explain a weird problem I'm having. The issue is in regards to reading some relatively high impedance expressing pedals with a Teensy 3.2 micro-controller. I've been able to reliably read these pedals with the Teensy 2.0 and the Teensy LC, but for some reason the Teensy 3.2 doesn't like them. The pedals in question are the Moog EP-3 and Yamaha FC7. I know Teensy is optimized for 10k pots, but these pedals perform flawlessly with the Teensy 2.0 and LC, so I'm really hoping to find a way to get them playing well with the Teensy 3.2.
The Problem
There's a 'deadspot' in the analogRead() measurement for the pedals such that the measured value will very predictably 'jump' over a portion of the voltage range.
Please have a look at this video to see what I'm talking about. Note that I say it's a 25k pedal, but it's more like a 50k. See the schematics for the pedals at the end of the post.
https://www.youtube.com/watch?v=DxGnB3oeQsI
The Search
I've been googling my ass off and trying every suggestion I could without luck:
The only solution I've found so far is to filter out the dead spot in code. While the following code works, I consider it a dirty hack and I don't feel at all comfortable with it. A further complication is that if I adjust the “attenuator” knob of the Moog, the location and size of the dead spot change and I have not figured out how to deal with that.
Schematics

As I couldn't find a reliable diagram online, I opened up the EP-3 and checked the pot values and wiring. When I measure the resistance with a multimeter, I get 50k. I don't really understand that as I'm not so hot with electronics, but I've read other places people suggesting it was 50k.
Hi all,
I'm hoping someone could solve or even just explain a weird problem I'm having. The issue is in regards to reading some relatively high impedance expressing pedals with a Teensy 3.2 micro-controller. I've been able to reliably read these pedals with the Teensy 2.0 and the Teensy LC, but for some reason the Teensy 3.2 doesn't like them. The pedals in question are the Moog EP-3 and Yamaha FC7. I know Teensy is optimized for 10k pots, but these pedals perform flawlessly with the Teensy 2.0 and LC, so I'm really hoping to find a way to get them playing well with the Teensy 3.2.
The Problem
There's a 'deadspot' in the analogRead() measurement for the pedals such that the measured value will very predictably 'jump' over a portion of the voltage range.
Please have a look at this video to see what I'm talking about. Note that I say it's a 25k pedal, but it's more like a 50k. See the schematics for the pedals at the end of the post.
https://www.youtube.com/watch?v=DxGnB3oeQsI
The Search
I've been googling my ass off and trying every suggestion I could without luck:
- added a 0.1uF capacitor (cleans up the high frequency noise, but not the dead spot)
- hacked analogRead to add some delay between setting up the MUX and reading the value.
- used the ADC library to slow down the ADC measuring and sampling rates
- tested with a multimeter to verify that it's not an anomaly in my code
The only solution I've found so far is to filter out the dead spot in code. While the following code works, I consider it a dirty hack and I don't feel at all comfortable with it. A further complication is that if I adjust the “attenuator” knob of the Moog, the location and size of the dead spot change and I have not figured out how to deal with that.
Code:
#define DEAD_SPOT_SIZE 84
#define DEAD_SPOT_LOW_THRESH 400
#define DEAD_SPOT_HIGH_THRESH 530
int offset = 0;
float filterDeadSpot () {
int val = analogRead(valPin);
if (val < DEAD_SPOT_LOW_THRESH) offset = 0;
else if (val > DEAD_SPOT_HIGH_THRESH) offset = DEAD_SPOT_SIZE;
return (val – offset) / (1024.f - DEAD_SPOT_SIZE);
}
Schematics

As I couldn't find a reliable diagram online, I opened up the EP-3 and checked the pot values and wiring. When I measure the resistance with a multimeter, I get 50k. I don't really understand that as I'm not so hot with electronics, but I've read other places people suggesting it was 50k.
Last edited: