I would like to build a box counter for machine, so I'm going to use EEPROM in Arduino to save count. But the lifecycle is limited to 100,000 writes. Please suggest an external EEPROM with a long lifecycle or any other solution.
-
5Lifetime is not limited to 100,000. Lifetime is minimum 100,000. It's guaranteed to be at least 100,000.– MajenkoCommented Mar 19, 2018 at 11:59
-
See also this question: arduino.stackexchange.com/questions/48872/extending-eeprom-life– GerbenCommented Mar 19, 2018 at 19:55
-
I would use an ESP8266: it's 1-4MB of SPIFFS storage wear-levels, so storing one counter takes ~1/1,000,000 writes, and you can do 100k+ writes, so that's a lot of counting: 100bln for $2. you can also use the RTC ram of the ESP if you have some power managment.– dandavisCommented Mar 20, 2018 at 7:33
3 Answers
You can cycle through all the addresses in the EEPROM like a ring buffer.
You'll need to reserve a bit so you can binary search for the head of the buffer during startup.
You can also reduce how often you write in general especially when the count will increment in bursts, try and wait out those bursts instead of writing on every increment.
-
-
1Great answer, but if you know of external EEPROM modules, please add that info as well.– user2497Commented Mar 19, 2018 at 15:34
The EEPROMs from Microchip have a guaranteed erase count of 1 million. The ones from ST offer 4 million. So it's not hard to find EEPROMs with a higher endurance.
But for a device which writes a lot, a better solution would be a NVRAM, FRAM or EERAM. Those usually come with virtually no limitations to the write cycles but usually are more expensive than EEPROMs but that might very well be worth it compared to the hassle you can get in otherwise.
If you use something like an SD card, they have internal logic that will move the data around when a call is used up. This should give you virtually unlimited storage for something as simple as a count.