1Jan

Arduino Data Acquisition Into Excel For Mac

1 Jan 2000admin
Arduino Data Acquisition Into Excel For Mac 3,9/5 305 votes

Using the SD library to log data

Arduino-based data acquisition into Excel, LabVIEW, and MATLAB. Data acquisition equipment for physics can be quite expensive. As an alternative, data can be acquired using a low-cost Arduino microcontroller. The Arduino has been used in physics labs where the data are acquired using the Arduino software.

This example shows how to use the SD card Library to log data from three analog sensors to a SD card. Please click here for more information on the SD library.

Hardware Required

  • Arduino or Genuino board
  • Ethernet Shield (or other board with an SD slot)
  • 3 10k ohm potentiometers
  • hook-up wires
  • breadboard
  • Formatted SD card

Circuit

image developed using Fritzing. For more circuit examples, see the Fritzing project page

The Arduino or Genuino board has to be connected to the Ethernet Shield. The three potentiometers may be substituted with other analog sensors, to be wired according to their interfacing techniques.

Schematics

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Code

The code below is configured for use with an Ethernet shield, which has an onboard SD slot. In the setup(), call SD.begin(), naming pin 4 as the CS pin. This pin varies depending on the make of shield or board.

In the loop(), a String is created to hold the information from three analog sensors. The code iterates through the sensors, adding their data to the string.

Next, the file on the SD card is opened by calling SD.open(). Once available, the data is written to the card when dataFile.println() is used. The file must be closed with dataFile.close() to save the information.

/*
SD card datalogger
This example shows how to log data from three analog sensors
to an SD card using the SD library.
The circuit:
analog sensors on analog ins 0, 1, and 2
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
created 24 Nov 2010
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
*/

#include <SPI.h>
#include <SD.h>
const int chipSelect =4;
voidsetup(){
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial){
;// wait for serial port to connect. Needed for native USB port only
}
Serial.print('Initializing SD card..');
// see if the card is present and can be initialized:
if(!SD.begin(chipSelect)){
Serial.println('Card failed, or not present');
// don't do anything more:
while(1);
}
Serial.println('card initialized.');
}
voidloop(){
// make a string for assembling the data to log:
String dataString =';
// read three sensors and append to the string:
for(int analogPin =0; analogPin <3; analogPin++){
int sensor =analogRead(analogPin);
dataString += String(sensor);
if(analogPin <2){
dataString +=',';
}
}
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
File dataFile = SD.open('datalog.txt', FILE_WRITE);
// if the file is available, write to it:
if(dataFile){
dataFile.println(dataString);
dataFile.close();
// print to the serial port too:
Serial.println(dataString);
}
// if the file isn't open, pop up an error:
else{
Serial.println('error opening datalog.txt');
}
}

See Also

  • SD library - Your reference for the SD Card library.
  • Notes on using SD cards – What you need to know when you use SD cards


  • CardInfo - Get info about your SD card.
  • DumpFile - How to read a file from the SD card.
  • Files - How to create and destroy an SD card file.
  • Listfiles - How print out the files in a directory on a SD card.
  • ReadWrite - How to read and write data to and from an SD card.


