# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/123/033/medium800/adafruit_products_5146-04.jpg?1690384625)

If you want to store calibration values, MAC addresses, non-secure access tokens, or other unique identifiers, EEPROM storage is a great option. EEPROM is long lasting, and doesn't need to be written in pages - a single byte can be written at once (unlike with flash memory!) EEPROM storage persists even when the power goes out, and can be over-written literally one million times.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/034/medium800/adafruit_products_5146-02.jpg?1690384635)

Some microcontrollers, like the ATmega328, have built in EEPROM, usually around 64 to 1024 bytes of it. But some, especially ARM Cortex's, don't! What then? that's where this petite Adafruit 24LC32 I2C EEPROM Breakout comes in to help! With 32 Kbit (4 KByte) of storage, and handy chainable Stemma QT connectors, it's just the right amount of simple I2C-controllable storage. Since it's external to your microcontroller or microcomputer, uploading new flash memory won't wipe the data from this chip.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/035/medium800/adafruit_products_5146-01.jpg?1690384654)

We use the CAT24C32 (or equivalent) EEPROM, internally organized as 4096 words of 8 bits each. It features a 32 byte page write buffer (if you want to write faster than one byte at a time).&nbsp;Use 2 to 5V power/logic and up to 1 MHz clocked I2C. The default I2C address is 0x50 and there are three external address pins / jumpers to allow addressing of up to eight EEPROM devices on the same bus.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/036/medium800/adafruit_products_5146-03.jpg?1690384664)

