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

Thread: Adc fluctuations teensy 3.6

  1. #1
    Junior Member
    Join Date
    Apr 2020
    Posts
    5

    Adc fluctuations teensy 3.6

    Hi, I'm trying to read a voltage on a analog pin with my teensy 3.6 but there are a lot of fluctuations in the readings.

    I first read the tension of my power supply (12v, after a tension divider (r1 = 3.9kOhms and R2 = 1kOhms), and this adc line is clamped with two diodes between +3v3 from one LM1117 and ground, the readings are very stable.

    I then try to read another tension, clamped to a stable +5v, and this time my tension divider is r1 = 180kOhms and r2 = 330kOhms, the readings are pretty chaotics.

    All my adc's lines have two filter capacitors to prevent fluctuations.

    What's weird is that when I read this tension with my Arduino Uno, it's very very very stable, like it should be with my Teensy, even with my voltmeter the value is stable

    Do you have any ideas on what is going on 😥 ?

    Thank you very much for your help

  2. #2
    Junior Member
    Join Date
    Apr 2020
    Posts
    5
    I first thought of an impedance problem but why the arduino would be able to read it stably and the Teensy not 🤔🤔

  3. #3
    Senior Member
    Join Date
    Mar 2016
    Posts
    200
    Is your stable +5V from the USB on the Teensy? I've been struggling with the same problem on a Teensy 3.2. The 12 bit ADC input had at least 5 LSBs of noise (around 25 mV). I wound up using an external voltage reference and a filter on the ADC input which got the noise down to about 2 LSBs with 12 bit ADC. A simple IIF on top of that gives me pretty stable results. Oddly enough, the same set up on a Teensy 4.0 using the 3.3V as the reference (no ext ref on the T4) was rock solid even with no filter - barely 1 LSB of noise.

  4. #4
    Junior Member
    Join Date
    Apr 2020
    Posts
    5
    My +5v is very stable (out of a mic29301), but the problem occurs both with my external supply or with the usb power from my laptop.

    What is really weird is that the first reading of the +3v3 is stable, no noise at all, but when it comes to the other adc line, it's an other story.

    With my arduino uno, everything is fine, no noise at all. That's why i'm thinking of an impedance problem with the very large resistors from the tension divider...

  5. #5
    Senior Member
    Join Date
    Apr 2019
    Posts
    109
    Hello, your voltage divider resistors have significantly high resistance, why do they need to be so high? The 16-bit ADC is only getting a few microamps of current, the noise is probably also of the same order. Also if you're using digital signals, connect your analog ground to the Analog GND pin, which may help filter digital noise appearing on the ground.

  6. #6
    Junior Member
    Join Date
    Apr 2020
    Posts
    5
    Thanks UHF for your answer,

    AnalogGND is already connected to ground, and you're right, I will try with smaller resistors.

    But what I don't get is why does it work fine with the Uno and not with the Teensy ?

    And also, I'm working with 10-bit adc, and the range of noise is from -30 to +30 😞

  7. #7
    Senior Member
    Join Date
    Apr 2019
    Posts
    109
    The ADC on the Uno has an input impedance of 100M and possibly a significant input capacitance, compared to the K66 on the T3.6 (up to 5K). The Uno is less sensitive to the noise.

  8. #8
    Junior Member
    Join Date
    Apr 2020
    Posts
    5
    The 180k and 330k are here to divide the 5v signal to a 3v3 signal, without interfering too much with a previous devider with a thermistor.

    Do you think by adding an op-amp like the lmv324, it'll get rid of the high impedance, and if so, do I have to put a resistor between the op-amp output and the analog input ?

  9. #9
    Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    21
    If your Impedance is more than 10k you need a capacitor at your input.
    If this become too slow, you need the opamp.

  10. #10
    Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    21
    If an other Input is higher than 3.3V or lower than 0V you will have noise and error.
    So i use rail to rail opamps with the same supply as avcc.

Posting Permissions

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