ahmed ismail
Published © CERN-OHL

Export Data from Arduino to Excel Sheet

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.

BeginnerShowcase (no instructions)1 hour28,939
Export Data from Arduino to Excel Sheet

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
1Sheeld
1Sheeld
×1
1Sheeld
1Sheeld
×1
LDR
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×3
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Export data from arduino to excel sheet

Code

Export data from arduino to excel sheet

Arduino
/*

@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);
     }
  }

Credits

ahmed ismail

ahmed ismail

2 projects • 107 followers
Maker

Comments