I'm a intern (mechanical engineering) and I have to continue a project started by people before me.
I've to get the acceleration from an acquisistion system placed iside a metal ball that fall from a height (between 0.1 to 3m) and bounce on the floor. But the mesure takes between 100ms to 1s, and I need to get an acquisition every 0.1ms (I can go up to 0.5 but this is not ideal, because the norm is 0.1ms)
So obviously to have a fast writting speed: I need to write on the Arduino own memory (I've tried sending the acquisition directly to the PC but it is way too slow)
Here comes my problem: The Arduino memory only allows me to stock 800 points (so 80ms <<1s).
How can I increase the Arduino own memory?
Use a SD card wouldn't work because the writting speed would be too slow (I guess).
Thank you for your answer, and sorry if it's a stupid question, I'm not familiar with programmation, even if I understand it well.
An Arduino DUE has 96 Kbytes of contiguous SRAM plus 4K non contiguous SRAM, therefore you could easily store up to 90 K Bytes.
90 Kbytes gives you enough space to store 23040 32_bit values. Furthermore, there is a native USB port much faster for Serial prints (SerialUSB.print () or SerialUSB.Write()) than the programming port (Serial.print()).
I've an Arduino UNO for the moment, and I was hoping for a solution that wouldn't make me buy a new device (If there is no cheaper or other solution that's probably what I'll do).... but I guess the easy thing would be to change for an Arduino DUE.
There are many alternatives available these days which are faster, smaller have more ram memory and are almost 100% compatible with Arduino sketches and IDE.
External SRAM (or FRAM) should surely work. Also EEPROM whith large enough pages or SD card will be sufficient I guess. Depends how much data you want to write each 0.1 ms.
An SD card is more than fast enough on an UNO. It's easily capable of 200KB per second. I recently helped another user achieve 20Hz sampling of GPS (5 values) plus 100Hz sampling of an IMU (9 values), two wheel speed sensors and one ADC conversion, all with timestamps.
After looking at your sketch, I see you are just taking one ADC sample. 10Hz (or higher) would be very easy.
You could also write some software to "compress" the samples in some way. I suspect a falling ball will produce nearly-identical acceleration readings (zero) until it hits the ground. After the impact vibration settles down, it will have the same readings until it hits the ground again.
An SD card reader is an easy addition, and a microSD card won't take up much more space. Try to get one that has 5V-to-3V level shifting (with FETs) instead of resistors... That's a little more reliable.
If you want to retrieve the data from Arduino later by computer AND you can ensure it will be constantly powered, SPI SRAM is probably the best way.
If you cannot ensure power all the time you can
backup power for the SRAM
use FRAM
use SPI EEPROM(s) with 256B pages (if you need to write only a few bytes per measurement)
use SD card - I have no idea what writing speed you can get and how quickly you will wear it out but you will be able to retrieve it and read it in computer directly. But you need level shifting, possibly better power source and more complicated program
write data to Arduino's own flash
Personaly I think 1 > 2 > 3 > 4 > 5 but it is up to you.
LOL, totally misread that! At 10kHz, writing 20 bytes per sample to an SD is 200kB/s. This is still easily achievable for one ADC value of 2 binary bytes, 2 HEX chars, or 4 decimal chars plus newlines.
A little more than 512 bytes of RAM will be used for the SD library, and you may want a small ring buffer for your samples.