Project showcase
Export Data from Arduino to Excel Sheet

Export Data from Arduino to Excel Sheet © CERN-OHL

Have you ever wanted to make a system that records sensor readings for future analysis? If so, that's exactly what we're about to do.

  • 20,377 views
  • 1 comment
  • 12 respects

Components and supplies

Apps and online services

About this project

Introduction

Many times I thought of a system that will track a sensor readings for specific time and save that data for future analysis after doing the same task for several days. So I made a system using Arduino and the amazing 1sheeld to save LDR readings in an Excel sheet and that is what we are going to do now.

LDR is an acronym for "light dependent resistor" as it's a resistance but its value changed with light in the environment. 1Sheeld is a platform for Arduino that allows you to tap into your smartphone's sensors and capabilities and lets you use them in your Arduino projects.

The project

Basically, 1Sheeld is a hardware shield that sits on top of your Arduino board and communicates over Bluetooth to this Android app, to transfer data between it and your smartphone.

You can check all 1sheeld's tutorials which will take you from the early beginning into more and more advanced projects from that link. And you can order it from here.

Code

Export data from arduino to excel sheetArduino
/*

@title : Export data from arduino to excel

@author : Ahmed Ismail

@email : ahmed.ismail3115@gmail.com

@compiler : Arduino IDE

*/

#define CUSTOM_SETTINGS
#define INCLUDE_CLOCK_SHIELD
#define INCLUDE_DATA_LOGGER_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

/* Define the ldr on pin A0. */
#define LDR A0

/* Define some variables for the time and ldr. */
int hour, minute, second, ldr;

/* Boolean to start logging. */
bool startFlag = false;

void setup(){

/* Start communication. */
  OneSheeld.begin();
   /* Save any previous logged values. */
  Logger.stop();
  /* Start the clock shield. */
  Clock.queryDateAndTime();
  
  }

  void loop(){

  /* Always get the  time. */
  hour = Clock.getHours();
  minute = Clock.getMinutes();  
  second = Clock.getSeconds();
  ldr = analogRead(LDR);

  /* check If the seconds reaches zero. */
  if (second == 0){
     /* First insure to save previous logged values. */
    Logger.stop();
     /* Set a delay. */
    OneSheeld.delay(500);
     /* Start logging in a new CSV file. */
    Logger.start("LDR values");
     /* Set startFlag. */
    startFlag = true;
    }

    
     /* Check logging started. */
  if(startFlag)
  {
  /* Add brightness level values as a column in the CSV file. */
    Logger.add("Brightness",ldr);
    
      Logger.log();  
    /* Delay for  2 seconds. */
    OneSheeld.delay(2000);
     }
  }

Schematics

Export data from arduino to excel sheet
Ldr%20data%20logger

Comments

Similar projects you might like

How can you Report Thief with a Photo on Twitter by Arduino

Project tutorial by ahmed ismail

  • 1,401 views
  • 0 comments
  • 8 respects

Menu Card To Speech, Reads And Writes Data On Thingspeak

Project tutorial by eric

  • 910 views
  • 0 comments
  • 2 respects

Temperature and Humidity Data Logger

Project tutorial by Wimpie van den Berg

  • 23,414 views
  • 2 comments
  • 22 respects

The TrafficLight

Project showcase by Advaith Jagathesan

  • 12,824 views
  • 1 comment
  • 20 respects

Send MKR1000 Data to Google Sheets

Project tutorial by Stephen Borsay

  • 9,995 views
  • 28 comments
  • 31 respects

Simple Data Statistics (Temperature)

by paskino

  • 2,490 views
  • 0 comments
  • 12 respects
Add projectSign up / Login