# Where to start to add external storage to Electron

**URL:** <https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608>\
**Category:** Getting Started\
**Created:** [October 10, 2017, 4:00am UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608 "2017-10-10T04:00:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![supscientist](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/supscientist/32/16334_2.png) [@supscientist](https://community.particle.io/u/supscientist)\
**Post date:** [October 10, 2017, 4:00am UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/1 "2017-10-10T04:00:42Z")

</div>

Hi—I’m reading as much as I can find on this forum for storage of data that the Electron collects offline but still fairly uncertain where to start. I’m hoping to add a good chunk of external storage (~ 1 GB) and log everything then use the controller to decide what actually gets sent to the cloud. It looks like the flashee-eeprom library is still among the more commonly used libraries for external storage but was written for spark; is it still the way to go for solid state memory? I’d prefer not to use SD cards as this will be for a consumer product and I want everything to be board-mounted.

And, while perhaps it will be a little more expensive, will it even be possible to send 10s to 100s of KB to the cloud at once? I know I can send only 255 B in a given Publish( ) but will it be feasible to throw that in a loop until the Electron completes sending a file?

BTW—I called and asked the sales team these questions and they were unsure. I bought and am testing an Electron so any leads will be much appreciated! Thanks!

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [October 10, 2017, 5:48am UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/2 "2017-10-10T05:48:22Z")

</div>

> [@supscientist](#):
>
> I'd prefer not to use SD cards as this will be for a consumer product and I want everything to be board-mounted.

This doesn't have to rule out SD as you can have them embedded too - especially when you want to go in the GB region.

---

<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 10, 2017, 12:59pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/3 "2017-10-10T12:59:40Z")

</div>

@ScruffR, though an embedded SD standard was developed, there are very few, if any, chips available on the market. It may be best to a) reduce the amount of storage required by processing the raw stream and/or b) use a microSD card with a captive (locking hinged lid) socket. Why microSD? The SDFat library supports DMA, is fast and reliable. Wear leveling is done at the device level, not in your code.

@supscientist, Particle.publish() is designed to send 255 **ASCII** characters per publish. Assuming your data is binary, if you convert binary to Base64, you could get about 170 binary bytes per payload. With 100KB to send, that would take 588 publish events. At one publish per second (unless you pay for Enterprise rates), that will take about 10 minutes to transmit. Basically 10mins/100KB.

The other alternative is to stream **non-encrypted** UDP or TCP data to a server directly. There is a HTTPS library available though I can’t comment on how suitable it would be in this case.

---

<div class="post-metadata">

**Author:** ![supscientist](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/supscientist/32/16334_2.png) [@supscientist](https://community.particle.io/u/supscientist)\
**Post date:** [October 10, 2017, 4:04pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/4 "2017-10-10T16:04:29Z")

</div>

Thanks, @ScruffR and @peekay123. I haven't come across any good options for embedded SD but would love to learn about them if you know of any!

> [@peekay123](#):
>
> :b) use a microSD card with a captive (locking hinged lid) socket

I have to pot the whole device in epoxy in a final predeployment waterproofing step. I'm concerned that SD card to SD receptacle contacts could be filled with insulating epoxy and break the electrical connection. Something I could fully solder on is desirable.

Regarding data transfer, I'll look into sending data directly to a server using the HTTPS and I will also hopefully get into the Enterprise program before long too. 10 min is too long—hopefully we can find a good workaround.

Thanks again!

---

<div class="post-metadata">

**Author:** ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)\
**Post date:** [October 10, 2017, 4:33pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/5 "2017-10-10T16:33:34Z")

</div>

You could directly solder the SD card contacts to a board if you wanted.

![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/a/a1af107296f76e41712a8ce2311329d2129672a8.jpg)

---

<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 10, 2017, 4:59pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/6 "2017-10-10T16:59:12Z")

</div>

