What Is EEPROM? Wiring and Errors (2026)

What Is EEPROM? Wiring and Errors (2026)

EEPROM (Electrically Erasable Programmable Read-Only Memory) is non-volatile memory — it survives power loss, unlike the RAM your variables live in. It's byte-addressable: you read and write one byte at a time, and the data stays there for years after you unplug the board.

Quick answer: EEPROM stores small data that must survive a power cycle — settings, calibration offsets, high scores, WiFi credentials. Use EEPROM.write()/EEPROM.read(), or better, EEPROM.update(), which only writes if the value changed, halving wear on a byte with a ~100,000-cycle write lifetime. An Uno/Nano's ATmega328P has 1KB of built-in EEPROM — no extra hardware needed.

Proof of work: the explanation and code below are Soldr's actual answer to "What is EEPROM and how do I use it?", asked through Compoden's AI build assistant on 12 August 2026. Published 12 August 2026 · Last updated 12 August 2026.

Soldr's answer explaining EEPROM: non-volatile storage, the write-cycle limit, EEPROM.update() for wear reduction, and a marker-byte pattern
Soldr's build log answering "What is EEPROM and how do I use it?" — the explanation and a complete Arduino sketch generated in the same session.

How is EEPROM different from Flash and SRAM?

A sketch has three kinds of memory to reason about. Flash (32KB on an Uno) is where the compiled program itself lives — it survives power loss but is meant for code, not runtime data. SRAM (2KB) is the volatile working memory your variables use while running — it's wiped the instant power drops. EEPROM is the one built specifically to remember small values between power cycles, at the cost of a limited write lifetime and slower writes than either of the other two.

Arduino Uno/Nano memory types
Memory Size (Uno) Survives power loss? Typical use
Flash 32KB Yes The compiled program itself
SRAM 2KB No Variables while running
EEPROM 1KB Yes Settings, calibration, saved state

Why does EEPROM.update() matter more than EEPROM.write()?

EEPROM.write() writes unconditionally, burning one of that byte's roughly 100,000 write cycles every single call — even if the value didn't change. EEPROM.update() checks first and only writes if the value is actually different, which halves wear on any byte that gets updated frequently with a value that often repeats (a sensor calibration offset that's usually stable, for instance). For anything written more than a handful of times over a project's life, update() is the safer default.

#include <EEPROM.h>

int addr = 0;

void setup() {
  Serial.begin(9600);

  EEPROM.write(addr, 42);            // save one byte
  int value = EEPROM.read(addr);     // read it back
  Serial.println(value);             // prints 42

  // EEPROM.update() only writes if the value CHANGED
  // - halves your write-cycle wear on frequently-updated bytes
  EEPROM.update(addr, 43);
}

Why does my EEPROM data look wrong after re-uploading my sketch?

Re-uploading a sketch does not clear EEPROM — the old data from your last upload is still sitting there, which is a common source of confusing "wrong on first boot" bugs during testing. The fix is a magic-marker pattern: write a known value to address 0 the first time your sketch legitimately writes its data, and check that marker on every boot. If address 0 doesn't match, the EEPROM has never been written by this sketch, so you skip loading what would otherwise be stale garbage.

What do you need to try this yourself?

An Arduino Uno R3 (CH340G) (Rs.230) is enough — the ATmega328P's 1KB of built-in EEPROM is right there on the chip, no extra hardware needed for small data.

Frequently asked questions

EEPROM ka use kab karna chahiye?

EEPROM tab use karo jab tumhe koi choti si value power off hone ke baad bhi yaad rakhni ho - jaise settings, calibration numbers, ya high score. Bade data ya baar-baar badalne waale data ke liye EEPROM sahi nahi hai, kyunki iska write-lifetime limited hota hai (~100,000 cycles per byte).

What happens if I exceed EEPROM's write-cycle limit?

Once a specific byte address passes its roughly 100,000 write cycles, that address can start failing to reliably retain new values - it's a gradual wear pattern, not an instant failure. Using EEPROM.update() instead of write() avoids burning cycles on unchanged values, which is usually enough to keep a typical project well within the limit for its lifetime.

What is the price of an Arduino Uno with built-in EEPROM in India?

The Arduino Uno R3 (CH340G) costs Rs.230 at Compoden, with cash on delivery available across India. Its ATmega328P chip includes 1KB of EEPROM at no extra cost - no separate storage module needed for small settings data. Prices checked 12 August 2026.

Can I use EEPROM on an ESP32 the same way as an Arduino Uno?

The ESP32's EEPROM.h library provides the same write/read/update API for compatibility, but under the hood it's emulated on flash storage, not true byte-addressable EEPROM hardware - so ESP32 projects more commonly use the Preferences library or SPIFFS/LittleFS instead, which are built for that flash-based storage model.

Back to blog