In this DIY electronics project, we will build a temperature logger using the 24C04WP EEPROM chip. The project will involve designing a basic temperature logging system that captures temperature data and stores it in memory for later retrieval. This type of project is ideal for beginners in electronics, as it combines sensors, memory storage, and simple circuitry to create a practical and useful tool.
Project Overview
The 24C04WP is a 4Kb I²C EEPROM (Electrically Erasable Programmable Read-Only Memory) component that offers a simple and effective way to store data. This memory chip is widely used in various applications, such as data logging, storing configuration settings, and retaining small amounts of information even when the power is turned off.
In this project, we will use the 24C04WP to store temperature data collected from a temperature sensor, and we will implement a basic system that allows the data to be saved and retrieved later. The system will be built using simple components, making it easy for beginners to understand how data storage works in embedded systems.
Key Components Needed
● 24C04WP EEPROM chip
● LM35 or DHT11/DHT22 Temperature Sensor
● Arduino Uno (or any other microcontroller)
● LCD Screen (for displaying temperature readings)
● Push Button (for activating data logging)
● Resistors (for pull-ups, limiters, etc.)
● Breadboard and Jumper Wires
● Power Supply (for the Arduino and sensor)
Step 1: Understanding the 24C04WP EEPROM
The 24C04WP is a 4Kb EEPROM chip that communicates with other components using the I²C protocol. This means it only requires two wires (SCL for clock and SDA for data) to communicate with the microcontroller, making it a great option for memory storage in projects with limited pin availability.
The 24C04WP chip is capable of holding 512 bytes of data, which can be divided into 64 addresses (each address holds 8 bits of data). Each byte can be written to or read from, and the memory retains its contents even after the power is switched off. This makes the EEPROM ideal for applications like data logging, where you need to store information over time.
Key features of the 24C04WP include:
● 4Kb of EEPROM storage
● I²C interface for easy communication
● Low power consumption
● Unlimited read/write cycles for storing data
● Memory organization into 64 pages, each with 8 bits
Step 2: Choosing the Temperature Sensor
For this project, we will use the LM35 temperature sensor because it is a simple and widely used analog temperature sensor that provides an output voltage proportional to the temperature. The LM35 outputs a voltage of 10mV per degree Celsius, which is easy to read with an ADC (Analog-to-Digital Converter) of a microcontroller like the Arduino Uno.
Alternatively, you can use a digital temperature sensor like the DHT11 or DHT22, which provide a direct digital output for temperature and humidity readings. The DHT22 is a more accurate sensor than the DHT11, but for the sake of simplicity, we’ll use the LM35 sensor in this project.
Step 3: Circuit Design
Now, let’s design the circuit to connect the components together.
- Connecting the LM35 Temperature Sensor:
● The VCC pin of the LM35 should be connected to the 5V pin of the Arduino.
● The GND pin should be connected to the GND of the Arduino.
● The VOUT pin should be connected to an analog input pin on the Arduino, for example, A0.
- Connecting the 24C04WP EEPROM:
● The VCC pin of the 24C04WP should be connected to the 5V pin on the Arduino.
● The GND pin of the 24C04WP should be connected to the GND on the Arduino.
● The SDA (data) and SCL (clock) pins of the 24C04WP should be connected to the A4 (SDA) and A5 (SCL) pins on the Arduino, respectively.
● A pull-up resistor (typically 4.7kΩ) should be placed between SDA and 5V, and another resistor should be placed between SCL and 5V to ensure reliable communication.
- Push Button for Data Logging:
● One leg of the push button should be connected to the GND.
● The other leg should be connected to a digital input pin, for example, D2.
● A pull-up resistor (10kΩ) can be used on the input pin, or you can enable the internal pull-up resistor on the Arduino.
- LCD Screen (Optional):
● If you want to display the temperature readings in real time, you can use an LCD screen like the 1602 LCD.
● The VCC and GND pins of the LCD should be connected to 5V and GND, respectively.
● The SDA and SCL pins of the LCD should be connected to the same SDA and SCL pins on the Arduino.
Step 4: Wiring and Assembling the Components
Assemble the Components on the breadboard.
Ensure the LM35 is connected to the analog input of the Arduino for temperature reading.
Connect the 24C04WP EEPROM chip to the SDA and SCL lines for communication with the Arduino.
Attach the push button to the digital input and connect it to GND.
If using an LCD, make sure the SDA and SCL are also connected to the Arduino for display functionality.
Step 5: Data Logging Process
The core functionality of this project involves reading the temperature from the sensor and storing it in the 24C04WP EEPROM. When the user presses the button, the temperature reading will be logged into memory, allowing it to be retrieved later.
Reading Temperature: The Arduino will continuously monitor the analog voltage from the LM35 temperature sensor. This value will be converted into a temperature reading (in Celsius) based on the known output characteristics of the LM35.
Triggering Data Logging: When the user presses the push button, the system will capture the current temperature and store it in the 24C04WP EEPROM. The I²C communication between the Arduino and the EEPROM will handle writing the temperature data to the memory.
Storing Temperature: Each time the button is pressed, a new temperature value will be stored at a different address in the EEPROM. The system will store the temperature data sequentially in the EEPROM memory, ensuring that the readings are saved without overwriting previous data.
Reading Data: After the data is stored, it can be retrieved by reading the EEPROM memory at the specific addresses where the temperature values were saved. You can use an LCD display to show the retrieved temperatures, or alternatively, use serial communication to send the data to a PC.
Step 6: Testing and Calibration
After assembling the circuit and connecting the components, it’s time to test the system. Start by uploading the code to the Arduino and powering the system. Press the push button, and verify that the temperature readings are correctly captured and stored in the EEPROM.
If you're using an LCD, check that the temperature value is displayed in real-time. If you're using serial communication, open the Arduino IDE serial monitor to see the logged data output.
Step 7: Troubleshooting
● EEPROM Full: The 24C04WP has limited memory (4Kb), so ensure that you are not exceeding its capacity. Each temperature reading takes up one byte, so it can store 512 readings.
● Incorrect Temperature Readings: Make sure the LM35 is properly connected, and check the analog pin reading. Ensure that your Arduino board is receiving a stable 5V supply.
● LCD Display Not Working: Double-check the wiring of the SDA and SCL pins, and ensure that the LCD is correctly connected to the I²C bus.
Step 8: Conclusion
This simple temperature logger project using the 24C04WP EEPROM chip and the LM35 temperature sensor allows you to capture, store, and retrieve temperature data over time. With just a few components, we’ve created a useful tool for logging temperature data, which can be used in various applications like weather monitoring, environmental control, or even home automation systems.
By understanding how EEPROM works and how to interface it with a microcontroller, you’ve gained valuable insights into memory storage in embedded systems. This project is not only an excellent introduction to I²C communication and EEPROMs but also a great way to learn about sensors, data logging, and real-time data storage.