Is it possible to store data, then average a number of sets and write result to SD?

Status
Not open for further replies.

Matadormac

Well-known member
Good day all.

I have a data logger project recording the environment. I need to sample fairly often but I don't need to write to the SD card that often. I would like to sample every minute (possibly even more often), save that data, average the captured data for a 1 hour period and then write that 1 hr average to an SD card. If I write this data to the built in flash memory will I run into any issues? Would it be better to write to some sort of RAM or even use part of the Teensy ram? I am using a Teensy 3.2 and my program takes up less than 35% of the Teensy memory.

Thank you for your thoughts and time. I have spent some time trying to find relevant threads but so far haven't an answer to the above.

Regards
 
The flash memory would work for this, but you will in theory eventually run into trouble with the numbers of cycles. Can't find the specs at the moment but believe it's something like 100k read write cycles to become a problem. Some math for your intended use will tell you if that's acceptable life time. If this is a low risk hobby project you would almost certainly be able to exceed it, but if this is a product with thousands built then the odds of hitting one that fails early comes up.

That said, if this is a battery powered device defining a massive RAM array and parking your data there will be more power efficient and much easier to do math with prior to saving. Just remember to leave enough memory for the SD library to use while storing.
 
Thank you for your reply. Yes, this needs to be a robust application with the potential for many, many thousands of data saves. Hence my concern with EEPROM data writing/storage. I will look into using a RAM array. I have also looked at some ingenious FRAM solutions.

Regards
 
You have about 40k of ram left. log 1 byte a second thats 11 hours worth before you have to write to SD.
 
That is great news, I wasn't sure how to even estimate how much "overhead" might be used if I did that. Currently I think I will write to to the SD every hour.

Thank you
 
Status
Not open for further replies.
Back
Top