Looking for an adc

Status
Not open for further replies.

JerBaf

Member
Hi,

My name is jeremy and I'm currently on a midi controller project. I use a T4.0 for the microcontroller and some FSRs as sensors. The problem is data acquisition speed. I have 74 fsr and would like to sample all of them (so make 74 measures/ analog read) in 150 micro sec max. I bought a MCP3008 but I am able to reach only 350 micro sec for all measures. And for the internal adc of the T4.0 I have 17 micro sec per read which is too much. Do you guys have any recommendation of an external adc with around 10 bit of precision and a sample speed of 1Mksps. And also do you know if I can sample faster with my T4.0 and if yes how.

Thank you very much for your time

Jeremy
 
Looks pretty great but it has only one input channel, I'm looking for something with 4-8 channel. But maybe on channel is enough and I just use a multiplexer connected to the teensy to select the channel to put in the adc. But I don't know, is it adding latency to use a multiplexer before the external adc to select the channel?
 
Didn't see any high speed ADCs with built in multiplexing. External multiplexing is no different from internal multiplexing
for latency.

I'm a bit confused by the need for this kind of speed for a MIDI controller in the first place, in 150µs a drum stick might travel
about a millimetre when wielded in anger, for instance. Human-relevant timescales are ~ 20ms and above.
 
We need this speed to detect peak of force when we hit the fsr with a vibe mallet. We have seen experimentaly thay we need a refresh rate of 150 micro sec in order to detect efficiently the peak. But as we sample FSRs sequentially we need 150/nb of fsr(=74) sample time per entry which is around 2 micro sec.
 
Also do you kwow if I have to create my own library to use the adcs7477 or is there any generic library for external adc uses?
 
> for the internal adc of the T4.0 I have 17 micro sec

It will go fast enough for you - you just need the right settings.
 
> for the internal adc of the T4.0 I have 17 micro sec

It will go fast enough for you - you just need the right settings.

I succeeded to increase the speed of the internal ADC to 1 microsec for an analog read but I sacrified precision I think (I used the updated adc library : https://forum.pjrc.com/threads/25532-ADC-library-update-now-with-support-for-Teensy-3-1). For me, I think it's more reliable to use an ADC whose original sampling speed is 1Msps than to boost the internal one, but maybe I'm wrong.

Here's the code for the "boosting" mode:

#include <ADC.h>
#include <ADC_util.h>

int x,y, val = 0;
ADC *adc = new ADC();

void setup() {
// put your setup code here, to run once:
Serial.begin(115200); // adc object
adc->adc1->setAveraging(1);
adc->adc1->setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED);
adc->adc1->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED);
adc->adc0->setAveraging(1);
adc->adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED);
adc->adc0->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED);
}

void loop() {
// put your main code here, to run repeatedly:
x = micros();
val = adc->analogRead(A0);
y = micros();
Serial.println(y-x);
delay(1000);
}
 
Only needing 400 ksps, you have plenty of room to adjust settings for better precision. Do use low source impedance (say 1K) and both ADCs in parallel (for a 2X speedup).
 
Something like this:

Code:
ADC::Sync_result sr;

adc->adc0->setAveraging(1);                                    // set number of averages
adc->adc0->setResolution(12);                                   // set bits of resolution
adc->adc0->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED); // change the conversion speed
adc->adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::HIGH_SPEED);     // change the sampling speed


adc->adc1->setAveraging(1);                                    // set number of averages
adc->adc1->setResolution(12);                                   // set bits of resolution
adc->adc1->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED); // change the conversion speed
adc->adc1->setSamplingSpeed(ADC_SAMPLING_SPEED::HIGH_SPEED);     // change the sampling speed


sr = adc->analogSyncRead(adc_pins[i], adc_pins[i+1]); // read two at once
val[i] = sr.result_adc0;
val[i + 1] = sr.result_adc1;

This should be standard practice for anyone concerned about ADC speed. I get .8 usec per read, so you could set Averaging to 2.
 
Excellent! Will try it in a few hours with the sensors to check the precision but it is very promising. Thanks a lot!
 
We need this speed to detect peak of force when we hit the fsr with a vibe mallet. We have seen experimentaly thay we need a refresh rate of 150 micro sec in order to detect efficiently the peak. But as we sample FSRs sequentially we need 150/nb of fsr(=74) sample time per entry which is around 2 micro sec.

Ah, so its a very short impact time on a hard surface? A common approach for this kind of measurement is to integrate the signal,
then difference in successive measurements records the energy, and you can sample less often.

However this takes extra hardware which is clearly an issue with lots of sensors, and your baseline response probably
isn't zero to start with requiring a high-pass filter as well.
 
Status
Not open for further replies.
Back
Top