Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use 24LC128: Examples, Pinouts, and Specs

Image of 24LC128
Cirkit Designer LogoDesign with 24LC128 in Cirkit Designer

Introduction

The 24LC128, manufactured by Microchip Technology, is a 128 Kbit (16 K x 8) EEPROM (Electrically Erasable Programmable Read-Only Memory) that communicates via the I2C (Inter-Integrated Circuit) interface. This non-volatile memory component is designed to retain data even when power is removed, making it ideal for applications requiring persistent data storage.

Explore Projects Built with 24LC128

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
SparkFun Pro Micro Based Motion Tracking System with BMI160 and EEPROM Data Logging
Image of Basic Arduino Sparkfun Pro Micro + BMI160: A project utilizing 24LC128 in a practical application
This circuit is designed for motion sensing and data logging applications. It features a SparkFun Pro Micro microcontroller interfaced with a BMI160 6DOF sensor for motion detection and two 24LC512 EEPROM chips for extended data storage. The microcontroller reads gyroscopic and accelerometer data from the BMI160 sensor, processes it, and stores it in the EEPROM, with power supplied by a Polymer Lithium Ion Battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Dual 8x8 LED Matrix Display with NTP Time Synchronization
Image of time: A project utilizing 24LC128 in a practical application
This circuit features an ESP32 microcontroller connected to two cascaded 8x8 LED matrix displays, powered by a 3.3V battery. The ESP32 drives the displays to show time and other information, with the code indicating functionality for connecting to WiFi, synchronizing time via NTP, and displaying data on the matrices using custom fonts. Additionally, there is a separate 3.3V battery powering a red LED, which appears to function as a simple indicator light.
Cirkit Designer LogoOpen Project in Cirkit Designer
Biometric and RFID Security System with Dual Adafruit Feather nRF52840 Controllers
Image of Rfid access control: A project utilizing 24LC128 in a practical application
This circuit features two Adafruit Feather nRF52840 microcontrollers, each interfaced with an RFID-RC522 module for RFID communication and an AT24C256 external EEPROM for additional memory storage. One of the microcontrollers is also connected to an R307 Fingerprint Sensor for biometric input, and both microcontrollers are powered by a shared power supply and a coin cell breakout for backup or RTC power. The circuit is likely designed for secure access control or identification purposes, utilizing both RFID and fingerprint authentication, with data storage capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560-Based Wireless Joystick-Controlled Display with RTC
Image of RH-WallE Sender Schaltplan (Cirkit Designer).png: A project utilizing 24LC128 in a practical application
This circuit is a multi-functional embedded system using an Arduino Mega 2560 as the central controller. It interfaces with various peripherals including a DS3231 RTC for timekeeping, an NRF24L01 for wireless communication, a KY-023 joystick for user input, a 4x4 keypad for additional input, and a TM1637 display for output. The system is powered by a combination of 3.3V and 5V sources.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 24LC128

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Basic Arduino Sparkfun Pro Micro + BMI160: A project utilizing 24LC128 in a practical application
SparkFun Pro Micro Based Motion Tracking System with BMI160 and EEPROM Data Logging
This circuit is designed for motion sensing and data logging applications. It features a SparkFun Pro Micro microcontroller interfaced with a BMI160 6DOF sensor for motion detection and two 24LC512 EEPROM chips for extended data storage. The microcontroller reads gyroscopic and accelerometer data from the BMI160 sensor, processes it, and stores it in the EEPROM, with power supplied by a Polymer Lithium Ion Battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of time: A project utilizing 24LC128 in a practical application
ESP32-Controlled Dual 8x8 LED Matrix Display with NTP Time Synchronization
This circuit features an ESP32 microcontroller connected to two cascaded 8x8 LED matrix displays, powered by a 3.3V battery. The ESP32 drives the displays to show time and other information, with the code indicating functionality for connecting to WiFi, synchronizing time via NTP, and displaying data on the matrices using custom fonts. Additionally, there is a separate 3.3V battery powering a red LED, which appears to function as a simple indicator light.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Rfid access control: A project utilizing 24LC128 in a practical application
Biometric and RFID Security System with Dual Adafruit Feather nRF52840 Controllers
This circuit features two Adafruit Feather nRF52840 microcontrollers, each interfaced with an RFID-RC522 module for RFID communication and an AT24C256 external EEPROM for additional memory storage. One of the microcontrollers is also connected to an R307 Fingerprint Sensor for biometric input, and both microcontrollers are powered by a shared power supply and a coin cell breakout for backup or RTC power. The circuit is likely designed for secure access control or identification purposes, utilizing both RFID and fingerprint authentication, with data storage capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of RH-WallE Sender Schaltplan (Cirkit Designer).png: A project utilizing 24LC128 in a practical application
Arduino Mega 2560-Based Wireless Joystick-Controlled Display with RTC
This circuit is a multi-functional embedded system using an Arduino Mega 2560 as the central controller. It interfaces with various peripherals including a DS3231 RTC for timekeeping, an NRF24L01 for wireless communication, a KY-023 joystick for user input, a 4x4 keypad for additional input, and a TM1637 display for output. The system is powered by a combination of 3.3V and 5V sources.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Configuration and calibration data storage
  • Data logging in embedded systems
  • Storing user preferences in consumer electronics
  • Firmware or lookup table storage
  • Industrial control systems requiring non-volatile memory

Technical Specifications

The 24LC128 is a robust and versatile EEPROM with the following key specifications:

