Fiverr gig
$15 — I will help you with your project and simulate it for you
Hire me
🤖 Arduino Projects

Proteus 8 EEPROM

EmbedLab TeamNovember 11, 20255 min read
Proteus 8 EEPROM
Interface EEPROM with Arduino SPI

Need to store values that stay saved even when the Arduino loses power? In that case, an external EEPROM connected through SPI is exactly what you need. EEPROM (Electrically Erasable Programmable Read-Only Memory) allows you to keep important data permanently, and the SPI interface provides a fast and reliable way to communicate with it. This is useful in projects like data recorders, configuration memory, and devices that remember settings after shutdown.

In this guide, you will connect a 25AA160A SPI EEPROM to an Arduino Uno, write a string into the chip, and then read it back. By the end, you will understand the wiring, necessary SPI commands, and how the code works.

Why Use External EEPROM with Arduino over SPI?

The Arduino’s RAM is temporary and resets when power is removed. EEPROM, on the other hand, stores data permanently. This makes it suitable for saving things like calibration offsets, system parameters, logs, or user settings.

SPI is ideal for exchanging data with memory chips. It works quickly, uses dedicated hardware pins on the Arduino, and supports adding multiple SPI devices if needed. Learning this gives you practical experience with embedded memory and communication protocols.

Required Components

To follow this project, prepare the following items:

  • Arduino Uno (or compatible board)
  • 25AA160A EEPROM or any SPI-based EEPROM such as 25LC256
  • Breadboard
  • Jumper wires
  • Arduino IDE

The Arduino IDE already includes the required SPI.h library.

Make sure to refer to your EEPROM’s datasheet. Pin labeling may vary slightly, but SPI functionality remains the same.

Understanding the EEPROM Pins

The 25AA160A has several pins, but only a few are necessary here:

  • VCC / GND: Power connections
  • CS (Chip Select): Enables communication with the chip
  • SCK (Clock): Drives data timing
  • SI (MOSI): Data sent from Arduino to EEPROM
  • SO (MISO): Data sent from EEPROM to Arduino
  • WP (Write Protect): Disable writing when pulled HIGH
  • HOLD: Pauses communication if pulled LOW

For this setup:

  • Tie WP to GND to allow writing.
  • Tie HOLD to 5V for continuous operation.

Wiring the EEPROM to Arduino

Use the Arduino Uno hardware SPI pins:

EEPROM Pin Arduino Pin
VCC 5V
GND GND
CS Pin 10
SCK Pin 13
SI (MOSI) Pin 11
SO (MISO) Pin 12
WP GND
HOLD 5V

Ensure the connections are firm and correct.

Important SPI Commands for EEPROM

The EEPROM follows specific commands sent through SPI:

Command Hex Purpose
WRITE_ENABLE 0x06 Allows writing to memory
WRITE_DISABLE 0x04 Disables writing
WRITE_DATA 0x02 Write data to memory
READ_DATA 0x03 Read data from memory
RDSR 0x05 Reads status register

In this project, the main commands used are WRITE_ENABLE, WRITE_DATA, and READ_DATA.

Arduino Code for SPI EEPROM

#include <SPI.h>
const int CS_PIN = 10;
#define WRITE_ENABLE 0x06
#define WRITE_DISABLE 0x04
#define READ_DATA 0x03
#define WRITE_DATA 0x02
#define RDSR 0x05
#define WRSR 0x01
void setup() {
  Serial.begin(9600);
  pinMode(CS_PIN, OUTPUT);
  digitalWrite(CS_PIN, HIGH);
  SPI.begin();
  Serial.println("EEPROM Initialized...");
  enableWrite();
  writeEEPROM(0x00, "Hello EEPROM");
  delay(10);
  char buffer[20];
  readEEPROM(0x00, buffer, 12);
  Serial.println("Read from EEPROM:");
  Serial.println(buffer);
}
void loop() {}
void enableWrite() {
  digitalWrite(CS_PIN, LOW);
  SPI.transfer(WRITE_ENABLE);
  digitalWrite(CS_PIN, HIGH);
}
void writeEEPROM(uint16_t address, const char* data) {
  digitalWrite(CS_PIN, LOW);
  SPI.transfer(WRITE_DATA);
  SPI.transfer((address >> 8) & 0xFF);
  SPI.transfer(address & 0xFF);
  for (size_t i = 0; i < strlen(data); i++) {
    SPI.transfer(data[i]);
  }
  digitalWrite(CS_PIN, HIGH);
  delay(5);
}
void readEEPROM(uint16_t address, char* buffer, size_t length) {
  digitalWrite(CS_PIN, LOW);
  SPI.transfer(READ_DATA);
  SPI.transfer((address >> 8) & 0xFF);
  SPI.transfer(address & 0xFF);
  for (size_t i = 0; i < length; i++) {
    buffer[i] = SPI.transfer(0xFF);
  }
  buffer[length] = '\0';
  digitalWrite(CS_PIN, HIGH);
}

