High speed DAQ and save data into SD card

My subject is about using Arduino Due (or Teensy, ESP32) to measure data from 4 strain gauges and 1 accelerometer (total 5 channels). I want to get about 15000 data per second with at least 10bits data resolution, the time duration for getting data is about 3 seconds. I want to use onboard ADC of the Arduino DUE(10bits) or Teensy, ESP(13bits), then save that data into SD card. My question is:
-Is it possible when using those board to get that much data? If no, what is highest samples per second that it can get?
Thank you very much for your time.

You can run the ADC controller of a DUE up to 1 Msps for a 12_bit resolution.

Due has a swag of memory. You might find it is easier to store that data in an array and record it at leisure.

This is the reason that I'm concerned. Is it possible to use "swag of memory". Could you please to tell me more about it.

I simply mean that it may be better to store the data in memory first, thereby avoiding any problems there may be with writing data to SD that quickly. Not only does the Due have more memory but I understand it is also faster than other Arduinos, while an SD card has its write speed limits irrespective of the Arduino it is conncted to. I don't know anything about Teensy.

15000 samples per second for 3 seconds equal 15000*3*2 = 90000 bytes (12_bit conversions)

You can store these samples in SRAM (maximum 96 Kbytes).

A possible sketch: Declare a buffer of 45000 half words Program ADC to be triggered by a Timer Counter 15000 times per second Program a Timer Counter to the right frequency, Trigger an interrupt at each ADC conversion to store the previous conversion After 45000 conversions, stop the Timer Counter. Store the logged data on an SD card

You will find in this forum and the DUE sub forum every piece of code you need.

ard_newbie: You can run the ADC controller of a DUE up to 1 Msps for a 12_bit resolution.

But its a pretty poor ADC from what I remember, 9 or 10 effective bits once you allow for noise and artifacts. The Due board just seems too noisy for good analog performance. And one or other of the DAC or ADC has 'sparkle codes' too, can't remember which

I would recommend using an external SPI ADC powered from a linear regulator and well decoupled.

PS Sparkle codes are anomolous values, many LSBs wrong, occuring pretty much at random. So called because of their effect in a video signal path.

And I've just found there are other names for sparkle codes, "rabbits" and "flyers" :)

You might want to read this:

http://www.djerickson.com/arduino/

and this:

http://www.analog.com/en/analog-dialogue/articles/analog-to-digital-converter-clock-optimization.html

Nick_Pyner: I simply mean that it may be better to store the data in memory first, thereby avoiding any problems there may be with writing data to SD that quickly. Not only does the Due have more memory but I understand it is also faster than other Arduinos, while an SD card has its write speed limits irrespective of the Arduino it is conncted to. I don't know anything about Teensy.

The teensy 3.6 have 180Mhz ARM, 1M Flash, 256K Ram, 4K EEPROM, and 13bit ADC, but i don't know the effective resolution of it.

ard_newbie: 15000 samples per second for 3 seconds equal 15000*3*2 = 90000 bytes (12_bit conversions)

You can store these samples in SRAM (maximum 96 Kbytes).

A possible sketch: Declare a buffer of 45000 half words Program ADC to be triggered by a Timer Counter 15000 times per second Program a Timer Counter to the right frequency, Trigger an interrupt at each ADC conversion to store the previous conversion After 45000 conversions, stop the Timer Counter. Store the logged data on an SD card

You will find in this forum and the DUE sub forum every piece of code you need.

Thank you very much for very detailed information. I will learn more about it.

MarkT:
But its a pretty poor ADC from what I remember, 9 or 10 effective bits once you allow for noise and
artifacts. The Due board just seems too noisy for good analog performance. And one or other
of the DAC or ADC has ‘sparkle codes’ too, can’t remember which

I would recommend using an external SPI ADC powered from a linear regulator and well decoupled.

PS Sparkle codes are anomolous values, many LSBs wrong, occuring pretty much at random. So
called because of their effect in a video signal path.

And I’ve just found there are other names for sparkle codes, “rabbits” and “flyers” :slight_smile:

I’m also thinking about using external SPI ADC, but my knowledge is very poor about this subject, could you please to help me to give me some name of external SPI ADC that i can use. I need at least 5 channel, 15000 sample per second, frequency range is from 0Hz to 20000Hz. Thank you very much.

thanhvu1990: The teensy 3.6 have 180Mhz ARM, 1M Flash, 256K Ram, 4K EEPROM, and 13bit ADC, but i don't know the effective resolution of it.

None of this changes my point that the write-speed limits of the SD may mean you are better off storing the data on-board, and writing it out after the three seconds. The faster Arduino goes, the more likely this is to be the case. I assume 13bits is the resolution. It sounds quite a lot. There is another discussion nearby about fast data aquisition. That DrDooom guy seems to be pretty clued up.

Nick_Pyner: None of this changes my point that the write-speed limits of the SD may mean you are better off storing the data on-board, and writing it out after the three seconds. The faster Arduino goes, the more likely this is to be the case. I assume 13bits is the resolution. It sounds quite a lot. There is another discussion nearby about fast data aquisition. That DrDooom guy seems to be pretty clued up.

I got it. thank you very much for your time.