1

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.

  • 5
    Lifetime is not limited to 100,000. Lifetime is minimum 100,000. It's guaranteed to be at least 100,000. – Majenko Mar 19 '18 at 11:59
  • See also this question: arduino.stackexchange.com/questions/48872/extending-eeprom-life – Gerben Mar 19 '18 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. – dandavis Mar 20 '18 at 7:33
5

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.

  • Wear leveling is the way to go. +1. – Maximilian Gerhardt Mar 19 '18 at 13:23
  • 1
    Great answer, but if you know of external EEPROM modules, please add that info as well. – user2497 Mar 19 '18 at 15:34
1

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.

Adafruit offers SPI and I²C variants for FRAM boards.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.