# Sd Electron to back up data

**URL:** <https://community.particle.io/t/sd-electron-to-back-up-data/36649>\
**Category:** Troubleshooting\
**Created:** [October 12, 2017, 6:12pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649 "2017-10-12T18:12:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SolarChamp](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SolarChamp](https://community.particle.io/u/SolarChamp)\
**Post date:** [October 12, 2017, 6:12pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/1 "2017-10-12T18:12:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [October 12, 2017, 6:39pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/2 "2017-10-12T18:39:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SolarChamp](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SolarChamp](https://community.particle.io/u/SolarChamp)\
**Post date:** [October 12, 2017, 6:45pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/3 "2017-10-12T18:45:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [October 12, 2017, 6:46pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/4 "2017-10-12T18:46:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SolarChamp](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SolarChamp](https://community.particle.io/u/SolarChamp)\
**Post date:** [October 12, 2017, 6:50pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/5 "2017-10-12T18:50:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [October 12, 2017, 7:03pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/6 "2017-10-12T19:03:12Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [October 12, 2017, 7:17pm UTC](https://community.particle.io/t/sd-electron-to-back-up-data/36649/7 "2017-10-12T19:17:36Z")

</div>

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.