Parameter Value
Memory Size 128 Kbit (16 K x 8)
Interface I2C (2-wire)
Operating Voltage Range 2.5V to 5.5V
Maximum Clock Frequency 400 kHz (Fast Mode)
Write Cycle Time 5 ms (typical)
Data Retention > 200 years
Endurance 1,000,000 write/erase cycles
Operating Temperature Range -40°C to +85°C
Package Types PDIP, SOIC, TSSOP, MSOP

Pin Configuration and Descriptions

The 24LC128 is typically available in an 8-pin package. Below is the pinout and description:

Pin Number Pin Name Description
1 A0 Device address input (used for I2C addressing)
2 A1 Device address input (used for I2C addressing)
3 A2 Device address input (used for I2C addressing)
4 VSS Ground (0V reference)
5 SDA Serial Data (I2C bidirectional data line)
6 SCL Serial Clock (I2C clock line)
7 WP Write Protect (active high; disables write operations when tied to VCC)
8 VCC Power supply (2.5V to 5.5V)

Usage Instructions

How to Use the 24LC128 in a Circuit

  1. Power Supply: Connect the VCC pin to a power source (2.5V to 5.5V) and the VSS pin to ground.
  2. I2C Connections:
    • Connect the SDA pin to the I2C data line of the microcontroller.
    • Connect the SCL pin to the I2C clock line of the microcontroller.
    • Use pull-up resistors (typically 4.7 kΩ) on both SDA and SCL lines.
  3. Address Configuration: Use the A0, A1, and A2 pins to set the I2C address of the device. These pins can be tied to VCC or VSS to configure the address.
  4. Write Protection: If write protection is required, connect the WP pin to VCC. Otherwise, connect it to VSS or leave it floating.
  5. I2C Communication: Use the I2C protocol to read from or write to the EEPROM. The device supports standard and fast I2C modes.

Important Considerations and Best Practices

  • Write Cycle Time: Allow sufficient time (5 ms typical) for write operations to complete before initiating another write.
  • Pull-Up Resistors: Ensure proper pull-up resistors are used on the SDA and SCL lines for reliable I2C communication.
  • Address Conflicts: Avoid address conflicts when using multiple I2C devices on the same bus by configuring unique addresses for each device.
  • Write Protection: Enable the WP pin during critical operations to prevent accidental data overwrites.

Example: Interfacing 24LC128 with Arduino UNO

Below is an example Arduino sketch to write and read data from the 24LC128 EEPROM:

#include <Wire.h> // Include the Wire library for I2C communication

#define EEPROM_I2C_ADDRESS 0x50 // Base I2C address of 24LC128

void setup() {
  Wire.begin(); // Initialize I2C communication
  Serial.begin(9600); // Initialize serial communication for debugging

  // Write a byte to EEPROM
  writeEEPROM(0x0000, 0x42); // Write 0x42 to memory address 0x0000
  delay(10); // Wait for the write cycle to complete

  // Read the byte back from EEPROM
  byte data = readEEPROM(0x0000);
  Serial.print("Read data: 0x");
  Serial.println(data, HEX); // Print the read data in hexadecimal format
}

void loop() {
  // Main loop does nothing
}

// Function to write a byte to the 24LC128 EEPROM
void writeEEPROM(unsigned int address, byte data) {
  Wire.beginTransmission(EEPROM_I2C_ADDRESS);
  Wire.write((address >> 8) & 0xFF); // Send the high byte of the address
  Wire.write(address & 0xFF);        // Send the low byte of the address
  Wire.write(data);                  // Send the data byte
  Wire.endTransmission();            // End the I2C transmission
}

// Function to read a byte from the 24LC128 EEPROM
byte readEEPROM(unsigned int address) {
  Wire.beginTransmission(EEPROM_I2C_ADDRESS);
  Wire.write((address >> 8) & 0xFF); // Send the high byte of the address
  Wire.write(address & 0xFF);        // Send the low byte of the address
  Wire.endTransmission();            // End the I2C transmission

  Wire.requestFrom(EEPROM_I2C_ADDRESS, 1); // Request 1 byte from EEPROM
  while (Wire.available() == 0);           // Wait for data to become available
  return Wire.read();                      // Read and return the received byte
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. EEPROM Not Responding on I2C Bus:

    • Cause: Incorrect I2C address or wiring.
    • Solution: Verify the A0, A1, and A2 pin configurations and ensure proper pull-up resistors are used.
  2. Data Corruption:

    • Cause: Insufficient delay after a write operation.
    • Solution: Ensure a delay of at least 5 ms after each write operation.
  3. Write Operations Failing:

    • Cause: WP pin is tied to VCC.
    • Solution: Ensure the WP pin is tied to VSS or left floating for write operations.
  4. Incorrect Data Read:

    • Cause: Address mismatch or noise on the I2C bus.
    • Solution: Double-check the address being accessed and ensure proper I2C bus termination.

FAQs

  • Q: Can I use multiple 24LC128 devices on the same I2C bus?

    • A: Yes, you can use up to 8 devices by configuring unique addresses using the A0, A1, and A2 pins.
  • Q: What happens if power is lost during a write operation?

    • A: The data being written may be corrupted. It is recommended to use a power-fail detection circuit to prevent this.
  • Q: Is the 24LC128 compatible with 3.3V systems?

    • A: Yes, the 24LC128 operates within a voltage range of 2.5V to 5.5V, making it compatible with 3.3V systems.