@supscientist, if you limit your storage, you could look at using SPI NOR Flash chips with [SPIFFS](https://github.com/pellepl/spiffs). SPIFFS is not designed for large storage but could handle 128MB to 256MB storage devices.

---

<div class="post-metadata">

**Author:** ![supscientist](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/supscientist/32/16334_2.png) [@supscientist](https://community.particle.io/u/supscientist)\
**Post date:** [October 10, 2017, 10:13pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/7 "2017-10-10T22:13:57Z")

</div>

Thanks again, @peekay123. SPIFFS looks promising; I’ll give that a shot. Though when I begin importing extra libraries like that, do I have to start using my own toolchain to build/compile projects?

I’m reading this thread ([Suggestions for using external flash SPI](https://community.particle.io/t/suggestions-for-using-external-flash-spi/24307/29)) which looks particularly beneficial for my application. From your post [here](https://community.particle.io/t/suggestions-for-using-external-flash-spi/24307/101?u=supscientist), it looks like SDFat still has some major advantages. If you happen across any surface mount components that work with SDFat, I’d love to learn about them.

Ultimately, I’ll want to be able to write around 100 MB (maybe more but I’ll stop there for now to keep things inline with SPIFFS capabilities) to some chip during an underwater deployment, then do some post-processing on the Electron then send post-processed data via cellular.

Do you think that Electron (or, perhaps, the incoming e-series) is well suited for this sort of application?

Thank you!

---

<div class="post-metadata">

**Author:** ![supscientist](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/supscientist/32/16334_2.png) [@supscientist](https://community.particle.io/u/supscientist)\
**Post date:** [October 10, 2017, 10:16pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/8 "2017-10-10T22:16:45Z")

</div>

> [@RWB](#):
>
> You could directly solder the SD card contacts to a board if you wanted.

Cool—thanks! Intriguing, but most posts I've seen on that idea say there are lots of problems associated with various approaches to soldering a plastic-encased chip like that. Especially for what I hope will be a mass-produced item. Good to know that people have made it work though!

---

<div class="post-metadata">

**Author:** ![Alph](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@Alph](https://community.particle.io/u/Alph)\
**Post date:** [October 10, 2017, 11:04pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/9 "2017-10-10T23:04:44Z")

</div>

The E Series Datasheet states the following…

“Expandable flash storage for sensor data and/or backup application firmware”

It also says there’s 1MB Flash Storage but, surely this isn’t enough for sensor data… does anyone have any more details about this expandable flash storage as this might be the answer to the op

---

<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 11, 2017, 12:44am UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/10 "2017-10-11T00:44:16Z")

</div>

@Alph, most likely an 8-pin SPI flash chip though I suspect it may be factory installed for volume purchases.

---

<div class="post-metadata">

**Author:** ![Alph](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@Alph](https://community.particle.io/u/Alph)\
**Post date:** [October 11, 2017, 8:53pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/11 "2017-10-11T20:53:22Z")

</div>

It would be interesting to find out which one, so we can build a breakout board for the Electron. This way prototyping on the Electron and moving over to the E Series will be much simpler.

---

<div class="post-metadata">

**Author:** ![BobG](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@BobG](https://community.particle.io/u/BobG)\
**Post date:** [October 16, 2017, 4:43pm UTC](https://community.particle.io/t/where-to-start-to-add-external-storage-to-electron/36608/12 "2017-10-16T16:43:24Z")

</div>

You can get I2C EEPROM up to at least 32 MBytes on an 8 pin chip (pretty cheap, too). If you can get by with less than 1 GB, a couple of these chips strung together on one I2C bus might be a good solution. Unlike libraries that simulate EEPROM in flash memory, this is real EEPROM that does not need any wear leveling code to keep the memory cells from wearing out (albeit EEPROM will eventually wear out after 100,000 - 1 million writes). We successfully used EEPROM to persistently store system configuration and registration data on a Photon/Electron project where the simulated EEPROM did not work (I believe because of RAM limitations incurred for Flash wear leveling using the libraries). You can see what we did at:

> **[TeamPracticalProjects/SISProject](https://github.com/TeamPracticalProjects/SISProject)**
>
> SISProject - An IoT sensor platform based on particle.io's Arduino-like processors. Currently for monitoring an older person living alone, but a great platform to use for other projects too.
