How to Use a Datalogger

How to Use a Datalogger

This project will show you how to use a datalogger and how to registered analog values on a SD card.

  • 250 views
  • 0 comments
  • 3 respects

Components and supplies

Apps and online services

About this project

Functioning and uses

A datalogger is a particular mounting which is able to registered some values on a support ( like SD card ) periodically. In other words, a measure, represented by a value, is realised every N second.

So this system can be used in many projects that need a measurement every N second and that have to record it on a non-volatile memory ( for meteorologist this type of system can be used to make probe like hygrometer or thermometer ).

When you plug your SD card into a computer, a excel file nammed Light is created and all the value of the analog reading appears in a column nammed Brightness value per seconds.

Connections

There are no connections to make between the Arduino UNO and the Datalogger Shield, you only have to plug the datalogger shield on the Arduino UNO.

The code of this project registered on the card the brightness per seconds. The values come from a photoresistor so connections are really simple.



Code

Datalogger codeArduino
This code will registered analog values read by the arduino on an SD card and create an excel file when this SD card is open on a computer.
#include <SPI.h> 
#include <SD.h>  

const char* filename = "Light.csv";

File file;

void setup() {
  Serial.begin(9600);
 
  pinMode(10, OUTPUT); 
  
  if (!SD.begin(10)) {
    Serial.println("Error : Push the reset button");
    for (;;); 
  }
  
  file = SD.open(filename, FILE_WRITE);
 
  if (file.size() == 0) {
    file.println("Brightness value per seconds");
    file.flush();
  }
}

void loop() { 
    measure();
    delay(1000);
}

void measure() {
  int lightvalue = analogRead(A0); 
  Serial.println(lightvalue);
  file.println(lightvalue);
  file.flush();
}

Comments

Similar projects you might like

Creating a Datalogger with Arduino - Part II

Project in progress by PCBWay and Silícios Lab

  • 2,976 views
  • 0 comments
  • 13 respects

The Troll Switch

Project tutorial by Aitor Gamarra

  • 1,581 views
  • 3 comments
  • 6 respects

Creating a Datalogger with Arduino - Part I

Project tutorial by PCBWay and Silícios Lab

  • 1,746 views
  • 0 comments
  • 11 respects

The TrafficLight

Project showcase by Advaith Jagathesan

  • 15,558 views
  • 1 comment
  • 23 respects

Basic Arduino + JavaScript (Workshop)

by Alex Glow

  • 14,149 views
  • 1 comment
  • 30 respects

Arduino Bluetooth Robot for Android Device

Project showcase by aip06

  • 3,632 views
  • 2 comments
  • 16 respects
Add projectSign up / Login