Which hardware improvement(s) to reduce noise on Teensy analog inputs?

Status
Not open for further replies.

amundsen

Well-known member
Hello,

I have an homemade sensorbox with a dozen of sliders connected to a Teensy 3.2. I want to use the highest possible ADC resolution but I cannot achieve more than 9 bits without filtering. I have tested several filter types (including the ResponsiveAnalogRead library) and I've had the best results with a median filter.

I would like to improve the the hardware setup. I already have a capacitor between the + and ground on every fader.

What would provide the best results?
1. Power the box with a clean, separate power source instead of the USB?
2. Cover the inside of the wooden box with metal and connect this metal to the ground (shielding)?
3. Connect the sliders to the Teensy over a PCB instead of wires?

Thank you.
 
Trimmed mean will typically slightly outperform median. But post a schematic to show what you are doing with hardware.
 
Is this a "spare no expense" project, or a "get the best results without going overboard" project?

The ADCs in the Teensy 3.2 microcontroller can pull enough current during sampling that they appear to produce noise-like results. So a good way to handle that situation is to place an amplifier between the slider / pot / sense circuit and the Teensy's ADC input, though that's quite a bit more work.

Alternatively given the fact the sliders' motion is controlled by human hands (true? or are they motorized?) it should be possible to use strong averaging or low pass filtering. Note that averaging and low pass filtering limit responsiveness.

Edited to comment that my company's project uses Kinetis parts and we found that the switching current when starting ADC samples flatly required having a pretty carefully designed front-end.
 
This might save you some work/stress/etc: My two cents would be to think about how many discrete steps a person could actually ever move a slider like this. Most midi controls are only 128 discrete steps and that is "enough" for sliders and knobs controlling realtime audio parameters. Granted, I think 128 steps is a bit low - but even with a very large knob or long slider I'm not able to move it in small enough increments to get 128 steps out of it.

The idea of requiring 14, 15 or even 16 bits of useable steps for the location of a slider could very well be overkill.

That being said, I've had promising results using the "Responsive Analog Read" library to read the location of potentiometers and it seems like I get an increase in useable resolution from the software side.

https://github.com/dxinteractive/ResponsiveAnalogRead

This is available in the Manage Libraries section of the arduino IDE.
 
What's always worked for me, if you want the best resolution signal with the least amount of noise on Teensy ADC inputs, especially on high impedance signals (say, over 5K) is to use a unity gain op amp buffer between signal and a Teensy ADC input. This may be more fuss than you want, but it can eliminate a lot of noise and weirdness (like values seemingly getting stuck at high numbers until reboot, for example). I've seen this enough times, that unless I'm just using a simple pot where accuracy isn't all that important, I just put in an op-amp and be done with it. If your pots are at high impedances (like 10K, 20K, etc) it's worth considering using an op-amp buffer for sure, in my humble opinion. I know for me it leads to more reliable results.

This is of course is to be used with the software debouncing and perhaps averaging as well. I have found that using, say, a 4x hardware average in the ADC itself, and then, taking each three input samples out of the ADC, in software either average them or take their median, and use the resulting value as your "signal value." This implies that your virtual sampling frequency is going to be one-third the frequency of your ADC sampling frequency. So take that into account if you need to.

I find this "average (or median) of threes" method tends to reduce the noise quite a bit, without smoothing off too much of the peak values. On Teensy 3.6's for example, you can get the noise down to basically the resolution of the ADC (so around 12 bit resolution), if you use this method, coupled with using an op-amp buffer if your signal is high impedance. You can of course also use a hardware low pass filter before the op-amp, (like a simple RC filter) to keep the op-amp happy. What cutoff frequency to use is highly dependent on your signal and sampling frequency. I tend to use one to remove really high-frequency crap that might cause the op amp to behave weirdly.
 
Status
Not open for further replies.
Back
Top