Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: ADC Questions using Teensy 3.5 for midi potentiometers use.

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    15

    ADC Questions using Teensy 3.5 for midi potentiometers use.

    I am working on a Midi controller but have some questions about taking the best approach to utilizing potentiometers as input devices. First is if I use the onboard A to D converters on the teensy 3.5 my AREF can only be as high as 3.3 vdc if using an external reference. So this would give me a resolution of about .8 millivolts for a 12 bit conversion. I was considering using an external AREF of 2.048 vdc which would give me approximately .5 millivolts resolution for 12 bit conversion. Considering that I could only supply the potentiometers with no more then 2.048 vdc I would suspect that the measurements would be more susceptible to noise by using such a low AREF. I would need to supply the potentiometers with a fairly noise free voltage source to prevent so called jitter in my readings. Putting a capacitor on the input of an A/D converter is not an ideal fix to remedy noise. Hardware filtering would be much better I would believe and also provide a proper input impedance to the A/D converters if used as a unity gain buffer also. But now I am thinking that maybe utilizing an off board 12 bit A/D converter would be a better approach since I can increase the A/D voltage reference to 4.095 vdc and use a higher supply to the potentiometers possibly not measuring as much noise if it exists. I am stuck on what would be the best way to accomplish. Stay with in onboard teensy A/D converter or use an offboard converter. Using an external converter would mean much more coding but maybe not have a much noise showing up in the lower bits of the conversion. Any advice or opinions on this is appreciated. Thanks.

  2. #2
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,938
    Most people doing midi just put the pots on the 3.3V supply and leave it at that, possibly with some software averaging but fundamentally midi is 8 bit so there is a question just how precise do you need to be unless there is a fair bit of pre-processing happening to justify the work.

    Adding caps generally doesn't help a lot with pots, unless they are small low value/low ESR ones targeting EMI. What they can do is make your pots slow to respond due to holding the charge.

    The bigest noise driver will probably be the pots themselves unless they are multi turn, and also worth thinking a bit about what size you use, larger means lower current draw, smaller gets lower noise due higher through pot current flow, 1-5k seems to be the standard for these things.

    Also might have been easier to read if you had broken out your questions from that single block of text.

  3. #3
    Junior Member
    Join Date
    Mar 2017
    Posts
    15
    Quote Originally Posted by GremlinWrangler View Post
    Most people doing midi just put the pots on the 3.3V supply and leave it at that, possibly with some software averaging but fundamentally midi is 8 bit so there is a question just how precise do you need to be unless there is a fair bit of pre-processing happening to justify the work.

    Adding caps generally doesn't help a lot with pots, unless they are small low value/low ESR ones targeting EMI. What they can do is make your pots slow to respond due to holding the charge.

    The bigest noise driver will probably be the pots themselves unless they are multi turn, and also worth thinking a bit about what size you use, larger means lower current draw, smaller gets lower noise due higher through pot current flow, 1-5k seems to be the standard for these things.

    Also might have been easier to read if you had broken out your questions from that single block of text.

    I already tried this using the 3.3v coming off the Teensy feeding the pots and used the internal AREF and had good results with not much problems with noise at all.

    Having a usb powered audio interface (Native Instruments KOMPLETE AUDIO 6 ) I had a lot of problems with ground loop noise being generated from the computers usb connection. I eliminated the noise using audio isolation transformers on my audio lines out of the audio interface.

    So suspecting that my USB ports will always have noise on them I don't want the noise to be a problem with the A/D of the teensy. I figured by running an external AREF and using a separate supply for the potentiometers I could get even better results.
    There is some smoothing (averaging) in my code and hysteresis to help overcome any fluctuations in the lower bits.

    I am going to just be using 4 10k pots for now and the Trellis button keypad (16 buttions only) on I2C.
    The Teensy is USB buss powered and I know there is a lot on noise on it being generated from the computer. Would it not be better to have the pots powered by a separate supply and not from the 3.3v from the teensy? Do you think 12bits is overkill for this?

    I've seen lots of code examples trying to reduce effects of noise on midi projects like this. I was thinking it would be better to provide a hardware solution rather then software. Or maybe just a combination of both.

    Bryan

  4. #4
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,938
    Pre-emptive is certainly good, but remember your pots are already on a regulated 3.3V supply so partly protected from the 'somewhere +/- half a volt USB weirdness anyway. People do see improvement with using proper stand alone reference supplies that get rid of the Teensy related noise though so can certainly help. Equally critical to get the best out of this though is keeping your pot wiring under control, and not acting as antennas since the music production enviroment can be pretty harsh EMI wise.

    If planing ahead to avoid then you'd go for a 2-3 volt reference supply and look at shielding the pots and all three wires running to them to tame the induced noise. Unsure if ferrite beads on the sense lines would make a measurable difference.

  5. #5
    Senior Member
    Join Date
    Jan 2017
    Location
    Maastricht
    Posts
    181
    I used the ResponsiveAnalogRead (a big thanks to Damien Clarke for that one) and a 3V voltage reference on a fader panel I'm working on and it works like a charm. The readings are rock solid (10 bit resolution). It's even possible to set the faders accurate to the last bit, given these are 100mm faders that's an accuracy of 0.1mm!
    Here's a picture of the setup:

    Click image for larger version. 

Name:	Zeus-SPS-8-fader-panel.jpg 
Views:	133 
Size:	164.8 KB 
ID:	9877

    As you can see I did not put much effort into shielding the wires and it works just fine. IMHO 10 bit resolution is sufficient, in the case of 100mm faders a resolution of 12 bit would translate to a mechanical resolution of less than 0.25mm and I don't see how one could position a fader that accurate.

    Kind regards,

    Gerrit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •