Site icon Circuit Ideas for You

Simple Micro SD Card Data Logging Circuit with Arduino UNO

Accurate and effective data logging is essential in the field of electronics and data gathering.

This project shows how to assemble an Arduino UNO, a micro SD card, an IC 7809 voltage regulator, and an IC LM35 temperature sensor to create a simple data logger.

With this configuration, you may store temperature data over time onto a micro SD card for analysis at a later time for a variety of uses, including environmental monitoring, gathering data for experiments, and teaching.

Code with Explanation:

#include <SPI.h>
#include <SD.h>

const int chipSelect = 10; // SD card select pin
const int tempPin = A0;

void setup() {
  Serial.begin(9600);
  Serial.println("Initializing SD card...");

  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    return;   

  }
  Serial.println("Card initialized.");   


  // Create a file on the SD card
  File dataFile;
  dataFile = SD.open("temperature.txt", FILE_WRITE);

  // Write a header to the file
  dataFile.println("Time, Temperature (Celsius)");
  dataFile.close();
}

void loop() {
  // Read the temperature from the LM35
  int sensorValue = analogRead(tempPin);
  float temperature = (sensorValue * 5.0) / 1023.0 * 100.0; // Adjust formula as needed

  // Get the current time
  DateTime now = DateTime.now();

  // Write the data to the file
  File dataFile;
  dataFile = SD.open("temperature.txt", FILE_WRITE);
  dataFile.print(now.hour());
  dataFile.print(":");
  dataFile.print(now.minute());
  dataFile.print(":");
  dataFile.print(now.second());
  dataFile.print(",");
  dataFile.println(temperature);   

  dataFile.close();

  // Print the data to the serial monitor
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" degrees Celsius");

  delay(1000); // Delay for 1 second
}

Explanation:

Circuit Working:

Parts List:

ComponentQuantity
Arduino UNO1
Micro SD Card Module1
IC 7809 Voltage Regulator1
IC LM35 Temperature Sensor1

A well-liked and adaptable microcontroller board for a range of electronic applications is the Arduino UNO.

It interfaces with the other components to gather and analyze data, acting as the projects central control unit.

For data logging, the micro SD card offers an extendable and practical storage option.

The LM35 sensors temperature measurements will be stored in this project.

This voltage regulator maintains a steady 9V output.

Powering the parts of this project that need controlled voltage in order to function properly is crucial.

The LM35 temperature sensor is a precise temperature sensor that yields an analog output that varies in direct proportion to the measured temperature.

Its purpose is to take the outside temperature and send the data to the Arduino.

How to Build:

To build a Simple Micro SD Card Data Logging Circuit with Arduino UNO following are the steps for connections:

Conclusion:

The framework for developing more complicated data recording systems is provided by Simple Micro SD Card Data Logging Circuit.

It may be expanded to include longer data storage durations, various sensor monitoring, and system integration for analysis and display.

Understanding the projects guiding principles will enable you to design customized data logging solutions for a range of uses.

References:

Sd card problems and data logging

Exit mobile version