Maximizing EEPROM Storage Capacity for Arduino: A Basic Understanding

In summary: If you store too much data in a single session, the Arduino may run out of EEPROM memory before it can write it all to the EEPROM.
  • #1
trustnoone
17
0
Hi everyone, so I was relooking into the external EEPROM problem I had earlier for the Arduino, and am thinking that I am missing even just a basic understanding of it. So I'm using this https://www.sparkfun.com/products/525 EEPROM which should have 256kbits of space.
I am hoping to save 4 pieces of data, all of which is 4 digits or below (for example 256, 830, 180, 0900) but I am saving a multitude of this data.
I am assuming that each piece of that data is an integer, an according to here http://arduino.cc/en/Reference/int the Arduino saves a 2 byte, or or 16bit value per integer.

My assumption is that, 16bits*4= 64 bits.
256kbits/64bits = 4000 integer values

Is this correct to assume I should be able to save 4000 integer values onto the EEPROM if I program it correctly?
 
Engineering news on Phys.org
  • #2
Have you try read the datasheet ? "256K of memory is organized as 32,768 words by 8 bits"
 
  • #3
trustnoone said:
Hi everyone, so I was relooking into the external EEPROM problem I had earlier for the Arduino, and am thinking that I am missing even just a basic understanding of it. So I'm using this https://www.sparkfun.com/products/525 EEPROM which should have 256kbits of space.
I am hoping to save 4 pieces of data, all of which is 4 digits or below (for example 256, 830, 180, 0900) but I am saving a multitude of this data.
I am assuming that each piece of that data is an integer, an according to here http://arduino.cc/en/Reference/int the Arduino saves a 2 byte, or or 16bit value per integer.

My assumption is that, 16bits*4= 64 bits.
256kbits/64bits = 4000 integer values

Is this correct to assume I should be able to save 4000 integer values onto the EEPROM if I program it correctly?

There is a much more efficient way to store your data, depending on what you want to do with it.

Will you be adding or subtracting any of those numbers? Are you wanting to represent the positive integers 0000-9999? Where does this data come from, and what are you going to do with it?
 
  • #4
berkeman said:
There is a much more efficient way to store your data, depending on what you want to do with it.

Will you be adding or subtracting any of those numbers? Are you wanting to represent the positive integers 0000-9999? Where does this data come from, and what are you going to do with it?

Hi, thanks for your answer, basically just store and open, so no subtraction or changing or anything, but just store a large array of data of which I can read from later and then delete them all and store again.
Also yes positive integers between 0000 to 9999 is correct, and hoping to just read those values, off it later.

Although for the 0900 value
(for example 256, 830, 180, 0900)
its actually a time, but I would prefer it to be based off the time_t (32 bit signed integer) as I would much prefer to save it as the Unix time based number, but at the moment I'm just getting what I can get.

I would like to store as much as possible though, I pretty much obtain these 4 values once a minute, and I would like to store about 3 days worth, but at the moment I'm really just hoping to get as much as I can with that as well.

Thanks heaps for your messages.
 
  • #5
You could compress further than this, but I would probably just start by using 2 bytes for each number (one nibble per digit).

Also, be sure to read up on the "endurance" of the EEPROM memory that you are using. Most non-volatile memories have a finite number of times they can be re-written (like maybe 10,000 times, depending on the temperature).
 

1. What is an EEPROM?

An EEPROM (Electrically Erasable Programmable Read-Only Memory) is a type of non-volatile memory that can store data even when the power is turned off. It is commonly used in microcontrollers, such as the Arduino, to store settings, variables, and other data that needs to be retained between power cycles.

2. How does an EEPROM work?

An EEPROM is made up of tiny electrically insulated cells that can be individually programmed or erased using an electric charge. When a cell is programmed, it holds a value of 1 and when it is erased, it holds a value of 0. This allows the EEPROM to store data in binary form, making it ideal for microcontrollers.

3. How much data can an Arduino EEPROM store?

The amount of data an Arduino EEPROM can store depends on the specific model and type of EEPROM used. Generally, an Arduino Uno can store up to 1KB of data, while an Arduino Mega can store up to 4KB. However, this can vary depending on the data type and how it is stored.

4. How do I read and write data to an Arduino EEPROM?

To read data from an EEPROM, you can use the built-in EEPROM.read() function in the Arduino IDE. To write data to an EEPROM, you can use the EEPROM.write() function. These functions allow you to specify the memory address and the data you want to read or write.

5. Can an Arduino EEPROM be reprogrammed?

Yes, an Arduino EEPROM can be reprogrammed multiple times. However, it has a limited number of write cycles, typically around 100,000. This means that you should use EEPROM sparingly and avoid constantly rewriting data to prolong its lifespan.

Similar threads

  • Electrical Engineering
Replies
1
Views
2K
  • Programming and Computer Science
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • STEM Academic Advising
Replies
13
Views
2K
  • Programming and Computer Science
2
Replies
54
Views
4K
  • Programming and Computer Science
Replies
4
Views
15K
Back
Top