Last revision 2015/08/17 by SM

  • This dataacquisition software component makes dataacquisition and data collection easy! Automate data collection with devices like barcode readers, scanners, gauges and scales. For Visual Basic, C/C++, .NET, Excel, Access, Word, Delphi, IE and more. ..

    • TConnector2_setup.exe
    • TEC-IT DatenverarbeitungGmbH
    • Demo ($59.00)
    • 92 Kb
    • Win98, WinME, WinNT 3.x, WinNT 4.x, WinXP, Windows2000, Windows2003, Windows Vista
  • AUTOMATED DATAACQUISITION MADE EASY!The dataacquisition software component TConnector extends your application (Microsoft Office applications, web applications, Visual basic, C/C++, Delphi and .NET programs) with automated data collection. ..

    • TConnector_Setup.msi
    • TEC-IT DatenverarbeitungGmbH
    • Shareware ($62.00)
    • 2.68 Mb
    • WinXP, Win7 x32, Win7 x64, Windows2000, Windows2003, Windows Vista, Win98, WinME, WinNT 3.x, WinNT 4.x
  • XLS to HTML Data Cell Excel .Net is an ASP Net component that enables to convert automatically Excel Spreadsheet XLS to HTML Web page. It supports converting XLS files to other Excel files such as XLS to HTML,XLS to CSV,XLS to TXT,XLS to XML,XLS to. ..

    • excel_net_trial.zip
    • DuoDimension Software
    • Shareware ($45.00)
    • 579 Kb
    • WinXP, Windows2000, Windows2003, Windows Vista
  • If your problem consists in categorizing or stratifying specific data of your Excel spreadsheet information, then Categorizing Data for Excel is the solution. Geometria for mac.

    • categorizing_data_trial.zip
    • Model Advisor
    • Shareware ($69.95)
    • 1.58 Mb
    • Windows
  • Nuclear physics dataacquisition system. The suit of applications can be used to collect data from physics experiments using CAMAC/CAEN/VME devices. The system is quite specialized, but the code can still be useful for others doing something. ..

    • CDA.win32.00.00.01.zip
    • at-cda
    • Freeware (Free)
    • 9.77 Mb
    • BSD; Windows; Linux
  • ChNIDAQ allows user programs to use the NI-DAQ C library and run interpretively without compilation. It is an ideal solution for teaching and learning dataacquisition, prototyping, and web-based remote data. ..

    • Data Acquisition usingNI-DAQ in Ch
    • chnidaq
    • Freeware (Free)
    • 74 Kb
    • Windows; BSD; Linux
  • Libraries, documentation, examples & drivers for Eagle Technology South Africa's DataAcquisition products. These include ISA, PCI, PCI Express, USB, Serial & Ethernet. Supported languages will be C/C++, JAVA, Perl,. ..

    • edrelib-2.6.5.tar.gz
    • eagledaq
    • Freeware (Free)
    • 1.2 Mb
    • Windows; BSD; Linux
  • Real-time EEG dataacquisition and control software for event relatedpotential (ERP) researchers. Writes data in ERPSS (UCSD) raw and logformat and displays, in real time, in X. ..

    • digitize-3.0.0.tar.gz
    • digitize
    • Freeware (Free)
    • 239 Kb
    • BSD; Solaris; Linux
  • Jam is an easy-to-use self-contained dataacquisition and analysis system for VME-based (or CAMAC-based) nuclear physics experiments. Jam has an easy, standard GUI for taking and sorting multi-parameter event-based data into 1-d and 2-d. ..

    • jam-2.4.19.zip
    • jam-daq
    • Freeware (Free)
    • 1.77 Mb
    • Windows; Mac; Solaris; Linux
  • The NSCL DataAcquisition system is a general purpose nuclear physics dataacquisition system in use at several university labs and, of course, the National Superconducting Cyclotron Laboratory at Michigan State. ..

    • nscldaq-8.2-018.tar.gz
    • DOCS
    • Freeware (Free)
    • 10.62 Mb
    • BSD; Linux
  • Framework for dataacquisition through the parallel port, suitable for performing simple didactic physics Framework for data acquisition through the parallel port, suitable for performing simple didactic physics experiment.

    • PLAS_v1.0_beta_build243.tar.gz
    • plas
    • Freeware (Free)
    • 5.09 Mb
    • Linux
  • The Serial DataAcquisition is a lightweight dataacquisition system able to parse a vast majority of mostly unidirectional streams. Results are saved in a SQLite DB and accessible over XML-RPC or plain HTTP. Its design is modular and easily. ..

    • psda_0.1.1.tar.gz
    • psda
    • Freeware (Free)
    • 11 Kb
    • Windows; Mac; Linux

Arduino Data Acquisition Into Excel For MacRelated:Data Acquisition Excel - Pc Data Acquisition - Genie Data Acquisition - Data Acquisition Java - Wireless Data Acquisition
Pages : 1 2 3>