Have Arduino UNO some internal storage?

Hello, I have a question about Arduino UNO R3. Have this board some internal storage that I can use for saving data and after collection I read them or I must use a SD card as external storage. I heard something about flash memory, but not sure that it´s used for program or it´s another memory of Arduino. How can I use it?
Thanks.
Tom.

You have 1 kB of EEPROM you can use on the UNO. that's not much but enough for some configuration parameters or light data saving.

Be careful on how often you write in a given byte - they are listed for 100,000 write cycles and could fail after that.

https://docs.arduino.cc/learn/built-in-libraries/eeprom/

1 Like

Thank You, I look at that.
Tom.

You can add an external memory module for just a few $$$. I use a FRAM 32K x 8 on I2C and they work great. They work at processor speed and when the power is turned off it remembers, it is a NVM memory ( Non-volatile memory or non-volatile storage is a type of computer memory that can retain stored information even after power is removed. In contrast, volatile memory needs constant power in order to retain data).

Here's how I do it in games I make to save high scores that preserve after the power is off:

#include <EEPROM.h>
int eeAddress;
int score;
int highScore;
// other libraries and defs you may have

void setup(){
eeAddress = 0;
// resetHighScore(); // to reset to 0 if wanted, see below
score = 0;
highScore = 0;
// other setup stuff you have
}

void loop(){
// stuff that creates what you want to save, like a score
     score = score + 1;
      if (score > highScore) { // only write to EEPROM if score now is higher than highScore
        highScore = score;
        EEPROM.put(eeAddress, highScore);
      }
}

void resetHighScore() {
  highScore = 0;
  EEPROM.put(eeAddress, highScore);
  while (1);
}

Note: the function resetHighScore(); as the first line of void setup() is deliberately commented out, since it isn't used by default. But if you DO ever want to reset it to zero, just uncomment it, upload and it's the first thing to happen in the sketch, so let it run a second, it won't go past that function, then comment it out again and reupload the sketch the way it was, only this time with the highScore reset.

Hope this helps get you on track.

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