Data logging / Using memory cards

Hobbytronics ArduLog and ArduLog-RTC, and Sparkfun's OpenLog

Easy add-on SD card "memory" (properly called storage) option

Established products, less than $20/ £15 (+p&p), Nov 2018

(file name: ec3openlog-intro.htm)

A lot could be said about the Sparkfun OpenLog, which I have had a preliminary "play" with. And then there's the Hobbytronics ArduLog, and ArduLog-RTC... very similar, software compatible, I'm told. 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.

(Image of Sparkfun OpenLog device)

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...

//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:


}// end of setup()

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

  while (ulCycles<iCyclesAtDone)

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

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

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

void WelcomeMsg()
   Serial.println("vers 30 Oct 18");
   Serial.print("Needs a Sparkfun OpenLog on pin ");
   Serial.println("Writes 'stuff' to it.");
   Serial.println("Useful stuff? No. But enough");
   Serial.println("to test that all is well.");
   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("I would GUESS you chould format SD card");
   Serial.println("before using it.");
   Serial.println("You can run the program multiple times.");
   Serial.println("That will give rise to multiple files.");
}// 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.

And then there are the HobbyTronics loggers...

I haven't had time to play with these yet, but I've every reason to believe they are good products. I just happened to hear of OpenLog first. I've spent some time looking at the product descriptions, and am very tempted.

I (strongly) believe that either can be used exactly as the "simple mode" use I described for the OpenLog.

OpenLog can do more than "just" that of course... as can the ArduLogs. The "more" is in some case the same... but they do differ in some ways.

What a relief it is to find a UK supplier that isn't merely a distributor for the big US suppliers!

I particularly like Hobbytronics for their excellent serially driven 1.8" TFT display... That may seem small, but the 160 x 128 pixels (many colors) are wonderfully crisp, and the display can convey a lot of information... if you have sharp eyes! I like it so much that it is the subject of a page like this one... but one that is more complete, more polished!

But! To get back to the loggers: There's...

"ArduLog Data Logger V3" (ARDULOG3) (£14.40 + p&p)
... and ...
"ArduLog-RTC" (ARDULOG-RTC) (£18 + p&p)

As I said... in simple use, these "just" do what OpenLog does. But read the product descriptions to learn more.

The ArduLog-RTC has, as you might have guessed, a Real Time Clock, so that data records can be "stamped with date and time.

The OpenLog needs to be connected to a stream of serial data. The ArduLogs can be connected directly to a host of sensors, creating an "Arduino-less" data logger.

All very cool. If only the day job... and writing this... didn't keep me from testing out some of the things claimed for the ArduLogs right now!

You CAN do MORE...

With OpenLog or ArduLog (ether version), 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.) (See above for links to Hobbytronics product pages. (Hobbytronics is UK based, Sparkfun is in the USA.) And when you have received your logger, "out of the box" you can use it to capture anything you can send from the Arduino as a serial stream.

They do NOT come with microSD cards. Any moderately sized microSD card should work. (512 MB and up.. but not to the stratosphere... see device specs.)

You should consider formatting 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.

Doing more for less...

I came to using SD cards with microprocessors via the "log data" route.

Another route, less demanding: Use an memory card to hold a config file. If, for instance, you are creating a IoT device which will connect to a LAN, an Arduserver, for instance, you can hard-code the device's IP address, and log on creds into the device. But wouldn't it be neat to have "generic" code, that didn't need touching if the device were moved to a different network?

This could be achieved by putting the IP address, log on creds, etc into a "config" file, storing that on a memory card, and telling the microprocessor to refer to that for the necessary details are needed.

In a simple scenario, the file would be created on a big computer, and then the memory card used "read only" on the microprocessor system.

In a fancier scenario, there might be parameters that could be supplied, changed by the user while the device was running, and written to the memory card, to carry those settings across power cycles.

An OpenLog can handle either! But it is an elephant gun, if that's "all" you want. (OpenLog can deal with an incoming serial data stream, create and fill files, etc. Not needed for simple config file management.)

I haven't tested the following, but have every confidence that they would be Just Fine for config file wants... or similar things!...

Reminder: OpenLog is happy to work under 5v or 3v3. The data stream can be 3v3 or 5v based.

Hobbytronics.co.uk offers...

Hobbytronics Breakout Board for microSD Flash Drive (part number MICROSD-BASIC, £4.20 (incl VAT)+p&p). You would only use this device on a 3v3 system. (The memory cards operate at 3v3, so that makes creating the breakout easier, if you can be happy with just 3v3.) For "how to use this", see that information as written up for the next device, the "...with Logic Conversion" board. They both work the same way, they are different mainly in the "extras" on the other board to allow use on a 5v system.

Hobbytronics MicroSD Breakout Board Regulated with Logic Conversion V2 (part number SDCARD-REG2, £7.20 (including VAT)+p&p). This is similar to the previous, but with "extra bits" so that you can use it with a 5v system. Use is straightforward, and explained at the Hobbytronics site. Communications with the SD card are via an SPI interface, using the standard libraries if you are using this with an Arduino. (Four digital lines needed.) There's an on-board regulator to provide for the needed 3v3, with a little spare capacity, if you want to draw some current from it for other 3v3 devices in your system.

Sparkfun.com offers...

Sparkfun microSD Transflash Breakout (part number BOB-00544, $4.50+p&p). You would only use this device on a 3v3 system. (The memory cards operate at 3v3, so that makes creating the breakout easier, if you can be happy with just 3v3.) Sparkfun offer one of their excellent hookup guides for this... (though the links to reach it aren't perfect, 11/18!).

Sparkfun Level Shifting microSD Breakout (part number DEV-13743, $5.50+p&p). This is similar to the previous, but with "extra bits" so that you can use it with a 5v system. Use is straightforward, and explained at the Hobbytronics site. Communications with the SD card are via an SPI interface, using the standard libraries if you are using this with an Arduino. (No more than 4 digital lines needed... read the hookup guide carefully... it says you need three, but I suspect that at you must leave the 4th line associated with SPI alone while using the device.).

Whether you buy the Hobbytronics or Sparkfun versions... I would suggest that you read BOTH hookup guides. There are things to be learned from each in connection with these very similar alternatives.

(The same considerations about media and formatting as were discussed in the previous section still apply. (Size and formatting.))

   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 .....