To make things easier and a bit more flexible, we've also included&nbsp;[SparkFun Qwiic](https://www.sparkfun.com/qwiic)&nbsp;compatible&nbsp;[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt)&nbsp;connectors for the I2C bus so you don't even need to solder! Just plug in a compatible cable and attach it to your MCU of choice, and you’re ready to store and retrieve from a reliable and durable EEPROM.&nbsp;[**QT Cable is not included** , but we have a variety in the shop](https://www.adafruit.com/?q=stemma+qt+cable&sort=BestMatch).&nbsp;

For Arduino usage,&nbsp;[we recommend our FRAM/EEPROM library](https://github.com/adafruit/Adafruit_FRAM_I2C).

# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/115/134/medium800/adafruit_products_double.png?1663267599)

The default I2C address is&nbsp; **0x50.**

## Power Pins

- **VIN** &nbsp;- this is the power pin. Since the EEPROM chip may use 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V.
- **3V** &nbsp;- this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like.
- **GND** &nbsp;- common ground for power and logic.

## I2C Logic Pins

- **SCL&nbsp;** - I2C clock pin, connect to your microcontroller I2C clock line. This pin is level shifted so you can use 3-5V logic, and there's a&nbsp; **10K pullup** &nbsp;on this pin.
- **SDA&nbsp;** -I2C data pin, connect to your microcontroller I2C data line. This pin is level shifted so you can use 3-5V logic, and there's a&nbsp; **10K pullup** &nbsp;on this pin.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt)&nbsp;-&nbsp;**These connectors allow you to connect to dev boards with&nbsp; **STEMMA QT** &nbsp;connectors or to other things with&nbsp;[various associated accessories](https://www.adafruit.com/?q=JST%20SH%204).

## Address Pins

On the back of the board are **three address jumpers** , labeled **A0** , **A1** , and **A2**. These jumpers allow you to chain up to 8 of these boards on the same pair of I2C clock and data pins. To do so, you solder the jumpers "closed" by connecting the two pads.

On the front of the board are three address pins, labeled **A0** , **A1** and **A2**. Just like the jumpers, these pins allow you to change the I2C address to connect multiple boards by connecting them to **VIN**.

The default I2C address is **0x50**. The other address options can be calculated by “adding” the **A0/A1/A2** &nbsp;to the base of **0x50**.

**A0** sets the lowest bit with a value of **1** , **A1** sets the next bit with a value of **2** and **A2** sets the next bit with a value of **4.** The final address is **0x50 + A2 + A1 + A0** which would be **0x57**.

 So for example if **A2** is soldered closed and **A0** is soldered closed, the address is **0x50 + 4 + 1 = 0x55**.

 If only **A0** is soldered closed, the address is **0x50 + 1 = 0x51**

 If only **A1** is soldered closed, the address is **0x50 + 2 = 0x52**

 If only **A2** is soldered closed, the address is **0x50 + 4 = 0x54**

The table below shows all possible addresses, and whether the pin(s) should be high (closed) or low (open).

![](https://cdn-learn.adafruit.com/assets/assets/000/115/135/medium800/adafruit_products_i2c_table.jpg?1663269125)

## Write-Protect Pin

- **WP** - Write-protect pin. Connect to VCC to make the EEPROM read-only.

## Power LED

- **Power LED -&nbsp;** In the upper left corner, above the STEMMA connector, on the front of the board, is the power LED, labeled **&nbsp;on**. It is the green LED.

# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Python & CircuitPython

It's easy to use the&nbsp; **24LC32** &nbsp;with Python or CircuitPython, and the&nbsp;[Adafruit\_CircuitPython\_24LC32](https://github.com/adafruit/Adafruit_CircuitPython_24LC32)&nbsp;module. This module allows you to easily write Python code that allows you to read and write to the&nbsp; **24LC32** EEPROM. You can use this EEPROM with any CircuitPython microcontroller board or with a computer that has GPIO and Python&nbsp;[thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

## CircuitPython Microcontroller Wiring

First, wire up a 24LC32 to your board exactly as shown below. Here's an example of wiring a Feather M4 to the EEPROM with I2C using one of the handy&nbsp;[**STEMMA QT**](https://learn.adafruit.com/introducing-adafruit-stemma-qt)&nbsp;connectors:

- **Board 3V** &nbsp;to&nbsp;**EEPROM VIN (red wire)**
- **Board GND** &nbsp;to **EEPROM**** &nbsp;GND (black wire)**
- **Board SCL** &nbsp;to **EEPROM**** &nbsp;SCL (yellow wire)**
- **Board SDA** &nbsp;to **EEPROM**** &nbsp;SDA (blue wire)**

![adafruit_products_featherStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/115/165/medium640/adafruit_products_featherStemma_bb.png?1663600648)

You can also use standard&nbsp; **0.100" pitch** &nbsp;headers to wire it up on a breadboard:

- **Board 3V** &nbsp;to&nbsp;**EEPROM VIN (red wire)**
- **Board GND** &nbsp;to **EEPROM**** &nbsp;GND (black wire)**
- **Board SCL** &nbsp;to **EEPROM**** &nbsp;SCL (yellow wire)**
- **Board SDA** &nbsp;to **EEPROM**** &nbsp;SDA (blue wire)**

![adafruit_products_featherBB_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/115/166/medium640/adafruit_products_featherBB_bb.png?1663600665)

## Python Computer Wiring

Since there's&nbsp;_dozens_&nbsp;of Linux computers/boards you can use, below shows wiring for Raspberry Pi. For other platforms,&nbsp;[please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Here's the Raspberry Pi wired to the EEPROM using I2C and a&nbsp;[**STEMMA QT**](https://learn.adafruit.com/introducing-adafruit-stemma-qt)&nbsp;connector:

- **Pi 3V** &nbsp;to&nbsp;**EEPROM VIN (red wire)**
- **Pi GND** &nbsp;to **EEPROM**** &nbsp;GND (black wire)**
- **Pi SCL** &nbsp;to **EEPROM**** &nbsp;SCL (yellow wire)**
- **Pi SDA** &nbsp;to **EEPROM**** &nbsp;SDA (blue wire)**

![adafruit_products_piStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/115/167/medium640/adafruit_products_piStemma_bb.png?1663600688)

Finally here is an example of how to wire up a Raspberry Pi to the EEPROM using a solderless breadboard:

- **Pi 3V** &nbsp;to&nbsp;**EEPROM VIN (red wire)**
- **Pi GND** &nbsp;to **EEPROM**** &nbsp;GND (black wire)**
- **Pi SCL** &nbsp;to **EEPROM**** &nbsp;SCL (yellow wire)**
- **Pi SDA** &nbsp;to **EEPROM**** &nbsp;SDA (blue wire)**

![adafruit_products_piBreadboard_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/115/168/medium640/adafruit_products_piBreadboard_bb.png?1663600709)

## Python Installation of 24LC32 Library

You'll need to install the&nbsp; **Adafruit\_Blinka** &nbsp;library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3.&nbsp;[Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-24lc32`

If your default Python is version 3, you may need to run&nbsp;`pip`&nbsp;instead. Make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the 24LC32 library, and its dependencies, into the&nbsp; **lib** &nbsp;folder on your&nbsp; **CIRCUITPY** &nbsp;drive. Then you need to update&nbsp; **code.py** &nbsp;with the example script.

Thankfully, we can do this in one go. In the example below, click the&nbsp; **Download Project Bundle** &nbsp;button below to download the necessary libraries and the&nbsp; **code.py** &nbsp;file in a zip file. Extract the contents of the zip file, and copy the&nbsp; **entire&nbsp;**** lib **&nbsp;** folder **&nbsp;and the&nbsp;** code.py **&nbsp;file to your&nbsp;** CIRCUITPY**&nbsp;drive.

Your&nbsp; **CIRCUITPY/lib** &nbsp;folder should contain the following folders and file:

- **adafruit\_bus\_device/**
- **adafruit\_register/**
- **adafruit\_24lc32.mpy**

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/24lc32_24lc32_simpletest.py.png )

## Python Usage

Once you have the library&nbsp;`pip3`&nbsp;installed on your computer, copy or download the following example to your computer, and run the following, replacing&nbsp; **code.py** &nbsp;with whatever you named the file:

`python3 code.py`

## Example Code
https://github.com/adafruit/Adafruit_CircuitPython_24LC32/blob/main/examples/24lc32_simpletest.py

 **If running CircuitPython:** &nbsp;Once everything is saved to the&nbsp; **CIRCUITPY** &nbsp;drive,&nbsp;[connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console)&nbsp;to see the data printed out!

**If running Python:&nbsp;** The console output will appear wherever you are running Python.

![](https://cdn-learn.adafruit.com/assets/assets/000/115/161/medium800/adafruit_products_cpREPL.jpg?1663599440)

In the example, the EEPROM is&nbsp;instantiated on I2C. Then, the EEPROM's available storage length is printed to the REPL. The EEPROM is internally organized as 4096 words of 8 bits each, or 4 Kbytes total.

## Read and Write
In the example, uncomment the following lines:

```python
eeprom[0] = 4
print(eeprom[0])

eeprom[0:4] = [9, 3, 8, 1]
print(eeprom[0:4])
```

Then save and rerun the code. `4` is written to the EEPROM's index `0`. The EEPROM's index `0` is then read and printed to the REPL in bytes. Then, a sequence of integers are written to the EEPROM and then read and printed to the REPL as bytes.

![](https://cdn-learn.adafruit.com/assets/assets/000/115/247/medium800/adafruit_products_readWriteRepl.jpg?1663687388)

# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Python Docs

# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Arduino

Using the 24LC32 EEPROM with Arduino involves wiring up the sensor to your Arduino-compatible microcontroller, installing the&nbsp;[Adafruit\_FRAM\_I2C](https://github.com/adafruit/Adafruit_FRAM_I2C)&nbsp;library and running the provided example code.

## Wiring

Wire as shown for a&nbsp; **5V** &nbsp;board like an Uno. If you are using a **&nbsp;3V** &nbsp;board, like an Adafruit Feather, wire the board's 3V pin to the 24LC32 VIN.

Here is an Adafruit Metro wired up to the 24LC32 using the STEMMA QT connector:

- **Board 5V** &nbsp;to&nbsp; **EEPROM&nbsp;**** VIN (red wire)**  
- **Board GND** &nbsp;to **EEPROM** &nbsp;**GND (black wire)**  
- **Board SCL** &nbsp;to **EEPROM** &nbsp;**SCL (yellow wire)**  
- **Board SDA** &nbsp;to **EEPROM** &nbsp;**SDA (blue wire)**

![adafruit_products_metroStemma_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/115/169/medium640/adafruit_products_metroStemma_bb.png?1663600735)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Board 5V** &nbsp;to&nbsp; **EEPROM&nbsp;**** VIN (red wire)**  
- **Board GND** &nbsp;to **EEPROM** &nbsp;**GND (black wire)**  
- **Board SCL** &nbsp;to **EEPROM** &nbsp;**SCL (yellow wire)**  
- **Board SDA** &nbsp;to **EEPROM** &nbsp;**SDA (blue wire)**

![adafruit_products_metroBB_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/115/170/medium640/adafruit_products_metroBB_bb.png?1663600756)

## Library Installation

You can install the&nbsp; **Adafruit EEPROM & FRAM I2C&nbsp;** library&nbsp;for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/115/137/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1663271375)

Click the&nbsp; **Manage Libraries ...** &nbsp;menu item, search for&nbsp; **Adafruit FRAM I2C** ,&nbsp;and select the&nbsp; **Adafruit FRAM I2C** &nbsp;library:

![](https://cdn-learn.adafruit.com/assets/assets/000/115/138/medium800/adafruit_products_arduinoLibSearch.jpg?1663271519)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/115/139/medium800/adafruit_products_dependsArd.jpg?1663271555)

If the "Dependencies" window does not come up, then you already have the dependencies installed.&nbsp;

Warning: 

## Example Code
https://github.com/adafruit/Adafruit_FRAM_I2C/blob/master/examples/Generic_I2C_EEPROM/Generic_I2C_EEPROM.ino

![](https://cdn-learn.adafruit.com/assets/assets/000/115/163/medium800/adafruit_products_ardSerial.jpg?1663599729)

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You should see that the sketch has found your connected I2C EEPROM and the maximum storage size for the EEPROM in bytes. Then, the byte arrays stored on the EEPROM are printed to the Serial Monitor.

## Read and Write
https://github.com/adafruit/Adafruit_FRAM_I2C/blob/master/examples/write_multibyte/write_multibyte.ino

![](https://cdn-learn.adafruit.com/assets/assets/000/115/248/medium800/adafruit_products_readWriteArduino2.jpg?1663688169)

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You should see that the sketch has found your connected I2C EEPROM. Then, a float is written to the EEPROM's address `0x00` and is read back from the EEPROM.

# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Arduino Docs

# Adafruit 24LC32 I2C EEPROM Breakout - 32Kbit / 4 KB

## Downloads

## Files

- [24LC32 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/115/136/original/24AA32A-24LC32A-32-Kbit-I2C-Serial-EEPROM-20001713N.pdf?1663269248)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-24LC32-PCB)
- [3D Models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/5146%2024LC32%20I2C%20EEPROM)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%2024LC32%20I2C%20EEPROM%20Breakout%20-%2032Kbit%20-%204%20KB%20-%20Stemma%20QT.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/115/131/medium800/adafruit_products_schem.png?1663266016)

![](https://cdn-learn.adafruit.com/assets/assets/000/115/132/medium800/adafruit_products_fab.png?1663266026)

![](https://cdn-learn.adafruit.com/assets/assets/000/115/373/medium800/adafruit_products_24LC32_I2C_EEPROM.jpg?1664230511)


## Primary Products

### Adafruit 24LC32 I2C EEPROM Breakout -  32Kbit / 4 KB - Stemma QT

[Adafruit 24LC32 I2C EEPROM Breakout -  32Kbit / 4 KB - Stemma QT](https://www.adafruit.com/product/5146)
If you want to store calibration values, MAC addresses, non-secure access tokens, or other unique identifiers, EEPROM storage is a great option. EEPROM is long lasting, and doesn't need to be written in pages - a single byte can be written at once (unlike with flash memory!) EEPROM storage...

In Stock
[Buy Now](https://www.adafruit.com/product/5146)
[Related Guides to the Product](https://learn.adafruit.com/products/5146/guides)

## Featured Products

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

In Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
### JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic

[JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic](https://www.adafruit.com/product/4398)
This cable will make it super easy to use our plug-and-play STEMMA QT boards with boards like Circuit Playground. On one end you get a Qwiic / STEMMA QT connector (technically known as a JST SH 4-pin plug)&nbsp; into 4 individual wires with grippy alligator clips. We're carrying these to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4398)
[Related Guides to the Product](https://learn.adafruit.com/products/4398/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)

## Related Guides

- [AdaBox 015](https://learn.adafruit.com/adabox015.md)
- [Arduboy Game Controller Hack](https://learn.adafruit.com/arduboy-game-controller.md)
- [Programmable Wireless BLE Gesture Mouse](https://learn.adafruit.com/ble-wireless-gesture-mouse.md)
- [CircuitPython I2C and SPI Under the Hood](https://learn.adafruit.com/circuitpython-basics-i2c-and-spi.md)
- [ESP32-S3 BLE RS-232 Controller](https://learn.adafruit.com/esp32-s3-ble-rs232-controller.md)
- [Google Graveyard with Adafruit MagTag](https://learn.adafruit.com/google-graveyard-with-adafruit-magtag.md)
- [CircuitPython Powered Sip & Puff with ST LPS33HW Pressure Sensor](https://learn.adafruit.com/st-lps33-and-circuitpython-sip-and-puff.md)
- [Adafruit PiCowBell HSTX DVI Output](https://learn.adafruit.com/adafruit-picowbell-hstx-dvi-output.md)
- [BLE Vibration Bracelet](https://learn.adafruit.com/ble-vibration-bracelet.md)
- [reef-pi Guide 7: Dosing Controller](https://learn.adafruit.com/reef-pi-guide-5-dosing-controller.md)
- [FunHouse Parking Assistant](https://learn.adafruit.com/funhouse-parking-assistant.md)
- [MagTag Lists From Google Spreadsheets](https://learn.adafruit.com/collaborative-spreadsheets-to-magtag.md)
- [Adafruit CircuitPython Wii Classic Controller Library](https://learn.adafruit.com/adafruit-circuitpython-wii-classic-controller-library.md)
- [LED Masquerade Masks with n00ds](https://learn.adafruit.com/led-masquerade-masks-with-n00ds.md)
- [eInk Literature Quotes Clock for MagTag](https://learn.adafruit.com/eink-literary-quotes-clock-for-magtag.md)
