Go Down

Topic: Which memory to use for saving of total values continuously? (Read 855 times) previous topic - next topic

rbreuss

Guys, Im looking for any idea. The matter is, I have an energy meter based on Arduino UNO platform (but no problem to move to any other Arduino). My energy meter is calculating total amount of energy produced by heatpump during heating season. The same principle like regular energy meter counting electricity used from grid. Value of total energy produced is continuously growing. Problem arise in case of electricity drop out, my meter resets all the values, including that total one and I lost this longterm value. Regular electricity meter keeps these value saved somehow and after such a drop-out it is counting on from last value.
My question is, how to solve it with Arduino resources. EEPROM is limited by number of write/erase cycles, SD card is the same story (for continuous recording of updated value - there are hundreds value updates a day).Does anybody has an idea where and how to store these total values to be automaticaly restored after electricity drop-out?
Radek

robtillaart

How much data do you want to log per day/hour/minute/second?
Can you present your math to us?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

fat16lib

Don't worry about flash wear on an an SD card.  SD cards have excellent wear leveling with a virtual to physical map.  MLC SD cards are good for about 10,000 write cycles to each physical sector and SLC cards are good for about 100,000.

So with a low cost 4 GB card you can write about 40 TB with wear leveling.  At max write speed with an Arduino, it will take many years to wear the card out.  If you write 4 GB per day, the card will last at least 10,000 days or 27 years.

rbreuss

I need to save value of total energy produced anytime it changes. During this heating season it changed roughly 30 000 times.

But if I understand to fat16lib correctly, SD card is another story than EEPROM. In an EEPROM Im writing to the same cell still around, but with SD card is new value written to another physical cell than previous one (thanks to wear leveling). This would solve my problem. Im I correct?

fat16lib

Quote
This would solve my problem. Im I correct?
30,000 writes is nothing.  If you use a 4 GB card, you won't write a small fraction of the physical blocks.

SD cards use a very large ECC for each block and do bad block replacement before a block fails.  If too many bits in a block need to be corrected, the data is copied to a new block and the marginal block is retired.

SD cards have a large number of spare blocks.

CrossRoads

"30,000 writes is nothing."

I don't know, took me 4+ years to post that many :smiley-mr-green:  :smiley-grin:
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Could also use as SPI FRAM.
10^14 bytes possible, data retention of EEPROM, access speed of SRAM.
How much storage space do you need? 3.3V or 5V?
http://www.mouser.com/Semiconductors/Memory/F-RAM/_/N-488wv?P=1z0y3vd&Keyword=fram+memory&FS=True
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

4GB cards getting rare. 8GB seems to be the small card of choice at Staple, OfficeMax, Best Buy. Price as low as $4.95 for Kingston 8 GB SDHC, Class 4.
http://www.bestbuy.com/site/kingston-8-gb-secure-digital-high-capacity-sdhc-1-card-blue/1304811927.p?id=mp1304811927&skuId=1304811927

4GB in MicroSD - too easy to lose them if handling a lot, and then need an SD adapter anyway to read on most PCs  equipped with a reader. Good if just going to plug in & leave it, like a cell phone.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up