Pages: [1]   Go Down
Author Topic: Reliable sampling and logging frequencies for Arduino Mega 2560 Rev 3  (Read 1518 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am new to microcontroller programming but work around industrial PLCs, so some concepts are familiar to me.

I would like to use an Arduino Mega as a datalogger to capture an analog signal at 500 Hz, save the individual data with a timestamp for each point in a pain text file on a flash card.  These data will later be downloaded to a laptop and an FFT routine run on the data. 

I need sampling of one analog signal at 500 Hz.  I would like sampling of 8 analog signals at 500 Hz, and the possibility of sampling 1-2 signals at up to 1500 Hz.  I imagine that the timestamp on each line would be the time the variables were scanned sequentially with a very slight delay between each signal due to processing time.  This is not a problem for the application.  When including the time required to write to flash, and potential delay due to communication with an external ADC if resolution better than 10 bits is required, would the Mega 2560 be fast enough for the different scenarios above?

For best results, I need consistent delays between each sample.  It seems like adding a realtime clock would be a good start.  From there, what would be the best way to achieve regular sampling?  Would using the clock to trigger an interrupt be consistent, or is there a better way to do this?

I would like better resolution than 10 bits from the onboard ADC, and am not opposed to using an external ADC IC for better resolution.  It seems that an external ADC using SPI for communication would be faster than I2C or plain serial communication.  Understanding that the conversion speed of the external ADC IC must be accounted for, could this be a practical solution to obtain higher resolution without running into problems with sampling frequency?

Thank you for any advice that you can offer on my questions.

Regards.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12430
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


MOre than 10 bits means external ADC's, how many bits are you thinking of?

something like - http://www.analog.com/en/analog-to-digital-converters/ad-converters/ad7991/products/product.html -?

The use of external I2C ADC's give you the option of scaling (multiple ADC's to parallelize the load

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

robtillaart,

Thanks for the reply.  Ideally I would like 12-16+ bit resolution so the IC you suggest looks good for the purpose to me.  I plan on working on the logic first using the onboard ADCs and then refine it as needed using external ADCs.

As a followup to my original post, there is no real need to sample 8 channels "simultaneously"; they could be sampled in succession with no negative effect.  It would, however, be beneficial to have the ability to sample 2 channels "simultaneously."

Regards



MOre than 10 bits means external ADC's, how many bits are you thinking of?

something like - http://www.analog.com/en/analog-to-digital-converters/ad-converters/ad7991/products/product.html -?

The use of external I2C ADC's give you the option of scaling (multiple ADC's to parallelize the load


Logged

Pages: [1]   Go Up
Jump to: