Reading microSD card directly from USB serial port

Is it possible to read a microSD card (on a breakout) through the USB port on the arduino?

From the PC, no. The SD card reader is not a separate piece of hardware that you can connect directly to.

You could program the Arduino to respond to serial commands that direct it to return data from/about the SD card. Then, you'd need to write an application on the PC that could send the relevant commands and react to the returned information.

Sounds easy, but not for a newbee 8)
Is is possible with a ethetnet shield?
I have an Seeeduino stalker and i want to copy the log file from the SD card to my pc once a while.
Does anyone know how i can do this easy?

Is is possible with a ethetnet shield?

No.

Thats not what i want to hear, but i have to live whit this fact.

There is also a serial connection on the board. Does somebody know if its possible to dowlaod the lof file on the SD card by using de serial connection?

Does somebody know

I know but you don't want to here that either.

mmm, so the only possibility is to remove the SD card and put in my PC?
Thats too bad....

An SD card uses an SPI interface. You can talk to it with any device that can handle SPI, like the arduino. So the arduino can talk to your card and then use that data for something. Like in the Lady Ada sound shield or in various graphics LCD shields.

However, SPI is not a protocol that the PC talks, things like card readers convert the USB protocol to SPI and back to USB so the PC can make sense of it.

http://www.ladyada.net/learn/arduino/ethfiles.html

It seems thats it is possible, but i realise i have to learn more first, before i start this project......

There is an example that uses a webserver to allow you to download the files on the SD.

I am using the version 22 compiler. I found this on the first look through the examples and libraries.

I am using the standard Arduino Wiznet Ethernet shield with the micro-SD card. I tested this -- it works fine on my Mega2560.

Grumpy_Mike:

Is is possible with a ethetnet shield?

No.

what is this?

http://www.ladyada.net/learn/arduino/ethfiles.html

That's called TCP/IP, not USB :wink:

So the arduino can talk to your card and then use that data for something.

The Arduino can also talk to the serial port. You could develop an application on the PC that would tell the Arduino to spool data from the SD card back to the PC, via the serial port. The PC application would then need to store the data spooled back.

Pretty simple application for the PC and for the Arduino.

Arduino isn't the right tool for this job.

Ask not "can I do this with Arduino", ask "what I need to get this done."

I suggest a Teensy, or a Teensy++, they have built-in USB

It wouldn't be possible to connect directly with the sd card trough a separate usb cable hooked onto the sd shield?
Not going trough Arduino, so the sd cards looks just like a normal card connected directly to the pc.

My problems is that I need to make a watertight enclosure and i need access to the sd card files.

Martin

I need something similar.
I want to log the data to the SD and then send it to a server (MySQL).

Most people have a server running at home or have web-space.
But what if your server is broken or down. So i want the stuff first on SD and then
upload it every 5 minutes.

I was playing around before a year but since that i had no time.
I have to windows bat files here i used but can't remember what i did exactly.
But if you have the Arduino running as server then it can be done.
Here is what i found in my old folder (bat files).
GNU Wget:

"C:\Program Files (x86)\GnuWin32\bin\wget.exe" http://192.168.0.80/LOGGER01.CSV -O F:\0\LOGGER01.CSV

And this one:

' Set your settings
strFileURL = "http://192.168.0.80/LOGGER00.CSV"
strSavePath = "F:\0\"

' Send an HTTP request for the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")

objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()

' If the server responds with "OK"...
If objXMLHTTP.Status = 200 Then
    ' Create a stream object to write downloaded data to
    Set objADOStream = CreateObject("ADODB.Stream")
    objADOStream.Open
    objADOStream.Type = 1 'adTypeBinary

    objADOStream.Write objXMLHTTP.ResponseBody
    objADOStream.Position = 0

    ' Create an empty file on disk
    Set objFso = Createobject("Scripting.FileSystemObject")
    ' Make sure we don't have any name collision...
    If objFso.Fileexists(strSavePath) Then objFSO.DeleteFile strSavePath
    Set objFso = Nothing

    ' Write the stream data to file
    objADOStream.SaveToFile strSavePath
    objADOStream.Close
    Set objADOStream = Nothing
End if

Set objXMLHTTP = Nothing

Sure not USB but you can copy the stuff to your PC.

I really do not see the problem here, but maybe that is just me.
The Arduino can read the SD card and send data to the serial port. A PC can receive data from the serial port.

Write a program (Visual basic even or pascal) that sends a 'send' command (ctrl-s or whatever you like) to the arduini whereupun the arduino responds with reading the sd card and sending the bytes to the serial port. Your PC program then must be awaiting that data and do something with it (write it to disk, as bytes or as data directly in a CSV or database file). When the Arduino is done, he sends a code that the PC understands as 'done'

I have done something similar long time ago with an 8052 and Clipper on a PC. The 8052 upon command dumped its data memory to the serial port and the PC stored that in a clipper file.

Piece of cake.

I am thinking with the new Arduino Yún it might be possible, though you would have to make the code.

is it not possable to have the base code or sketch on sd or usb storage and activate it through the bootloader?
if you can ake arduino read from a text file there must be a way to hack the bootloader to read lines into the code even though the bootloader should be read only. after all you only need the comand lines in theory right. and does anyone know where i can find the bootloader code? thanks in advance.

is it not possable to have the base code or sketch on sd or usb storage and activate it through the bootloader?
if you can ake arduino read from a text file there must be a way to hack the bootloader to read lines into the code even though the bootloader should be read only. after all you only need the comand lines in theory right. and does anyone know where i can find the bootloader code? thanks in advance.

oh and does anyone know how to build your own sd shield? ive had a thought about mass storage id like to try :slight_smile: