Project Report: Temperature Data Logger with Arduino
and LM35 Temperature Sensor
Table of Contents
1. Introduction
• Project Overview
• Objectives
2. Materials and Components
• Hardware Components
• Software Requirements
3. System Design
• Block Diagram
• Circuit Diagram
4. Implementation
• Hardware Setup
• Software Development
• Arduino Code
• Data Logging Code
5. Testing and Results
• Testing Procedure
• Data Analysis
6. Conclusion
• Project Summary
• Future Enhancements
7. References
1. Introduction
Project Overview
The project aims to design and implement a temperature data logger using an Arduino
microcontroller and an LM35 temperature sensor. This system will continuously monitor
temperature readings and store the data for future analysis, providing an effective
solution for environments where temperature tracking is crucial.
Objectives
• To develop a reliable temperature monitoring system.
• To log temperature data over time for analysis.
• To ensure accurate and consistent temperature readings.
2. Materials and Components
Hardware Components
• Arduino Uno: Microcontroller board for interfacing with the sensor and logging
data.
• LM35 Temperature Sensor: Sensor used for accurate temperature
measurement.
• SD Card Module: For storing the logged temperature data.
• Breadboard and Jumper Wires: For building the circuit.
• USB Cable: For programming the Arduino and power supply.
• Power Supply: 9V battery or any appropriate power source for the Arduino.
Software Requirements
• Arduino IDE: For writing and uploading the code to the Arduino board.
• SD Library: Arduino library for handling SD card operations.
3. System Design
4. Implementation
Hardware Setup
1. Connecting the LM35 Sensor:
• Connect the Vcc pin of the LM35 to the 5V pin on the Arduino.
• Connect the GND pin of the LM35 to the GND on the Arduino.
• Connect the Vout pin of the LM35 to the A0 analog input on the Arduino.
2. Connecting the SD Card Module:
• Connect the Vcc pin of the SD card module to the 5V pin on the Arduino.
• Connect the GND pin of the SD card module to the GND on the Arduino.
• Connect the CS, MOSI, MISO, and SCK pins of the SD card module to the
corresponding digital pins on the Arduino (usually 10, 11, 12, and 13).
Software Development
Arduino Code
#include <SD.h>
#include <SPI.h>
const int LM35Pin = A0;
const int chipSelect = 10;
void setup() {
Serial.begin(9600);
pinMode(LM35Pin, INPUT);
if (!SD.begin(chipSelect)) {
Serial.println("SD card initialization failed!");
return;
}
Serial.println("SD card initialized.");
}
void loop() {
float temperature = analogRead(LM35Pin) * (5.0 / 1023.0) * 100.0;
logTemperature(temperature);
delay(1000);
}
void logTemperature(float temp) {
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
dataFile.print("Temperature: ");
dataFile.print(temp);
dataFile.println(" C");
dataFile.close();
Serial.println("Data logged.");
} else {
Serial.println("Error opening datalog.txt");
}
}
5. Testing and Results
Testing Procedure
1. Initial Setup: Assemble the hardware and upload the code.
2. Calibration: Verify the sensor readings with a known temperature source.
3. Data Logging: Let the system run for a predetermined period and ensure data is logged
correctly.
Data Analysis
• Extract data from the SD card and analyze temperature trends over time.
• Verify the accuracy of logged data by comparing it with standard temperature
measurements.
6. Conclusion
Project Summary
The temperature data logger project successfully demonstrated the integration of an
Arduino microcontroller with an LM35 temperature sensor and an SD card module to
monitor and log temperature data accurately. This project is beneficial for applications
requiring continuous temperature monitoring and data logging.
Future Enhancements
• Wireless Data Transmission: Integrate a wireless module for real-time data monitoring.
• Multiple Sensors: Expand the system to handle multiple temperature sensors.
• User Interface: Develop a user-friendly interface for data visualization and analysis.
7. References
• Arduino Documentation: https://www.arduino.cc/en/Guide
• LM35 Datasheet: https://www.ti.com/lit/ds/symlink/lm35.pdf
• SD Library Documentation: https://www.arduino.cc/en/Reference/SD