03.06
OpenLog
WHAT IS THIS:
OpenLog is an open source data logger, available from SparkFun. It takes serial data and write into a microSD card. It can be connected to a microcontroller, such as Arduino.
Feather:
- small size
- integrating a MicroSD card writer
- support MicroSD card up to 2GB, ONLY FAT16 format
- Support high sample rate
- Power usage about 18mA at Maximum rate
- Take either 3.3V or 5V Power
HOW TO CONFIG:
Wire your openLog with USBtoSerial Adapter or using Arduino. If you use USBtoSerial adapter, you connect Rx to Tx, Tx to Rx, check this as reference. If you use Arduino, connect your Rx pin on arduino to Rx pin on openLog, Tx to Tx. Here is the diagram how to wire it.(you need to upload a blank code or any code without serial communication).
you can use any serial program(such as coolterm/cornflakes) to configure it. I use terminal below. Here are the steps you take once you’ve got the serial port open:
- type “Control + z to get into the configuration mode”
- ….config it…. check commend sets for more details
- type “set”
- type 1 to get into ‘LOG’ Mode.
( if your arduino have some serial communication code running, the terminal will print the data out, you can’t get into the config mode. If you have problem from changing into Log mode, you might need to update the firmware of it. Since it’s a AMTEL chip, same as arduino, you can use avrdude to do it. I will post one tutorial later.)
HOW TO LOG DATA:
OpenLog can log data, but don’t have any analog inputs. It take whatever serial inputs and write it down into the mircoSD card. So you need a microcontroller like arduino to read the sensor data and pass them to openLog using serial. In openLog, you can have more file controls on the SD card side, like log into different file…etc. I’ll take a photocell as an example:
You notice from the diagram above, you connect your Rx pin to Tx pin, Tx pin to Rx pin. It’s different from the config mode. To test it out, simply choose an example code from arduino: File->Exmaples->Analog->AnalogInSerial. Then openlog will log your data line by line into your microSD card. The simple way to play with it is changing delays to change the sample rates. Like delay(100) means 10 samples per second. You can also add serial.println to change your data format, like Serial.println(“Sensor1: “)……
HOW TO READ THE LOG DATA:
Use a SD card reader or when you config the openLog, there is command to do it as well.




Damned!
That was exactly the info i was looking for.
Thanks and hello from Belgium
Any chance you could provide a download for that OpenLog part in Fritzing? I was about to create my own, but it looks like your’s would save me some effort if you don’t mind. Thanks!
Hi Bret,
I didn’t much time to create a Fritzing Part, if you look closely, you might notice it’s a fake one. If I did, I don’t mind to give you a link. So…good luck with your fritziing part.
xiaoyang
Ah, no biggy, just trying to avoid redoing what’s already out there. Thanks though.
any sample arduino sketch for reading/writing?
#include
/*
Analog input, serial output
Reads an analog input on pin 0, prints the results to the serial.
Using Software Serial make debugging much easier.
xiaoyang feng
*/
#define rxPin 2
#define txPin 3
#define sensorPin 0 //analog input pin from sensor
SoftwareSerial dataLoggerSerial = SoftwareSerial(rxPin, txPin);
void setup() {
Serial.begin(9600);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
dataLoggerSerial.begin(9600);
dataLoggerSerial.println("3:50"); //time code
}
void loop() {
// read the analog input into a variable:
int analogValue = analogRead(sensorPin);
// print the result:
// Serial.print(analogValue, BYTE);
Serial.println(analogValue, DEC);
dataLoggerSerial.println(analogValue, DEC);
// wait 10 milliseconds for the analog-to-digital converter
// to settle after the last reading:
delay(100);
}