0

I am interested in storing accelerometer data to an SD card. Since power consumption is the main consideration of my project, it is important to do as few writes to the SD as possible, because the SD requires much current, and also takes long to be written, keeping my MCU from sleeping.

  1. The data to be stored are about 50 bits of data at 10Hz, so I need to store 500c bits per second, or around 63 bytes per second. The arduino uno EEPROM is 1024 bytes, which could give me around 16 seconds of data stored before having to access my SD card. However I have seen that the EEPROM has limited write cycles (100000). So each byte can be written 100000 times, which gives us a total of 1000*100000=100000000 bytes to be written.As a result, with writing there 63 bytes per second, that would give me 1587301 seconds=441hours=18days of EEPROM lifetime, which is unacceptable. Is this correct?
  2. If (1) is correct and using internal eeprom is not a possible solution, what other recommendations do you have? Is there an alternative to SD storage, that requires less power and less writing time, so that it is cheaper power-wise? The total storage should be around 200MB.
  • Why do you want to use EEPROM? Why not just a simple buffer array? – chrisl Apr 29 at 19:33
  • @chrisl It is a good idea, on what memory would the buffer array be stored, though? – NickG Apr 30 at 9:02
  • The buffer would be stored in RAM. Normally EEPROM is only used, when you need persistent storage, which keeps the values over power cycles or resets. But that doesn't seem to be the case for you. Though you still need to see, how big you can make the buffer (that depends on the memory and library usage of your sketch) – chrisl Apr 30 at 10:23
0

Regarding 1, it's true that EEPROM has limited write cycles. Mostly it can be much more, but it's only guaranteed upto that number, so I can imagine you don't want taking the risk to be lucky.

Regarding 2, other solutions could be external SRAM, which can be much more than just 1 KB, but also adds some extra components, thus cost and more important power. When that SRAM is full (can be many KBs), you can transfer it to the SD card.

Another (added) improvement you might think of (if you did not already) is data compression (trying to store the 50 bits in less bits), but this will cost some 'computing' power.

| improve this answer | |
0

To start with power consumption rules an Arduino UNO out so you will need some device capable of (deep) sleep mode. Devices like ESP8266 or ESP32. The table below shows the differences between each mode (information from the ESP8266 datasheet).

Item                 Modem-sleep        Light-sleep       Deep-sleep
Wi-Fi                   OFF          OFF            OFF
System clock             ON         OFF             OFF
RTC                     ON          ON              ON
CPU                     ON          Pending         OFF
Substrate current     15 mA        0.4 mA          ~20 uA
Avg. current (DTIM = 1) 16.2 mA     1.8 mA            –
Avg. current (DTIM = 3) 15.4 mA     0.9 mA            –
Avg.current (DTIM = 10) 15.2 mA     0.55 mA

These modules have around 4MB flash which yoi could use for storage of data (SPIFFS/LittleFS) so 1MB for programs and 3MB for on board storage, after that you save to SD and fill up the onboard FS again or you send the data via WLAN to an online storage or database or to a server in your network (depending on your scenario) These devices cost as much as an Arduino UNO clone (5-7$) and can be programmed with the same IDEs as Arduinos and in the same (extern C/)C++ derivate. So if power consumption is an issue look at those IoT devices

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.