cancel
Showing results for 
Search instead for 
Did you mean: 

Storage Format For Multiple Sensors: STM32 Datalogger

avashalo
Associate II
Posted on October 28, 2015 at 14:20

Hi,

I am working with a STM32 data logger with a pulse counter, SPI accelerometer and ADC connected. I am puzzled: how can I design a common 4/8Kb buffer for time-synchronous sensor values for later SDIO SDcard storage? Like, with the timestamp value, it'll store all three sensor values together. I request some guidance.

Thanks in advance.

5 REPLIES 5
AvaTar
Lead
Posted on October 28, 2015 at 14:29

Assuming you want to use the C language, have you heard of the

struct

keyword ?

Like here :

https://en.wikipedia.org/wiki/Struct_%28C_programming_language%29

You can define an array of such struct items as buffer for your data.

Posted on October 28, 2015 at 15:55

Is the data collected from the sensors with different or similar rates? Do the different ratios suggest a good packing multiple?

You can write 4/8K blocks, and still have smaller structures, you just have to buffer them and manage the writing to get the optimal throughput.

Why can't you think about how you want to arrange the data? How would other things do it, how do you plan on processing it? Would ASCII line records, like .CSV, be the most suitable for input into other tools? Would a compact binary format be easier to process later, and use space more efficiently?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
avashalo
Associate II
Posted on October 28, 2015 at 17:38

Thanks, .csv format is ok, I guess. Sensors are giving data at different rates like 5ms, 10ms and 100ms. How to buffer them? I request some more guidelines.

Thanks in advance.
Posted on October 28, 2015 at 18:44

You'd store data in sufficiently large arrays, and accumulate blocks of data.

Perhaps this is something you need to discuss with colleagues or project supervisors, this all comes down to basic data and structure management, something that a CS program should cover.

Speak to the people that are going to use the device, and what their expectations, and processing requirements are.

I think there is a line here between ''guiding'' and actually doing the work/studying for you, and I'm not keen to doing the latter.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
avashalo
Associate II
Posted on October 28, 2015 at 20:02

Got it, Thank you.