Verifying the Output

Upload the code and open the Serial Monitor at 9600 baud. You should see:

EEPROM Initialized...
Read from EEPROM:
Hello EEPROM

To confirm persistence, reset the board. The stored data will still appear.

Common Errors to Watch For

  • Not sending WRITE_ENABLE before writing
  • Incorrect CS wiring
  • Missing delay after writing
  • Writing more than the EEPROM page limit at once

Avoid these mistakes to ensure reliable memory operation.

Expanding the Project

Once the basics work, you can:

  • Save logged sensor readings over time
  • Store user settings and load them during startup
  • Connect multiple EEPROM chips using additional CS lines

Summary

Using SPI EEPROM with Arduino allows you to store data permanently and retrieve it later, even after restarting the system. Mastering this builds strong embedded development skills while enabling more capable and practical Arduino projects.

ET

EmbedLab Team

Embedded systems engineer and educator. Writes weekly tutorials at EmbedLab to help beginners ship real hardware.

Related projects

Arduino UNO, Nano and Mega library running in Proteus 8 simulation
🤖 Arduino Projects

Arduino Library for Proteus 8 — Free Download for Arduino UNO, Nano, Mega Simulation

Free Arduino library for Proteus 8 download and install: simulate Arduino UNO, Arduino Nano, Arduino Mega and ESP32 Arduino circuits with LED, LCD and sensors — a great Arduino simulator alongside Wokwi, Tinkercad circuits and SimulIDE.

Nov 15 7 min
Proteus 8 fatal simulation error
🤖 Arduino Projects

Proteus 8 fatal simulation error

If Proteus 8 stops with a fatal simulation error , don't worry — the issue is usually simple. Most of the time, the component you added requires a HEX file to simulate correctly. When this file is mis

Nov 11 5 min
Proteus Library Folder Missing
🤖 Arduino Projects

Proteus Library Folder Missing

Stuck? Proteus Library Folder Missing? Here’s How to Fix It Fast ESP32 Proteus 8 Are you trying to simulate an ESP32, Raspberry Pi, or custom IC in Proteus… only to find that your new components aren’

Nov 9 8 min
Proteus 8 library folder location for Arduino UNO and ESP32
🤖 Arduino Projects

Find Proteus 8 Library Folder Easily — Install Arduino UNO & ESP32 Models Fast

How to find the Proteus 8 library folder easily and install Arduino UNO, Arduino Nano, Arduino Mega and ESP32 Arduino libraries — works with Proteus simulation, Wokwi simulation, Tinkercad circuits and SimulIDE.

Nov 6 6 min
Top 5 online Arduino simulators: Tinkercad, Wokwi, Proteus and SimulIDE
🤖 Arduino Projects

Top 5 Online Arduino Circuit Simulators — Tinkercad, Wokwi, Proteus & SimulIDE 2025

The best top 5 online Arduino circuit simulators in 2025: Tinkercad Arduino, Tinkercad circuits, Wokwi simulation, Proteus simulation, SimulIDE and other Arduino simulator online tools for Arduino UNO, Arduino Nano and ESP32 Arduino projects.

Nov 2 7 min
Browse all 50+ projects