5

I'm building a weather data collector and I want to be able to dump that weather data somewhere. I've considered the options, and since I'm going to be storing a fairly small amount of data (in the megabyte range) I don't want to use SD cards (also SD cards are expensive). I've heard of use of NAND flash memory chips (like the W25Q32), and I was hoping that I could possibly interact with them in a simple way (since most ways require writing to each individual address). Is there possibly a way to build a file system within one of these small flash memory chips and interact with them as simply as interacting with an SD card?

TLDR: I want to interact with a flash memory chip easily to store basic ASCII data

Carrot M
  • 86
  • 1
  • 6
  • While you can put a filesystem on an SPI flash, it's generally a bad idea, as many filesystem map poorly to the block-erase nature of NOR flash, and filesystem APIs don't well represent access carefully tuned to the needs of flash. If you do, use a fileystem optimized for flash. Probably better and simpler though to organize your writes as a linear journal of data. – Chris Stratton Mar 16 '17 at 04:20
  • Could you set up a server with a simple web application, put a WiFi module on the Arduino, and have it store data in a database? Could use apache or IIS if your on windows. set it up to run PHP. Set up a MySQL database. Have a page that accepts GET variables of the data and insert it into the database. You could set up another page to access/search/analyze the data. – rpmerf Mar 16 '17 at 10:54
  • @rpmerf I've done this before, but it consumes FAR too much power and I plan to put these small weather data collectors in places away from infrastructure. – Carrot M Mar 16 '17 at 19:08
  • Why not use the raw device commands and write blocks? Does your sketch really need a file system, i.e. more than a few files? – Mikael Patel Mar 16 '17 at 19:47
  • There are a few Arduino boards out there that have RTC, SPI Flash and RF-modules, and are real low power design. See for instance Anarduino http://www.anarduino.com/miniwireless/, or Moteino https://lowpowerlab.com/guide/moteino/. – Mikael Patel Mar 16 '17 at 19:52
  • the esp8266 lets you store a few MB as a SPIFFS file system, other boards probably offer the same. – dandavis Mar 16 '17 at 20:11
  • @ChrisStratton do you maybe have a link to how to do it anyways? – Carrot M Mar 16 '17 at 21:50
  • @CarrotM An SD card doesn't implement a file system either. In both case you have to implement the file system in your software on top of the storage device. The inefficiency in doing so is particularly a bad idea on small devices, but if you really want to do it, the process would be comparable to the filesystem code you would use on top of an SD card. – Chris Stratton Mar 16 '17 at 23:20
  • I2C is common for EEPROM chips and can be accessed with a minimal amount of coding effort using the Wire library. – stacker Feb 04 '18 at 11:47
  • Have you considered FRAM (Ferroelectric RAM)? It comes in both SPI and I2C formats. I got my first units from Adafruit. You can read and write as much as you want it has a very long life below 85C. I believe they have some application software on there site. – Gil Mar 04 '19 at 21:57

3 Answers3

2

This lib offers a means of reading and writing ASCII arrays to flash devices. This would be a simple solution for such a data logger requirements. It's ASCII orientated.

https://github.com/schinken/Flash

stacker
  • 21
  • 3
2

I don't think you need a file system: that is usually needed when you want to manage many files. Your weather data log sounds like a single file.

What you seem to need is to access EEPROM as a stream, exactly like you would for an open file. There are stream wrappers around some EEPROM libraries, e.g. this one for ESP. I suggest you check it out and see if you can adapt it to the EEPROM library you use.

Dmitry Grigoryev
  • 1,278
  • 10
  • 31
-1

There is a way to do this. Using a $2 adaptor from eBay, you can hook it up to a micro sd card. An sad card for $4 can store 128mb of data, which is plenty for you.

Arduino Storage Tutorial with weather

128mb Micro Sd card

  • 4
    This does not answer the question which was asked. The poster already seems familiar with what you propose, and is seeking to do something else. – Chris Stratton Mar 16 '17 at 23:17