Usually the easiest way is to take the SD card out of the Arduino and attach it to your PC through an SD card reader. Some PCs come with SD slots and if your's doesn't you can buy a USB SD card reader for well under $20.

Usually the easiest way is to take the SD card out of the Arduino and attach it to your PC through an SD card reader. Some PCs come with SD slots and if your's doesn't you can buy a USB SD card reader for well under $20.

Yes I would say well under $20, try $1 on E-bay all day with free shipping.

Since you have a USB serial connection to a PC, why not add a feature to your sketch to send the data from the file over the serial port and capture it on the PC side using your favorite terminal program?

The Arduino is in an enclosure, temp and moisture controlled box and has been working fine for almost a year. I currently remove the card monthly and transfer the data but with the snow it's a lot more difficult to make the trip onto the roof.

Since you are writing your logs on the SD card you should already know how to write (and read) from it. My understanding is that you have a USB connection. So, in principle, you may transfer the file by repeatedly reading the file and calling serial.write(). The process would be started by the PC sending some message to the Arduino over the serial port.

A basic "protocol" could be:- send a command (e.g., GET) from the PC to start the transmission (no need to specify a file name, the PC will save the data under a local file name of your choice);- answer by sending your data divided in small binary chunks (same length, may even contain a checksum);- for each chunk of data sent, wait for the PC to send an ACK (and define what to do if no ACK is received within a certain amount of time);- send an EOF when you have sent the last chunk of data.

This would be pure serial transmission so you shouldn't interpolate the usual debugging messages.

It seems like communicating through the USB to the PC is the answer but I have a couple of questions.

I understand what spatula is suggesting but was wondering if I can use the log file that I can create using the terminal program "Putty" and just appending to it for each cycle would work. If so, I'm not sure how to designate the serial.write be directed to Putty (com1) and not the serial monitor in the Arduino user interface (com5).

... was wondering if I can use the log file that I can create using the terminal program "Putty" and just appending to it for each cycle would work. If so, I'm not sure how to designate the serial.write be directed to Putty (com1) and not the serial monitor in the Arduino user interface (com5).

I'm a bit confused, maybe missing something. I understand that you have been able to configure two COM ports on your PC, both can listen for messages from the Arduino and (maybe) send messages to it. Is it a Mega? Anyway, if you already receive data on putty... well, I don't have putty (on Mac) but I believe you can configure it to append new data to an existing file. You'll need to have putty running forever, but this solution is undoubtedly faster than implementing a file transmission protocol, however small.

As for sending data to com1 instead of com5, the answer is in your code. If you decide to write a function to send data on different ports you'll have to post the relevant parts of your existing code -- one cannot guess what is currently sent to com1 vs com5 and where and how the code needs to be changed.

I didn't necessarily configure 2 com ports. I have Putty installed from another project having nothing to do with this Arduino project and I just noticed it was on com 1. com 5 is the port that the PC set the Arduino to, nothing I did. I don't know how to direct the serial.write to com1. The com 5 I am refering to is the com port the Arduino is connected to and as such, the Arduino serial monitor.

As for Putty running forever that is not a problem since it's a dedictaed PC just for this project and as long as I need to collect the data.

Right now I'm only using some test code to get this thing working. When I write to the SD card I also wrote to the Arduino serial monitor to verify the data that's passing through. How do you modify the code to write to Putty through com1 rather than the Arduino serial monitor through com 5?

Yes, now I understand. But no, the Arduino cannot communicate with the PC using a different com port than the one assigned by Windows, com5 in your case. You can, however, open a new putty session and configure it to listen on com5 instead of com1. Just don't do it when the Arduino serial monitor is open because there would be a conflict (and close putty before using the Arduino IDE to upload a new sketch). Once you have configured putty (look especially at the baud rate, it must match the one used by the sketch) it will work as the serial monitor, allowing you to save the log to a file.

Then, in your sketch, you'll need to comment out (i.e., prefix with //) all the debugging statements you print to Serial, and add the Serial.print() instructions for the data you want to log.

This is not an optimal solution, it's tedious to implement and leaves you without the information that the debugging statements can provide. On the other hand it's relatively quick and less likely to introduce bugs that would require time to be fixed, disrupting your data collection. Anyway, make a copy of your original sketch so you can quickly revert to a working condition.

I got Putty working on com5 and the data logging into a file which is on the PC so I'm just about there.

To make it more complicated I spent the day getting Xbees working so now I can go from the roof wirelessly to the other Xbee on an Arduino next to the slave PC. It may not be the most elegant solution but it does what I need. The whole Arduino setup on the roof is solar powered so no power worries there. The other Arduino is USB powered.