HOME > > ELECTRONICS MAIN PAGE    
ARDUINO MAIN PAGE

OpenLog from Sparkfun

Easy add-on SD storage card option

Established product, and only $16 (+p&p), Nov 2018

(file name: ec3openlog-intro.htm)

A lot could be said about this product. And I probably will write more pages eventually, and take some of the rough edges off this one. But it is "complete" for the message I want to bring to you.

((q-alt text for image))

But before you look at the Sparkfun hookup guide, or before I "start", let me just say...

If you Keep It Simple, this is ALREADY great!

I soldered 3 wires to my OpenLog.

I connected the OpenLog's Vcc to my Arduino's Vcc. (Power from Arduino to OpenLog. And their Grounds. And the OpenLog's RXI to a digital output of my Arduino.

Wrote the little program I will show you shortly. Ran it... and my Arduino wrote a text file to the SD card in the OpenLog.

I was using a 5v Arduino. I'm told the OpenLog plays just as nicely with a 3v3 system.

The program you need, to see it in basic operation...

//OpenLogBasicDemo18Oct
//See "WelcomeMsg()" for version ID and h/w expectations

#include <SoftwareSerial.h>;

const byte pSerialToOpenLog=6;
SoftwareSerial SerialToOpenLog(7,pSerialToOpenLog);//RX/TX

unsigned long ulCycles=0;

void setup() {
Serial.begin(9600);//To initialize channel to ordinary
//   serial monitor:
delay(20);
WelcomeMsg();

SerialToOpenLog.begin(9600);
delay(20);

}// end of setup()

void loop() {
  int iCyclesToWait=4;
  int iCyclesAtDone=ulCycles;//.. plus...
  iCyclesToWait=iCyclesToWait+random(3);
  iCyclesAtDone=ulCycles+iCyclesToWait;

  while (ulCycles<iCyclesAtDone)
  {
    Serial.print('x');
    ulCycles++;
    delay(500);
  }

  Serial.println("");
  Serial.println("While.. completed, writing to SD");

      SerialToOpenLog.print("At ");
      SerialToOpenLog.print(millis());
      SerialToOpenLog.print(" milliseconds, ulCycles=");
      SerialToOpenLog.println(ulCycles);

  Serial.println("... Write to SD done.");
}//end of loop()

void WelcomeMsg()
{
   Serial.println("OpenLogBasicDemo18Oct");
   Serial.println("vers 30 Oct 18");
   Serial.println("");
   Serial.print("Needs a Sparkfun OpenLog on pin ");
   Serial.println(pSerialToOpenLog);
   Serial.println("");
   Serial.println("Writes 'stuff' to it.");
   Serial.println("Useful stuff? No. But enough");
   Serial.println("to test that all is well.");
   Serial.println("");
   Serial.println("(Turn off, put SD card in a reader,");
   Serial.println("check for files. Files there? Readable?");
   Serial.println("Then OpenLog worked!");
   Serial.println("");
   Serial.println("I would GUESS you chould format SD card");
   Serial.println("before using it.");
   Serial.println("");
   Serial.println("You can run the program multiple times.");
   Serial.println("That will give rise to multiple files.");
   Serial.println("");
}// end of WelcomeMessage()

The result: On the SD card, a file called LOG0000.txt, holding...

At 5434 milliseconds, ulCycles=10
At 8472 milliseconds, ulCycles=16
At 11510 milliseconds, ulCycles=22
At 14050 milliseconds, ulCycles=27
At 17088 milliseconds, ulCycles=33
At 19128 milliseconds, ulCycles=37
At 22167 milliseconds, ulCycles=43
At 25205 milliseconds, ulCycles=49
At 27745 milliseconds, ulCycles=54
At 29784 milliseconds, ulCycles=58
At 32823 milliseconds, ulCycles=64

(There was a little... 40 characters?... gibberish at the start. What do you want for such a CRUDE program driving the device? I doubt very much that the gibberish was the OpenLog's fault. In any case, it is easy enough to edit off, if you don't want to bother fixing the program.)

Reset the Arduino without clearing the SD card first, and the new data will go to a new file.... LOG00001.txt. And so on, if you reset over and over.

You CAN do MORE...

You can do oh so much more. Read data from an SD card. Store things to specific, name- chosen- by- you files. Work at higher data rates.

But first you have to buy one. (That's the Sparkfun page for OpenLog. There's more on how you can use it... lots more!... there.) And when you have, "out of the box", you can use it to capture anything you can send from the Arduino as a serial stream.

It does NOT come with a microSD card. Any 512 MB to KGB microSD card should work. You should format the card with sdcard.org's formatter, available (free) from the sdcard.org site. (Formats with FAT32).

There's a discussion of why you should do that, not just use your "ordinary" formatter, in the Arduino forums of Arduino.cc.



   Search this site                 powered by FreeFind
 
Site Map    What's New    Search


Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, Sheepdog Software (tm), download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam.) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Don't forget to check out the programs for controlling the state of the parallel port at my shareware site. There are two free programs there... one for toggling bits, the other for using the computer as a timer via the parallel port.


Here is how you can contact this page's editor.
Click here to go up to general page about electronics by editor of this page.
Click here to go up to general page about electronic projects by editor of this page.
Why does this page have a script that loads a tiny graphic? I have my web traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try it, check out eXTReMe's site. The Google panels and the search panel are also script based.

Valid HTML 4.01 Transitional Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org. Mostly passes. There were two "unknown attributes" in Google+ button code, and two further "wrong" things in the Google Translate code. Sigh.


....... P a g e . . . E n d s .....