Using an external EEPROM to store data periodically (keep track of elapsed time)

Hello everyone !

If possible, i would like some guidance and suggestions about a project i have in mind.

I would like my arduinos to keep track of the time passed since they where powered up and to record that time on an external eeprom every hour just like an elapsed hours counter. Accuracy is not crucial in my case. i just need to read that data in order to have an indication about how long boards have been used in various projects.
In my mind i think that i will use the eeprom to store an integer that will represent the amount of time in hours that a board has been powered on.

Would it be possible that you could suggest me of some smd eeprom and probably show me how to do the writing / reading ?

Thank you !!!

Hi @HellasT ,
If the EEPROM address range to be used is always the same, why not use the last bytes of the arduino's EEPROM?

RV mineirin

How much storage do uyou need?
How accurate is the hourly timekeeping required over a long period ?
Is the logging ‘on the hour’, or just hourly ?

Note that a DS1307 module whilst not as accurate as may be desired for timekeeping, includes a modest battery-backed RAM with unlimited write cycles

Been using these I2C EERAMs and they work great. It behaves like an SRAM, but when it detects a falling voltage on the Vcc, it automatically backs the data up into a "hidden storage array". It only requires an extra (at least 22uF) capacitor. You have to power-cycle the device 100K times to degrade the non-volatile memory. During normal operation, you can read/write into the SRAM as many times as you want


Well since i am going to perform alot of writing to it i would like to use an external storage chip so that i will not stress the onboard eeprom too much.

Not much really. the time keeping in hours will definetly not exceed the number 100.000 if i increment the hours meter once per hour.

I wouldnt mind it if i where to miss a few hours per month. For example if the board has been running for 720 hours (a whole month) i would mind reading 700 or 750. I would still be able to get the bigger picture.

Im not sure what you mean. I would like to increment the hour counter once per hour. So at the beginning the eeprom or whatever i use will have the number 0 stored and 2 working hours later i would like to read the number 2.

That actually sound very interesting. Though it would require a fair amount of space inside my project boxes.

Power up's and down's will probably be quite frequent but 100.000 cycles are quite alot. I wonder how ,any external components does that require ? I wonder how hard would it be to integrate it into one of my hand made boards...

Ive been thinking to add a section in my current project codes where i will probably use millis() to count time and every 3.600.000 milliseconds the code will increment the number on the external storage chip.

I guess that is one way of doing it but i get the feeling that it is not the most efficient one.

I forgot to mention that i build my own pcb's and adding a stand alone memmory chip to them is not a problem as long as it runs on 5V and needs a small number of external components.

As for the programming part, i have no idea how to read or write to such chips. I have never done anything similar.

The one I mentioned only needed an extra 22uF capacitor, everything else is standard (I2C and power)

Yes i watched the video on the official site. Very interesting indeed.
Any idea how to handle reading and writing ? Are there any code examples ?
I found none so far.

P.S. It is going to be hard for me to source these chips where i live...

You can use any I2C library example as a basis they all work the same.

  • start a transmission
  • send a couple of bytes
  • end transmission

What bytes to send, you can find in the datasheet of the EERAM (follow the link from hrznbgy). See page #15 "SRAM BYTE WRITE" (control byte, two address bytes and a data byte).

I just noticed you need a 5V part, the 47L64 is rated only up to 3.6V.

I will not be easy for me to figure the code out given that i am only a novice in programming.
I will check the link and dig into it though.

There is a 5V version of it. What troubles me is that it is not available on ebay or else. Only Big suppliers have it and the cost+shipping will probably be significant :frowning: .

You have no idea how cheap this has become. In the past you often could not order anything as an individual from many of these companies.

Remember if you order a single device they still have to get a box, search and place the device and do a lot of paperwork for you. Some companies offer free shipping (e.g., Digikey) when you exceed a certain limit. They have huge catalog of useful electronic stuff. Check the conditions for your country and make it worth their while. Find some local friends to share if that is easier.

Here is a list of the official distributors.

If you are a student at an official university, you may even get free samples if you ask nicely. :slight_smile:

Do not worry, we are here to assist.

Im sorry it took mw a while to write back. I will do some searching. Thank you so much !

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.