

The very common HW-084 models have 0x57 as default address of their 4kB EEPROM. Power on pin 8 (VCC) and pin 4 (GND).Ĭlock chips have different addresses depending on the clock model. SDA is connected to pin 5 and SCL to pin 6 of the module. Pulling up WP will activate write protection. Pulling up the address pins to 5V will change the I2C address. ĮEPROM chips can be connected directly as well, leaving the address and WP pins open. This standalone library can be downloaded from my repo. The library is part of my Arduino BASIC interpreter ( ) but described here as a standalone solution for use with C/C++ from the Arduino IDE. In addition to this, there is a raw API for buffered direct EEPROM access.ĮEPROM write and read timing is exactly to the data sheet specification without any unnecessary delay() function in the code. Buffering makes the EEPROM reasonably fast and protects it against too many write cycles.

EEPROM data is buffered in a small page buffer for read and write. It creates a very primitive file system on the EEPROM which a C-style API. Bytes, numbers or strings can be stored at specific storage location. Most of them address the EEPROM as a big storage array.

There are many libraries for serial EEPROM on the market. They work on the I2C bus and only need two pins that they can share with other I2C devices. 4kB and 32kB modules are the most common ones. SD cards need the SPI bus and block pins for other peripherals.Ī low cost alternative are I2C EEPROM modules. Card quality varies and some don't work well on different microcontrollers.

Typically buffers sizes of 512 bytes have to be allocated. The disadvantage of SD cards is the large memory footprint of the SD card filesystems. There are a lot of shield on the market for SD cards and a large number of tutorials how to use them. SD cards are a standard way of logging data on an Arduino. This is a brief tutorial on data storage on EEPROMs for Arduino data logger projects.
