# Writing large volume of data to SD card

I'm planning to make a data logger project with 3-axis sensor and SD card. I would like to store 3200 samples per every second on SD card. Currently I could able to store only 630 samples per second.

Someone told me writing in binary format is the solution.

Then I did accordingly.

fwrite(readings,sizeof(int16_t),6,logFile);


I can see .bin file with more data size compared to .txt or printf.

How can I get the readable ASCII format from .bin file?

I tried by using fread.

FILE *logFile = fopen(fileName,"rb");


How can I see the readable ASCII data?.

Thank you.

• What library are you using? This isnt code from the Arduino SD library. Edit your post and show the rest of your code – SoreDakeNoKoto Jan 19 '16 at 11:45
• You may want to change the title of your question. You ask about reading binary data from a .bin file, not writing data to a sd-card, as this works already (as I have understood). – jwsc Jan 19 '16 at 12:22
• regarding the writing of the data to the sd-card. If you buffer the data in memory, (for instance, have a buffer that is large enough to hold 1 second of data) read the data from the sensor into the 'appropriate' location(s) in the buffer. then, switch to a second buffer for reading the data while writing the first buffer to the sd-card, then when the second buffer is full, switch back to the first buffer for input (I.E. use double buffering) then the throughput will be massively increased – user3629249 Jan 19 '16 at 15:29

printf( "\n");