Sd Electron to back up data

Can anyone help me find a way to store data in the Electron, Trying to use an SD card reader to be able to back up data if the Cell on the electron goes out so don’t lose the data ( 32 bye string ), Using the SdFat library but seem to only work for photons.
Any direction would be helpful
Thanks

@SolarChamp, how much data do you want to store?

1 Like

using an 16Gb chip but it only a 32byte string (03D88039E8987A21B64E33026B17000000BB060000D007044F7E000
00000568D ) unsigned Char

@SolarChamp, so the total storage you need is 32 bytes? Or do you want to store multiple 32 byte strings?

Want it to be able to store the 32 bytes , over and over again each string has data in it that need to be extracted later to calc . The string get generated every few min and need to be able to storage that string until the device can upload to the cloud. max would be not much more then a week of data at rate of 32bytes every 5 min. sorry if this confusing

@SolarChamp, so then the total maximum storage required is:

12/hr * 24hr/d * 7d * 32 bytes = 9,440 bytes

Using a microSD may be overkill. You may want to consider using an SPI NOR Flash chip along with the SPIFFS library. A 128KB (1Mbit) flash is less than $1. SPIFFS provides a file system much like SDFat but also handles wear levelling which a microSD does by itself.

As for using a microSD with an Electron, I can’t vouch for that but I will be testing it myself.

2 Likes

I’ve used the SDFAT library with the Electron and it worked fine. Make sure you are using current system firmware (0.6.2, for example). There were some versions that had trouble using SPI2. The primary SPI interface on the A pins should work on all system firmware versions.

Also VIN is only powered on the Electron if powered by USB, so make sure you’re using 3V3 to power the SD card holder board.

But peekay123’s suggestion about using a smaller SPI flash chip is probably a better idea.

3 Likes