Pages: [1]   Go Down
Author Topic: Data Logging  (Read 630 times)
0 Members and 1 Guest are viewing this topic.
Wrexham, North Wales
Offline Offline
Full Member
***
Karma: 0
Posts: 138
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to figure out IF its possible to create and write a .csv file directly to my computers hard drive rather than the SD card?  I've tried various variations of the SD libraries code and even created a blank .csv file within my home directory, but no success so far.
Logged

M

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13718
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino cannot access a PC's harddrive, you need some application watching the serial line.

Google for - GOBETWINO - might be part of the trick.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Wrexham, North Wales
Offline Offline
Full Member
***
Karma: 0
Posts: 138
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, ah that explains why I had no success!

Bugger, PC software only.  On a mac.
« Last Edit: August 25, 2013, 08:59:09 am by daz1761 » Logged

M

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13718
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could use the processing language, which is also available for Mac.
Or a language like Python - google "python capture serial " or so.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Wrexham, North Wales
Offline Offline
Full Member
***
Karma: 0
Posts: 138
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will do thanks  smiley
Logged

M

Northern Ontario, Canada
Offline Offline
Newbie
*
Karma: 2
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is some very basic Python code you can build upon.

Code:
import serial
import time

ser = serial.Serial('com5', 9600, timeout=1)
time.sleep(1)

logfile = open('C:\Documents and Settings\User\Documents\datalog.csv', 'a')

while 1:
line = ser.readline()
now = time.strftime("%d/%m/%Y %H:%M:%S", time.localtime())
a =  "%s, %s, %s" % (now, line, "\n")
print a
logfile.write(a)
logfile.flush()   
logfile.close()
ser.close()
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2270
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to figure out IF its possible to create and write a .csv file directly to my computers hard drive rather than the SD card? 

There several terminal programmes that can read Arduino and write to csv. I use RealTerm but I don't think there is anything special about it. PLX DAQ is an Excel macro that reads Arduino direct to Excel and gives real-time graphs as well. All the above replace the serial monitor with no change to software.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4084
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a logger that outputs the data directly as a CSV file, so all that is needed is a USB to serial interface (FTDI, etc.) and a terminal program to capture the output.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: [1]   Go Up
Jump to: