March 9, 2021

SEO, Wordpress Support & Insurance, Mortgage, Loans, Legal, Etc Blogs

SEO, Wordpress Support & Insurance, Mortgage, Loans, Legal, Etc Blogs

, SEO, Wordpress Support & Insurance, Mortgage, Loans, Legal, Etc Blogs

Different Types of Memory on Arduino | SRAM, EEPROM, Flash

Share This :

In this tutorial, we will learn about basics of Computer Memory, its operations and types. We will then focus on Arduino and understand what are the different types of memory on Arduino like Flash, EEPROM, RAM, their sizes and purpose.

Table of Contents

What is Computer Memory?

Computers are designed and developed to perform various engineering, mathematical, educational and entertainment tasks at very high speed and with great accuracy. All these complex tasks can be boiled down to just three basic operations:

  • Accept the data with the help of some input devices.
  • Analyse and process the data.
  • Produce the result (data) with the help of some output devices.

For the processor to do these operations seamlessly, it needs to store the input data, hold the intermediate results and also store the output data (results) at some place. This is called Memory.

A Computer Memory is an electronic device that stores data and instructions either permanently or temporarily. Irrespective of the size and application i.e., it can be a huge storage server or a simple microcontroller based embedded system, all computer systems require memory.

Memory Representation

We know that Digital Electronics deals with only two numbers 1 and 0. This is used to represent the voltage level of the signal. For example, in a 5V Logic Level System, ‘1’ represents 5V and ‘0’ represents 0V.

So, the state of a signal can be either ‘1’ or ‘0’ at any given time. This is known a Bit, which is the smallest unit of data in Digital World. By combining 8 of these bits, we get a Byte, which can 28 = 256 different bit patterns.

Two of the common units of information are listed below:

Bit: The smallest unit of Data. It represents logical state with help of one of two possible values ‘1’ or ‘0’.

Byte: A group of 8-bits is called a Byte. A Byte of data can have any binary value between 00000000 and 11111111.

Basic Memory Operations

There are only two basic which you can perform on a Memory. They are Read and Write. A typical Read operation on memory needs an address as input and returns the data at that location.

In case of a typical Write operation, it needs an address at which the data must be stored and the actual data itself.

Types of Memory

All the different memories on a computer system can be categorised in to just two types of memory. They are RAM and ROM.

RAM or Random-Access Memory is used to store temporary data. In Microprocessor based systems, the operating system, applications and other data is loaded on to the RAM so that it can be quickly accessed by the processor.

In case of Microcontroller based systems, RAM is used to store temporary data.

ROM or Read-only Memory is more of a permanent storage where the application code or the firmware is stored.

, SEO, Wordpress Support & Insurance, Mortgage, Loans, Legal, Etc Blogs

Volatile vs. Non-Volatile

Another important classification of Memories is based on the power dependency. Memories like RAM store data as long as power is supplied and once they are powered down, the data in them is gone. This type of memory is known as Volatile Memory.

On the other hand, memories like ROM are called Non-Volatile Memory as the data in them is independent of power i.e., they retain the data even when power is removed.

Different Types of Memory on Arduino

Now that we have seen a little bit about Computer Memory and Different Types of memory, let us now proceed with understanding different types of Memory on Arduino.

Like any computer system, even Arduino has the two essential memories i.e., RAM and ROM. But the interesting thing is how they are organised and also their sizes.

Basically, there are three types of Memory on Arduino Boards like UNO, Mega 2560 or Nano. They are:

  • Flash
  • RAM

The RAM in Arduino is like any other RAM, used to store temporary data and is also Volatile. Flash and EEPROM are two types of ROM Memory used to store application code and small data. They are non-volatile in nature.

Let us see about these three types of memory on Arduino individually and also compare their sizes on different Arduino Boards.

NOTE: Technically speaking, all these memories are part of the Microcontrollers (like ATmega328P or ATmega 2560) on the Arduino Boards (like UNO, Nano, Mega2560).


The Flash Memory is also called Flash ROM. In Arduino, the Flash stores the application code to be run. After we write an Arduino Sketch, like a Blinky for example, we simply click the Upload button in the Arduino IDE to run the blinky program.

In the background, this will compile the sketch and produce a binary file and stores the binary file in to the Flash of Arduino. Upon reset, the Arduino will read the instructions stored in the flash memory and preform the necessary operation.

The following table compares the amount of Flash Memory on some of the popular Arduino Boards.

Arduino Board

MicrocontrollerSize of Flash Memory
Arduino UNOATmega328P

32 KB

Arduino Nano

ATmega328P32 KB
Arduino Mega 2560ATmega 2560

256 KB

Arduino Micro

ATmega32U432 KB
Arduino LeonardoATmega32U4

32 KB

Some part of this Flash Memory is actually used by Bootloader, which is responsible for storing the binary file in to the flash through serial interface.


The next type of memory on Arduino is EEPROM. EEPROM is short for Electrically Erasable Programmable Read Only Memory.

Actually, the Flash Memory mentioned above is also a type of EEPROM. The main difference is EEPROM can be erased at a Byte level whereas a Flash can be erased at a Block Level.

EEPROM in Arduino is usually used to store small amount of data like states of input or output devices so they it can be retained even if the Arduino loses power. I made a dedicated tutorial on Arduino EEPROM (both internal and external).

For more information on Arduino’s Internal EEPROM visit “Arduino EEPRPM Tutorial”. If you are interested in interfacing an I2C based external EEPROM IC like AT24C256 with Arduino, then visit “Arduino AT24C256 EEPROM Tutorial”.

Coming back to EEPROM on Arduino, the size is usually very small, just few Bytes. The following table shows the size of EEPROM on different Arduino Boards.

Arduino Board

MicrocontrollerSize of EEPROM
Arduino UNOATmega328P

1 KB

Arduino Nano

ATmega328P1 KB
Arduino Mega 2560ATmega 2560

4 KB

Arduino Micro

ATmega32U41 KB
Arduino LeonardoATmega32U4

1 KB


The RAM in Arduino is actually called SRAM or Static Random Access Memory, a type of RAM which uses a flip-flop to store 1-bit of data. The other type of RAM is called DRAM or Dynamic Random Access Memory, which uses a capacitor to store the data.

In Arduino, the SRAM stores the temporary data or run time data (variables created by functions, interrupts). SRAM in Arduino is actually divided into several sections. They are:

  • Text
  • Data
  • BSS
  • Stack
  • Heap

The “Text” segment contains any instruction loaded from the flash memory. The “Data” section contains the variables which are initialised in the sketch. The “BSS” segment contains any uninitialized data (and initialises them to 0).

Finally, the stack and heap. Stack is that section of RAM which actually stores the data of functions and interrupts while executing the code. If you create any variables during run time, then they are stored in heap.

The following table describes the amount of SRAM available in different Arduino Boards.

Arduino Board

MicrocontrollerSize of RAM
Arduino UNOATmega328P

2 KB

Arduino Nano

ATmega328P2 KB
Arduino Mega 2560ATmega 2560

8 KB

Arduino Micro

ATmega32U42.5 KB
Arduino LeonardoATmega32U4

2.5 KB


In this tutorial, you learned about Computer Memory, types of Computer Memory, Volatile and Non-Volatile Memories and also the different types of Memory on Arduino Boards.

Share This :