Problems with teensy 4.1 ADC signal – connecting to the wrong ground?

Unclear from what’s posted is what triggers ADC sampling and conversion (a timer interrupt so that it’s deterministic?), what upstream analog anti-alias filter you use, as in order and cutoff frequencies, what (if any at all) oversampling you have in the Teensy, and what the source output impedance of the analog voltage signal is.

The trend plots is all you shared so far, and those do not tell if we look at 1000, 10000 or 100000 samples, and if it is 1, 10, 1000 microseconds in between your application samples. The x axis units are us, ms, s or minutes? The T4 12 bit ADC can easily do one microsecond ish conversions, with the results pushed into a DMA buffer. If your application is about 10 kHz sampling, and noise is a concern, then consider ~1 MHz ADC sampling and box-car averaging 100 ADC samples into one application sample. Noise then drops by about sqrt(100) = 10 x.
But also then, you will need an analog anti-alias filter of say 20 kHz corner f, because without that noise from way above 1 MHz trickles back into your below 5 kHz trend plots.

I doubt though that the T4 Arduino style ADC library use will allow you to properly get you the deterministic (isochronic) real time 100x oversampling with DMA.

Differential versus single ended: see literature from reputable sources like TI, Analog Devices etc.
Source signal output impedance also matters.
And only then comes the quality of the ADC hardware inside the imrx1062 CPU. Dont expect that to be as good as what you get from dedicated ADC chips.
 
Using HIGH_SPEED conversion and VERY_HIGH_SPEED sampling will cause the readings to be noisier than if you use slower settings. Unless you need a very high sampling rate, you should use slower settings.
This might sound really stupid, but do you know the names of the slower speed sampling rates? I'm sorry if this is an incredible display of ignorance on my part, I'm just not aware of the other conversion options
 
The trend plots is all you shared so far, and those do not tell if we look at 1000, 10000 or 100000 samples, and if it is 1, 10, 1000 microseconds in between your application samples. The x axis units are us, ms, s or minutes? The T4 12 bit ADC can easily do one microsecond ish conversions, with the results pushed into a DMA buffer. If your application is about 10 kHz sampling, and noise is a concern, then consider ~1 MHz ADC sampling and box-car averaging 100 ADC samples into one application sample. Noise then drops by about sqrt(100) = 10 x.
But also then, you will need an analog anti-alias filter of say 20 kHz corner f, because without that noise from way above 1 MHz trickles back into your below 5 kHz trend plots.

I doubt though that the T4 Arduino style ADC library use will allow you to properly get you the deterministic (isochronic) real time 100x oversampling with DMA.
These are some interesting suggestions, thanks for them. Just to make sure I'm understanding you correctly, are you saying that for my 10 kHz datalogging, the Teensy actually takes 100 ADC conversions, stores them on the RAM or something, and then averages those 100 samples and stores that to the SD card?

If that is the case, I have one question about the noise. if the MHz noise is from outside, they I understand that filtering it out will help, but if the noise is from the board, won't it be impossible to filter that out (unless I guess we somehow coded the 1 MHz data to be filtered when it's on the RAM before being stored on the SD card)?

Also, regarding the isochronic (Exact timing?) of the oversampling, could we still get the 10 kHz samples to be at exact times that we store to the card, even if the MHz samples aren't?
 
After looking to the setup picture, I would conclude that you cannot get ever with a flying setup (pins connected breadboard style) any low noise result. To see what is goung on, plot say the 10 or 100 ms of data. I'm certain you will see the 50 Hz you are picking up (my ADCs do the same).
Attach Teensy to powerbank, put all into a metal box and go into the garden for a minute or two. The noise should than go down.
 
Last edited:
Actually, there’s a lot more that can be explored to reduce noise with T4 ADC’s. But the chip features to exploit that are not available easily when going pre-cooked libraries as you did till now. This relates not only to isochronous hardware timer triggered ADC sampling, DMA elastic buffers, but also to forcing the MPU into a dormant state when the ADC samples and converts. That way, noise from number crunching cannot trickle through onto the on-chip analog signal paths, including references, and noise from otherwise unrelated i/o pins that toggle while ADC runs is also less likely to do harm. Same for the power and GND.

See the ‘1062 MPU datasheet, ADC section.

The ADC libraries that you now use are written as one on one equivalent of what’s now legacy early Arduino or Teensy2, 3 ADC equivalent. That’s nice when porting from legacy to new: portable code etc… But I think it is time now for a new ADC_T4 library that is T4 only, and allows isochronous, deterministic, pipelined, elastic buffered, lower noise streaming.

Maybe it exists already?
 
After looking to the setup picture, I would conclude that you cannot get ever with a flying setup (pins connected breadboard style) any low noise result. To see what is goung on, plot say the 10 or 100 ms of data. I'm certain you will see the 50 Hz you are picking up (my ADCs do the same).
Attach Teensy to powerbank, put all into a metal box and go into the garden for a minute or two. The noise should than go down.
Thanks for the suggestion. I had another look, and it doesn't appear that there is much noise coming from 50 Hz - see this FFT:

1706101157571.png

1706101201790.png

here's some data:

1706101342075.png


so it looks like the noise is coming from a range of frequencies.
 
Actually, there’s a lot more that can be explored to reduce noise with T4 ADC’s. But the chip features to exploit that are not available easily when going pre-cooked libraries as you did till now. This relates not only to isochronous hardware timer triggered ADC sampling, DMA elastic buffers, but also to forcing the MPU into a dormant state when the ADC samples and converts. That way, noise from number crunching cannot trickle through onto the on-chip analog signal paths, including references, and noise from otherwise unrelated i/o pins that toggle while ADC runs is also less likely to do harm. Same for the power and GND.

See the ‘1062 MPU datasheet, ADC section.

The ADC libraries that you now use are written as one on one equivalent of what’s now legacy early Arduino or Teensy2, 3 ADC equivalent. That’s nice when porting from legacy to new: portable code etc… But I think it is time now for a new ADC_T4 library that is T4 only, and allows isochronous, deterministic, pipelined, elastic buffered, lower noise streaming.

Maybe it exists already?
Hi Sicco, thanks for the reply. At the moment, I don't think I'm in a position to go beyond the standard library, unless there is a very straightforward way to implement this. I don't think I have the time and/or skill to do it. With this limitation in mind, is it still possible to average the samples of the multiple ADC measurements (even 10x oversampling would be great)?

if there are newer libraries, that could work, but I'm not aware that there are any.

Also, do you think there would be less noise if I used a Teensy 3.6?
 
Last edited:
Back
Top