You are on page 1of 8

Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

24C04 Two-Wire Serial EEPROM Interfacing with


Arduino

24C04 is a two-wire serial EEPROM which is an abbreviation of Electrically Erasable


Programmable Read-Only Memory. This EEPROM IC provides an I2C communication
interface. It is basically a memory device which stores information and retains it even
when we remove the power. It has a memory capacity of 512 words. Each word has
8-bits. The memory consists of 32 pages of 16 bytes each and uses a word address of
9-bit data for random word addressing from memory. The module uses the I2C
communication protocol to communicate with other microcontrollers or digital devices.

24C04 EEPROM Pinout


It consists of 8 pins. This diagram shows the pinout of 24C04

1 of 8 10-04-2022, 22:54
Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

Pin Description
Pin#01, 02, 03: A0, A1, A2

These three pins are address inputs. The pins A2 and A1 are for hardwire addressing.
You can address four 4K devices on a single bus system whereas the A0 pin is a no
connect pin and normally, we connect this pin to ground.

Pin#04: GND

Connect this terminal to the main ground.

Pin#05: SDA

The serial data pin allows the bidirectional transfer of serial data and addresses.

Pin#06: SCL

It is a clock input pin that injects the data into each EEPROM device on positive edge of
a clock and on a negative transition, it sends data out on the output pin of each device.

Pin#07: WP

2 of 8 10-04-2022, 22:54
Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

As the name implies, the write-protect pin protects the hardware data. It enables
read/write operation by connecting it to the ground pin. Only write operation is enabled,
when applied with Vcc.

Pin#08: Vcc

Apply a voltage signal in a range of 1.7V to 5.5V at this pin.

Features
Low and standard-voltage operation
Vcc = 1.7V to 5.5V.
The memory has a capacity of 512 x 8 (4K) bits.

The EEPROM device provides bidirectional data transfer and this communication
takes place through a 2-wire serial interface
Schmitt triggered inputs which can suppress noise.
It is a highly reliable device with an endurance of 1 million write cycles and the
limit of data retention is almost 100 years.
Maximum clock frequency = 1MHz.
Hardware data protection through write Protect Pin

Where to use 24C04 EEPROM?


This device is well-suited for use in applications which require low-voltage and power for
operation. Many industrial and commercial applications use this device as it provides
noise immunity and you can expand it by cascading 8 similar devices. You can easily
interface with other microcontrollers. Computers and other electronic devices use this
device to store data and avoid data loss when the power is turned off.

3 of 8 10-04-2022, 22:54
Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

How to use it?


As already mentioned above, this device uses an I2C interface which consists of two
wires named SDA and SCL. As it is a bidirectional bus, therefore, it can act as a
transmitter or receiver. The SDA input pin is pulled high with a microcontroller or any
other device. The data on SDA pin changes on a high to low transition of the SCL
signal.

The low to high transition of the clock pulse signal indicates a start or stop condition.
When a positive transition occurs at the SDA input pin with SCL high, it is a start
condition. Stop condition occurs when a negative transition of the input signal takes
place at SDA with SCL input being high. It puts the device in a standby power mode.

4 of 8 10-04-2022, 22:54
Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

The EEPROM sends or receives addresses and data words serially in the form of 8-bit
words and sends a zero as an acknowledgment that it has received each word. The
figure below illustrates the effect on output on changing SDA and SCL inputs. Data In is
SDA input.

24C04 Interfacing with Arduino


This is a connection diagram of 24C04 EEPROM interfacing with Arduino UNO.
Connect the SCL pin of Arduino with the SCL pin of EEPROM. Similarly, SDA pin (
Arduino ) with SDA pin of EEPROM IC. Also, connect pull-up resistors with SDA/SCL
wires.

5 of 8 10-04-2022, 22:54
Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

Copy this code and paste it in Arduino IDE


Upload this code to your Arduino board.
This code will just read a value from address 0x00

You can modify this code according to your requirements.

6 of 8 10-04-2022, 22:54
Firefox https://microcontrollerslab.com/24c04-two-wire-serial-eeprom-interrfa...

Example Application
You can easily interface this device with other microcontrollers. The figure below shows
the connections. The microcontroller sends the data to EEPROM 24C04 which stores
the data. You can use this circuit for designing smart car parking systems. Every
customer who enters the parking area enters his CNIC number through a keypad.
Microcontroller stores this CNIC number into the EEPROM device. Now, if the
customer wants to open that lock, the LCD will display “Enter your CNIC number”
command. If the CNIC entered is matched with the stored CNIC in the EEPROM, it will
open the lock where the car of a user is parked.

2D diagram

7 of 8 10-04-2022, 22:54
Datasheet
24C04 DATASHEET

Electronics components
Subscribe to Blog via Email
Enter your email address to subscribe to this blog and receive notifications of new
posts by email.

You might also like